{# Everything bookable, per type and room. Every write opens a modal via htmx and navigates back here once saved -- the same shape as the sibling apps' admin lists. Retired resources stay listed, muted, because this is the only place they can be reactivated. Only an empty room offers "Löschen"; DeleteController refuses the rest regardless. A resource can always be deleted, taking its bookings with it -- the modal says how many. #} {% extends 'layout.html.twig' %} {% block title %}Ressourcen · E&P Platz{% endblock %} {% macro opener(url, label, variant = 'neutral') %} {% endmacro %} {% macro resource_list(resources) %} {% if resources is empty %}

Noch nichts angelegt.

{% else %} {% endif %} {% endmacro %} {% block content %} ← Übersicht

Ressourcen

Was gebucht werden kann und wo es steht.

{% for section in sections %} {% set type = section.type %}

{{ type.plural }}

{{ _self.opener(path('app_admin_resource_group_new', { type: type.value }), type.groupLabel ~ ' hinzufügen') }} {{ _self.opener(path('app_admin_resource_new', { type: type.value }), type.label ~ ' hinzufügen', 'primary') }}
{% for entry in section.groups %}

{{ entry.group.label }}

{{ _self.opener(path('app_admin_resource_group_edit', { id: entry.group.id }), 'Bearbeiten') }} {% if entry.resources is empty %} {{ _self.opener(path('app_admin_resource_group_delete', { id: entry.group.id }), 'Löschen') }} {% endif %}
{{ _self.resource_list(entry.resources) }}
{% endfor %} {# Only when there is something to show, or when there are no groups at all -- then this is simply the list, as for the car park. #} {% if section.ungrouped is not empty or section.groups is empty %}
{% if section.groups is not empty %}

Ohne {{ type.groupLabel }}

{% endif %} {{ _self.resource_list(section.ungrouped) }}
{% endif %}
{% endfor %} {% endblock %}