{# templates/app/base.html.twig — Layout autonome pour l'espace tenant GestRestoSco #} {% block title %}GestRestoSco {% endblock %} {# Bootstrap 5 (CDN) #} {# Font Awesome (CDN) #} {# Application CSS #} {# Thème dynamique tenant #} {% set _theme = app.request.attributes.get('_theme') %} {% if _theme and _theme.theme in ['personnalise', 'sombre'] %} {% endif %} {% block stylesheets %}{% endblock %} {# Anti-flash sidebar : applique la classe collapsed AVANT le premier rendu #} {# ── Topbar ──────────────────────────────────────────────────────────── #}
GestRestoSco {% if app.request.attributes.get('_tenant') %} {% set _currentTenant = app.request.attributes.get('_tenant') %} {% set _linkedTenants = app.session.get('_linked_tenants', []) %} {% if _linkedTenants|length > 1 %} {# Sélecteur multi-établissements #} {% else %} {{ _currentTenant.name }} {% endif %} {% endif %}
{% if app.user %} {{ app.user.prenom }} {{ app.user.nom }} {% if app.user.mustChangePassword() %} {% endif %} Déconnexion {% endif %}
{% if app.user %} {% endif %} {# ── Sidebar (uniquement si connecté) ────────────────────────────────── #} {% if app.user %} {% endif %} {# ── Contenu principal ────────────────────────────────────────────────── #}
{# Flash messages #} {% if app.flashes|length > 0 %}
{% for type, messages in app.flashes %} {% for message in messages %} {% endfor %} {% endfor %}
{% endif %} {% block body %}{% endblock %}
{# Bootstrap 5 JS (CDN) #} {# Application JS #} {% block javascripts %}{% endblock %}