feat: adopt ep-design 1.5.0 in admin

This commit is contained in:
fromme committed 2026-11-13 15:14:05 +01:00
1 parent fd3d88209c
commit 6cfaaf1ba9
3 files changed
+28 -20

No files matched your search

+10
View File
@@ -252,6 +252,16 @@
@apply m-0 h-dvh max-h-none w-80 max-w-[calc(100vw-4rem)] bg-page p-0; @apply m-0 h-dvh max-h-none w-80 max-w-[calc(100vw-4rem)] bg-page p-0;
} }
/*
* a modal dialog doesn't stop the page behind it from scrolling: on touch screens the page took the
* gesture first, and a long navigation in the drawer only scrolled once the page was at its end.
* Only for the drawer: locking for every dialog:modal would hide the page's scrollbar under a
* desktop modal and shift the layout sideways.
*/
html:has(dialog.drawer:modal) {
@apply overflow-hidden;
}
/* lists in a card: the outer cells line up with the card's padding */ /* lists in a card: the outer cells line up with the card's padding */
.data-table { .data-table {
@apply w-full; @apply w-full;
+13 -13
View File
@@ -103,32 +103,32 @@ class AdminMenuBuilder
], ],
]); ]);
$this->addLogoutItem($menu); $this->addAccountGroup($menu);
return $menu; return $menu;
} }
private function addLogoutItem(ItemInterface $menu): void /**
* The account actions close the menu as one group without a route, so it opens in place in the
* sidebar and the drawer alike; sub-items carry no icons.
*/
private function addAccountGroup(ItemInterface $menu): void
{ {
$this->addDivider($menu); $this->addDivider($menu);
$menu->addChild('MyE&P', [ $account = $menu->addChild('Mein Account', [
'extras' => [
'icon' => 'user',
],
]);
$account->addChild('MyE&P', [
'route' => 'app_account', 'route' => 'app_account',
'linkAttributes' => [ 'linkAttributes' => [
'title' => 'zu MyE&P', 'title' => 'zu MyE&P',
], ],
'extras' => [
'icon' => 'logout',
],
]); ]);
$menu->addChild('Logout', [ $account->addChild('Abmelden', [
'route' => 'app_logout', 'route' => 'app_logout',
'linkAttributes' => [
'title' => 'Logout',
],
'extras' => [
'icon' => 'logout',
],
]); ]);
} }
+5 -7
View File
@@ -1,7 +1,8 @@
{# {#
The admin in the sidebar layout of the E&P corporate design: the KnpMenu menu `admin_main` in a 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. Below lg the user moves into left sidebar from lg up, below that in a drawer behind the menu button. The menu ends with a
the drawer too, so the phone header holds only logo, app name and button. "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' %} {% extends 'base_admin.html.twig' %}
@@ -44,13 +45,10 @@
<img src="{{ asset('build/images/ep-logo.svg') }}" alt="" class="h-9 w-auto"> <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> <button type="button" class="btn-tool" {{ stimulus_action('drawer', 'close') }}>Schließen</button>
</div> </div>
<nav class="flex-1 overflow-y-auto px-4 pb-8"> {# 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') }} {{ knp_menu_render('admin_main') }}
</nav> </nav>
{# the user as in the header from lg up; logout is an entry of admin_main #}
<div class="border-t border-line px-6 py-4">
<p class="text-muted">{{ app.user.userIdentifier }}</p>
</div>
</div> </div>
</dialog> </dialog>
{% endif %} {% endif %}