Aggiunge navigazione mobile dedicata e trasforma le principali liste operative in layout più leggibili e facili da toccare. Co-authored-by: Cursor <cursoragent@cursor.com>
16 lines
1.6 KiB
ERB
16 lines
1.6 KiB
ERB
<div class="relative" data-controller="dropdown">
|
|
<button type="button" data-action="dropdown#toggle" class="flex size-11 items-center justify-center rounded-lg text-sm text-zinc-600 hover:bg-zinc-100 md:size-auto md:gap-2 md:px-2 md:py-1.5 dark:text-zinc-300 dark:hover:bg-zinc-800">
|
|
<span class="flex size-9 items-center justify-center rounded-full bg-zinc-900 text-xs font-semibold text-white md:hidden dark:bg-zinc-100 dark:text-zinc-900"><%= user_initials(current_user) %></span>
|
|
<span class="hidden max-w-[12rem] truncate font-medium text-zinc-900 md:inline dark:text-zinc-100"><%= current_user.full_name %></span>
|
|
<span class="hidden text-xs text-zinc-400 md:inline"><%= current_user.admin? ? "Admin" : "Utente" %></span>
|
|
</button>
|
|
<div data-dropdown-target="menu" class="absolute right-0 z-30 mt-1 hidden w-48 rounded-lg border border-zinc-200 bg-white py-1 shadow-lg dark:border-zinc-700 dark:bg-zinc-900">
|
|
<% if current_user.admin? %>
|
|
<%= link_to "Impostazioni", admin_path, class: "block px-4 py-2.5 text-sm text-zinc-700 hover:bg-zinc-50 dark:text-zinc-200 dark:hover:bg-zinc-800" %>
|
|
<%= link_to "Utenti", users_path, class: "block px-4 py-2.5 text-sm text-zinc-700 hover:bg-zinc-50 dark:text-zinc-200 dark:hover:bg-zinc-800" %>
|
|
<% end %>
|
|
<%= link_to "Password", edit_password_path, class: "block px-4 py-2.5 text-sm text-zinc-700 hover:bg-zinc-50 dark:text-zinc-200 dark:hover:bg-zinc-800" %>
|
|
<%= button_to "Esci", logout_path, method: :delete, class: "block w-full px-4 py-2.5 text-left text-sm text-zinc-700 hover:bg-zinc-50 dark:text-zinc-200 dark:hover:bg-zinc-800" %>
|
|
</div>
|
|
</div>
|