feat: group the sidebar, add a settings hub and move account actions to a header user menu
This commit is contained in:
1 parent
acd8e78e55
commit
7095456d36
16 files changed
+487
-477
No files matched your search
@@ -0,0 +1,35 @@
|
||||
{#
|
||||
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.
|
||||
#}
|
||||
{% set user_menu = knp_menu_get('default_user') %}
|
||||
<div class="relative"
|
||||
{{ stimulus_controller('toggle', { open: false }, { closed: 'hidden' }) }}
|
||||
{{ stimulus_action('toggle', 'closeOutside', 'click@window')|stimulus_action('toggle', 'close', 'keydown.esc@window') }}>
|
||||
<button type="button"
|
||||
class="flex items-center gap-x-2 text-sm text-ink hover:text-brand"
|
||||
aria-haspopup="true"
|
||||
{{ stimulus_action('toggle', 'toggle') }}>
|
||||
{% if app.user.teamer and app.user.teamer.photo %}
|
||||
<img src="{{ asset(app.user.teamer.photo | upload_filename_full | imagine_filter('profile')) }}"
|
||||
class="h-8 w-8 rounded-full object-cover"
|
||||
alt="">
|
||||
{% else %}
|
||||
{{ icon('user', 'w-8 h-8 text-brand') }}
|
||||
{% endif %}
|
||||
<span class="hidden sm:inline">{{ app.user.firstName }}</span>
|
||||
</button>
|
||||
<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="user-menu-item" 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="user-menu-item" 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="user-menu-item" role="menuitem">{{ icon(item.extras.icon, 'w-5 h-5 text-muted') }}{{ item.label }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user