|
1 | 1 | {% trans_default_domain "messages" %} |
2 | 2 |
|
3 | 3 | {% if app.user %} |
4 | | - {% component dropdown with { permanent: permanent ?? true } %} |
5 | | - {% block button %} |
6 | | - {% component button with { circle: true, ariaLabel: "common.account_menu"|trans } %} |
7 | | - {% block content %} |
8 | | - {{ component("avatar", { user: app.user, permanent, id: "user-picture" }) }} |
9 | | - {% endblock %} |
10 | | - {% endcomponent %} |
11 | | - {% endblock %} |
| 4 | + <button type="button" class="flex mx-3 text-sm bg-gray-800 rounded-full md:mr-0 focus:ring-4 focus:ring-gray-300 dark:focus:ring-gray-600" id="user-menu-button" aria-expanded="false" data-dropdown-toggle="dropdown"> |
| 5 | + <span class="sr-only">Open user menu</span> |
| 6 | + {{ component("avatar", { user: app.user, permanent, id: "user-picture", small: true }) }} |
| 7 | + </button> |
| 8 | + <div class="hidden z-50 my-4 w-56 text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600" id="dropdown"> |
| 9 | + <div class="py-3 px-4"> |
| 10 | + <span class="block text-sm font-semibold text-gray-900 dark:text-white">{{ app.user.profile.username }}</span> |
| 11 | + <span class="block text-sm font-light text-gray-500 truncate dark:text-gray-400">{{ app.user.email }}</span> |
| 12 | + </div> |
| 13 | + <ul class="py-1 font-light text-gray-500 dark:text-gray-400" aria-labelledby="dropdown"> |
| 14 | + <li> |
| 15 | + <a |
| 16 | + class="flex items-center py-2 px-4 text-sm hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" |
| 17 | + href="{{ path("app_profile_show", { slug: app.user.profile.slug }) }}" |
| 18 | + > |
| 19 | + {{ component('icon', { class: 'h-5 w-5 mr-2 text-gray-400', icon: 'user-circle' }) }} |
| 20 | + {{ "common.my_profile"|trans }} |
| 21 | + </a> |
| 22 | + </li> |
| 23 | + <li> |
| 24 | + <a |
| 25 | + class="flex items-center py-2 px-4 text-sm hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" |
| 26 | + href="{{ path("app_edit_profile") }}" |
| 27 | + > |
| 28 | + {{ component('icon', { class: 'h-5 w-5 mr-2 text-gray-400', icon: 'cog' }) }} |
| 29 | + {{ "common.account_settings"|trans }} |
| 30 | + </a> |
| 31 | + </li> |
| 32 | + </ul> |
12 | 33 |
|
13 | | - {% block items %} |
14 | | - <li class="menu-title select-none"> |
15 | | - <span>{{ "common.my_account"|trans }}</span> |
16 | | - </li> |
17 | | - <li><a href="{{ path("app_profile_show", { slug: app.user.profile.slug }) }}">{{ "common.my_profile"|trans }}</a></li> |
18 | | - <li><a href="{{ path("app_edit_profile") }}">{{ "common.account_settings"|trans }}</a></li> |
19 | 34 | {% if is_granted(constant("App\\Enum\\UserRoleEnum::Admin").value) %} |
20 | | - <li class="menu-title select-none"> |
21 | | - <span>{{ "common.admin"|trans }}</span> |
22 | | - </li> |
23 | | - <li><a href="{{ path("admin_homepage") }}">{{ "common.admin"|trans }}</a></li> |
| 35 | + <ul class="py-1 font-light text-gray-500 dark:text-gray-400" aria-labelledby="dropdown"> |
| 36 | + <li> |
| 37 | + <a |
| 38 | + class="flex items-center py-2 px-4 text-sm hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" |
| 39 | + href="{{ path("admin_homepage") }}" |
| 40 | + > |
| 41 | + {{ component('icon', { class: 'h-5 w-5 mr-2 text-gray-400', icon: 'wrench' }) }} |
| 42 | + {{ "common.admin"|trans }} |
| 43 | + </a> |
| 44 | + </li> |
| 45 | + </ul> |
24 | 46 | {% endif %} |
25 | | - <li class="menu-title select-none"> |
26 | | - <span>{{ "common.logout"|trans }}</span> |
27 | | - </li> |
28 | | - <li><a href="{{ path("security_logout") }}">{{ "common.logout"|trans }}</a></li> |
29 | | - {% endblock %} |
30 | | - {% endcomponent %} |
| 47 | + |
| 48 | + <ul class="py-1 font-light text-gray-500 dark:text-gray-400" aria-labelledby="dropdown"> |
| 49 | + <li> |
| 50 | + <a |
| 51 | + class="flex items-center py-2 px-4 text-sm hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" |
| 52 | + href="{{ path("security_logout") }}" |
| 53 | + > |
| 54 | + {{ component('icon', { class: 'h-5 w-5 mr-2 text-gray-400', icon: 'log-out' }) }} |
| 55 | + {{ "common.logout"|trans }} |
| 56 | + </a> |
| 57 | + </li> |
| 58 | + </ul> |
| 59 | + </div> |
31 | 60 | {% else %} |
32 | 61 | {% component dropdown %} |
33 | 62 | {% block button %} |
|
0 commit comments