engelsystem/resources/views/pages/news/news.twig

45 lines
1.5 KiB
Twig
Raw Normal View History

2020-04-05 16:54:45 +02:00
{% extends 'pages/news/overview.twig' %}
{% import 'macros/base.twig' as m %}
{% import 'macros/form.twig' as f %}
{% block title %}{% if news.is_meeting %}{{ __('news.is_meeting') }} {% endif %}{{ news.title }}{% endblock %}
2020-04-05 16:54:45 +02:00
{% block news %}
{{ _self.news(news) }}
{% endblock %}
{% block comments %}
2021-07-24 12:38:23 +02:00
<div class="col-md-12 mt-4">
2020-04-05 16:54:45 +02:00
<h2>{{ __('news.comments') }}</h2>
{% for comment in news.comments %}
2021-07-24 12:38:23 +02:00
<div class="card {% if theme.type == 'light' %}bg-light{% else %}bg-secondary{% endif %} mb-4">
<div class="card-body {{ m.type_bg_class() }}">
2020-04-05 16:54:45 +02:00
{{ comment.text|nl2br }}
</div>
2021-07-24 12:38:23 +02:00
<div class="card-footer text-muted d-flex align-items-center">
<div class="me-3">
{{ m.icon('clock') }}
{{ comment.created_at.format(__('Y-m-d H:i')) }}
</div>
2020-04-05 16:54:45 +02:00
{{ m.user(comment.user) }}
</div>
</div>
{% endfor %}
</div>
{% endblock %}
{% block write_comment %}
{% if has_permission_to('news_comments') %}
2021-07-24 12:38:23 +02:00
<div class="col-md-12 mt-4">
2020-04-05 16:54:45 +02:00
<h3>{{ __('news.comments.new') }}</h3>
<form action="" enctype="multipart/form-data" method="post">
{{ csrf() }}
{{ f.textarea('comment', __('news.comments.message'), {'required': true}) }}
{{ f.submit() }}
</form>
</div>
{% endif %}
{% endblock %}