diff --git a/assets/styles/ep-design.css b/assets/styles/ep-design.css index e68e3fc0..db20dd89 100644 --- a/assets/styles/ep-design.css +++ b/assets/styles/ep-design.css @@ -252,6 +252,16 @@ @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 */ .data-table { @apply w-full; diff --git a/src/Menu/AdminMenuBuilder.php b/src/Menu/AdminMenuBuilder.php index 5513057c..e223bbb6 100644 --- a/src/Menu/AdminMenuBuilder.php +++ b/src/Menu/AdminMenuBuilder.php @@ -103,32 +103,32 @@ class AdminMenuBuilder ], ]); - $this->addLogoutItem($menu); + $this->addAccountGroup($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); - $menu->addChild('MyE&P', [ + $account = $menu->addChild('Mein Account', [ + 'extras' => [ + 'icon' => 'user', + ], + ]); + $account->addChild('MyE&P', [ 'route' => 'app_account', 'linkAttributes' => [ 'title' => 'zu MyE&P', ], - 'extras' => [ - 'icon' => 'logout', - ], ]); - $menu->addChild('Logout', [ + $account->addChild('Abmelden', [ 'route' => 'app_logout', - 'linkAttributes' => [ - 'title' => 'Logout', - ], - 'extras' => [ - 'icon' => 'logout', - ], ]); } diff --git a/templates/layout_admin.html.twig b/templates/layout_admin.html.twig index a3fbcb6a..44237f28 100644 --- a/templates/layout_admin.html.twig +++ b/templates/layout_admin.html.twig @@ -1,7 +1,8 @@ {# 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 - the drawer too, so the phone header holds only logo, app name and button. + 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' %} @@ -44,13 +45,10 @@ -