{% extends 'layouts/app.twig' %} {% import 'macros/base.twig' as m %} {% import 'macros/form.twig' as f %} {% block title %}{{ news ? __('news.edit.edit') : __('news.edit.add') }}{% endblock %} {% block content %}

{{ block('title') }}

{% include 'layouts/parts/messages.twig' %} {% if news %}

{{ m.glyphicon('time') }} {{ news.updated_at.format(__('Y-m-d H:i')) }} {% if news.updated_at != news.created_at %}  {{ __('news.updated') }}
{{ m.glyphicon('time') }} {{ news.created_at.format(__('Y-m-d H:i')) }} {% endif %}  {{ m.user(news.user) }}

{% endif %}
{{ csrf() }}
{{ f.input( 'title', __('news.edit.subject'), null, {'required': true, 'value': news ? news.title : ''} ) }}
{{ f.checkbox('is_meeting', __('news.edit.is_meeting'), is_meeting) }}
{{ f.textarea('text', __('news.edit.message'), {'required': true, 'rows': 10, 'value': news ? news.text : ''}) }} {{ f.submit() }} {% if news %} {{ f.submit(m.glyphicon('trash'), {'name': 'delete', 'btn_type': 'danger'}) }} {% endif %}
{% endblock %}