2020-04-05 16:54:45 +02:00
|
|
|
{% extends 'layouts/app.twig' %}
|
|
|
|
{% import 'macros/base.twig' as m %}
|
|
|
|
{% import 'macros/form.twig' as f %}
|
|
|
|
|
2020-12-06 00:16:15 +01:00
|
|
|
{% block title %}{{ news and news.id ? __('news.edit.edit') : __('news.edit.add') }}{% endblock %}
|
2020-04-05 16:54:45 +02:00
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="container">
|
|
|
|
<h1>{{ block('title') }}</h1>
|
|
|
|
|
|
|
|
{% include 'layouts/parts/messages.twig' %}
|
|
|
|
|
2020-12-06 00:16:15 +01:00
|
|
|
{% if news and news.id %}
|
2020-04-05 16:54:45 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<p>
|
|
|
|
{{ m.glyphicon('time') }} {{ news.updated_at.format(__('Y-m-d H:i')) }}
|
|
|
|
|
|
|
|
{% if news.updated_at != news.created_at %}
|
|
|
|
 {{ __('news.updated') }}
|
|
|
|
<br>
|
|
|
|
{{ m.glyphicon('time') }} {{ news.created_at.format(__('Y-m-d H:i')) }}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
 {{ m.user(news.user) }}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<form action="" enctype="multipart/form-data" method="post">
|
|
|
|
{{ csrf() }}
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6">
|
|
|
|
{{ f.input(
|
|
|
|
'title',
|
|
|
|
__('news.edit.subject'),
|
|
|
|
null,
|
|
|
|
{'required': true, 'value': news ? news.title : ''}
|
|
|
|
) }}
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
2020-05-12 00:12:49 +02:00
|
|
|
{{ f.checkbox('is_meeting', __('news.edit.is_meeting'), is_meeting) }}
|
2020-12-27 02:51:05 +01:00
|
|
|
{{ f.checkbox('is_pinned', __('news.edit.is_pinned'), is_pinned) }}
|
2020-04-05 16:54:45 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
{{ f.textarea('text', __('news.edit.message'), {'required': true, 'rows': 10, 'value': news ? news.text : ''}) }}
|
|
|
|
|
|
|
|
{{ f.submit() }}
|
|
|
|
|
2020-12-06 00:16:15 +01:00
|
|
|
{{ f.submit(m.glyphicon('eye-close'), {'name': 'preview', 'btn_type': 'info', 'title': __('form.preview')}) }}
|
2020-10-21 00:12:29 +02:00
|
|
|
|
2020-12-06 00:16:15 +01:00
|
|
|
{% if news and news.id %}
|
|
|
|
{{ f.submit(m.glyphicon('trash'), {'name': 'delete', 'btn_type': 'danger', 'title': __('form.delete')}) }}
|
2020-04-05 16:54:45 +02:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-10-21 00:12:29 +02:00
|
|
|
{% if news %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
2020-12-06 00:16:15 +01:00
|
|
|
<h2>{{ __('form.preview') }}</h2>
|
2020-10-21 00:12:29 +02:00
|
|
|
|
|
|
|
<div class="panel {% if not news.is_meeting %}panel-default{% else %}panel-info{% endif %}">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">
|
|
|
|
{% if news.is_meeting %}{{ __('news.is_meeting') }}{% endif %}
|
|
|
|
{{ news.title }}
|
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="panel-body">
|
2020-10-21 01:08:03 +02:00
|
|
|
{{ news.text|raw|markdown(false) }}
|
2020-10-21 00:12:29 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
2020-04-05 16:54:45 +02:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|