{% extends 'categories/management/base.html' %} {% from 'categories/management/_events_list.html' import render_events_list %} {% from 'categories/management/_create_category_button.html' import create_category_button %} {% from 'events/management/_create_event_button.html' import create_event_button %} {% 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, has_events=false) %}
{{ create_category_button(category, classes='highlight icon-plus') }} {% if not has_events %} {{ create_event_button(category, text=_("Create event")) }} {% endif %}
{{ 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(category) }} {{ create_event_button(category, text=_("Create event")) }} {% else %} {% if subcategories %} {{ subcategories_table(subcategories, events.total|bool) }} {% endif %} {% if events.total %} {% if subcategories %}

{% trans %}Events{% endtrans %}

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