{% extends 'categories/management/base.html' %} {% from 'categories/management/_events_list.html' import render_events_list %} {% from 'events/management/_create_event_button.html' import create_event_button %} {% macro _create_category_button(classes='') %} {% trans %}New category{% endtrans %} {% endmacro %} {% macro subcategory_row(subcategory) %} {% if subcategory.is_self_protected %} {% elif subcategory.is_public %} {% endif %} {{ subcategory.title }} {{ move_category_button(subcategory, 'i-link') }} {{ delete_category_button(subcategory, 'i-link') }} {% endmacro %} {% macro subcategories_table(subcategories) %}
{{ _create_category_button(classes='highlight icon-plus') }}
{{ subcategories|count }}
{% for subcategory in subcategories %} {{ subcategory_row(subcategory) }} {% endfor %}
{% trans %}Title{% endtrans %}
{% endmacro %} {% block title %} {% if subcategories %} {% trans %}Categories{% endtrans %} {# If the category also contains events, a second title will be displayed further down the page. #} {% elif events.total %} {% trans %}Events{% endtrans %} {% else %} {% trans %}Content{% endtrans %} {% endif %} {% endblock %} {% block content %} {% if not subcategories and not events.total %}

{% trans %}This category is empty. A category can either hold categories or events.{% endtrans %}

{{ _create_category_button() }} {{ create_event_button(category, text=_("New event")) }} {% else %} {% if subcategories %} {{ subcategories_table(subcategories) }} {% endif %} {% if events.total %} {% if subcategories %}

{% trans %}Events{% endtrans %}

{% endif %} {{ render_events_list(category, page, order_column, direction, events) }} {% endif %} {% endif %} {% endblock content %}