57 lines
2.8 KiB
Twig
57 lines
2.8 KiB
Twig
{#
|
|
The admin in the sidebar layout of the E&P corporate design: the KnpMenu menu `admin_main` in a
|
|
left sidebar from lg up, below that in a drawer behind the menu button. The menu ends with a
|
|
"Mein Account" group (MyE&P, logout), so the account actions are in the sidebar and the drawer alike;
|
|
the user in the header shows from lg up only, and the phone header holds just logo, app name and button.
|
|
#}
|
|
{% extends 'base_admin.html.twig' %}
|
|
|
|
{% block body %}
|
|
<div {{ stimulus_controller('drawer') }}>
|
|
{% embed 'admin/_partials/_header.html.twig' with {
|
|
app_name: 'MyE&P Admin',
|
|
home_path: path(app.user ? 'app_admin_dashboard' : 'app_login'),
|
|
header_width: 'mx-auto max-w-screen-2xl px-4 lg:px-8',
|
|
} %}
|
|
{% block header_end %}
|
|
{% if app.user %}
|
|
<span class="hidden lg:block self-center text-muted">{{ app.user.userIdentifier }}</span>
|
|
<button type="button" class="btn-tool self-center lg:hidden" aria-haspopup="dialog"
|
|
{{ stimulus_action('drawer', 'open') }}>
|
|
{{ include('_partials/_icon.html.twig', {icon: 'menu', class: 'h-4 w-4'}) }}
|
|
Menü
|
|
</button>
|
|
{% endif %}
|
|
{% endblock %}
|
|
{% endembed %}
|
|
|
|
<div class="mx-auto max-w-screen-2xl gap-8 px-4 py-8 lg:grid lg:grid-cols-[14.5rem_minmax(0,1fr)] lg:px-8">
|
|
<nav aria-label="Hauptmenü" class="hidden lg:block">
|
|
{% if app.user %}
|
|
{{ knp_menu_render('admin_main') }}
|
|
{% endif %}
|
|
</nav>
|
|
<main id="content" tabindex="-1" class="min-w-0 outline-none">
|
|
{% block content %}{% endblock %}
|
|
</main>
|
|
</div>
|
|
|
|
{% if app.user %}
|
|
<dialog class="drawer" aria-label="Hauptmenü" {{ stimulus_target('drawer', 'dialog') }}
|
|
{{ stimulus_action('drawer', 'closeOnBackdrop', 'click') }}>
|
|
{# fills the dialog, so only clicks beside the drawer reach the dialog element itself #}
|
|
<div class="flex h-full flex-col">
|
|
<div class="flex items-center justify-between p-4">
|
|
<img src="{{ asset('build/images/ep-logo.svg') }}" alt="" class="h-9 w-auto">
|
|
<button type="button" class="btn-tool" {{ stimulus_action('drawer', 'close') }}>Schließen</button>
|
|
</div>
|
|
{# overscroll-contain: the nav doesn't hand leftover scrolling to the page #}
|
|
<nav class="flex-1 overflow-y-auto overscroll-contain px-4 pb-8">
|
|
{{ knp_menu_render('admin_main') }}
|
|
</nav>
|
|
</div>
|
|
</dialog>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|