feat: add a Mein Account group to the main menu and lock the page while the drawer is open

This commit is contained in:
fromme committed 2026-11-13 15:04:29 +01:00
1 parent 4530d2434b
commit 8a02b28d00
6 files changed
+164 -24

No files matched your search

+3 -7
View File
@@ -1,6 +1,7 @@
{#
The account menu behind the user's picture: own profile, the other areas (MenuBuilder::createUserMenu)
and logout. Opens on click, closes on a click elsewhere and on Escape.
The account menu behind the user's picture: own profile, the other areas and logout
(MenuBuilder::createUserMenu). Opens on click, closes on a click elsewhere and on Escape. Only from lg
up; below that the same items are reached through the main menu in the drawer.
#}
{% set user_menu = knp_menu_get('default_user') %}
<div class="relative"
@@ -22,11 +23,6 @@
<div class="hidden absolute right-0 top-full mt-2 z-40 min-w-56 border border-line bg-white py-1 text-sm shadow-lg"
role="menu"
{{ stimulus_target('toggle', 'toggle') }}>
{% if app.user.teamer %}
<a href="{{ path('app_teamer_profile_index') }}" class="menu-item flex items-center gap-x-3" role="menuitem">{{ icon('user', 'w-5 h-5 text-muted') }}Mein Profil</a>
{% elseif is_granted('ROLE_ADMINISTRATIVE') %}
<a href="{{ path('app_administrative_profile_index') }}" class="menu-item flex items-center gap-x-3" role="menuitem">{{ icon('user', 'w-5 h-5 text-muted') }}Mein Profil</a>
{% endif %}
{% for item in user_menu.children %}
{% if loop.last %}<hr class="my-1 border-line">{% endif %}
<a href="{{ item.uri }}" class="menu-item flex items-center gap-x-3" role="menuitem">{{ icon(item.extras.icon, 'w-5 h-5 text-muted') }}{{ item.label }}</a>
+4 -3
View File
@@ -3,7 +3,8 @@
{#
Sidebar layout of the E&P corporate design (ep-corporate-design, layout_sidebar.html.twig): the
main menu in a left sidebar from lg up, below that in a drawer behind the "Menü" button. The area
layouts fill `main_menu` and `mobile_menu` with the same KnpMenu menu.
layouts fill `main_menu` and `mobile_menu` with the same KnpMenu menu, which ends with the account
group; the header's user menu shows from lg up only.
#}
{% block body %}
<div {{ stimulus_controller('drawer') }}>
@@ -13,7 +14,7 @@
} %}
{% block header_end %}
{% if app.user %}
<div class="flex items-center">
<div class="hidden lg:flex items-center">
{% include '_partials/_user_menu.html.twig' %}
</div>
<button type="button" class="btn-tool self-center lg:hidden" aria-haspopup="dialog"
@@ -42,7 +43,7 @@
<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>
<nav class="flex-1 overflow-y-auto px-4 pb-8">
<nav class="flex-1 overflow-y-auto overscroll-contain px-4 pb-8">
{% block mobile_menu %}{% endblock %}
</nav>
</div>