{% extends 'layouts/app.twig' %} {% import 'macros/base.twig' as m %} {% set only_meetings = only_meetings|default(false) %} {% block title %}{{ not only_meetings ? __('news.title') : __('news.title.meetings') }}{% endblock %} {% block content %}

{{ block('title') }} {%- if has_permission_to('admin_news') and is_overview|default(false) -%} {{ m.button(m.icon('plus-lg'), url('admin/news', only_meetings ? {'meeting': 1} : {}), 'secondary') }} {%- endif %}

{% include 'layouts/parts/messages.twig' %}
{% block news %} {% for news in news %} {{ _self.news(news, true, is_overview) }} {% endfor %} {% endblock %}
{% block comments %} {% endblock %} {% block pagination %} {% if pages|default(0) > 1 %}
    {% for p in range(1, pages) %}
  • {{ p }}
  • {% endfor %}
{% endif %} {% endblock %} {% block write_comment %} {% endblock %}
{% endblock %} {% macro news(news, show_comments_link, is_overview) %}
{% if is_overview|default(false) %}
{% if news.is_pinned %}{{ m.icon('pin-angle') }}{% endif %} {% if news.is_meeting %}{{ __('news.is_meeting') }}{% endif %} {{ news.title }}
{% endif %}
{{ news.text(not is_overview)|markdown }} {% if is_overview and news.text != news.text(false) %} {{ m.button(__('news.read_more'), url('news/' ~ news.id), null, 'sm', null, null, 'chevron-double-right') }} {% endif %}
{% endmacro %}