Rende il CRM comodo da usare anche da cellulare.
CI / scan_ruby (push) Failing after 11m43s
CI / scan_js (push) Successful in 11m18s
CI / lint (push) Failing after 11m56s

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>
This commit is contained in:
2026-08-18 10:55:50 +02:00
co-authored by Cursor
parent d98c3e87a8
commit 0e8730b889
24 changed files with 683 additions and 295 deletions
@@ -0,0 +1,39 @@
<nav id="mobile-bottom-nav" class="fixed inset-x-0 bottom-0 z-30 border-t border-zinc-200 bg-white/95 pb-[env(safe-area-inset-bottom)] backdrop-blur dark:border-zinc-800 dark:bg-zinc-950/95 md:hidden">
<div class="flex items-stretch">
<%= link_to today_path, class: mobile_tab_class(today_path, controllers: %w[today]) do %>
<svg class="size-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
<rect x="3.5" y="5" width="17" height="15" rx="2" />
<path stroke-linecap="round" d="M8 3.5v3M16 3.5v3M3.5 9.5h17" />
</svg>
<span>Oggi</span>
<% end %>
<%= link_to organizations_path, class: mobile_tab_class(organizations_path, controllers: %w[organizations contacts]) do %>
<svg class="size-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M4 20V8.5L12 4l8 4.5V20" />
<path stroke-linecap="round" d="M9 20v-6h6v6" />
</svg>
<span>Org</span>
<% end %>
<%= link_to pipeline_path, class: mobile_tab_class(pipeline_path, controllers: %w[pipeline opportunities]) do %>
<svg class="size-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
<path stroke-linecap="round" d="M5 5v14M12 5v14M19 5v14" />
</svg>
<span>Pipeline</span>
<% end %>
<%= link_to dashboard_mailings_path, class: mobile_tab_class(dashboard_mailings_path, controllers: %w[mailings mail_templates mail_identities]) do %>
<svg class="size-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
<rect x="3.5" y="5.5" width="17" height="13" rx="2" />
<path stroke-linecap="round" stroke-linejoin="round" d="m4 7 8 6 8-6" />
</svg>
<span>Email</span>
<% end %>
<button type="button" data-action="sheet#toggle" class="flex min-h-12 min-w-0 flex-1 flex-col items-center justify-center gap-0.5 px-1 py-1 text-[11px] font-medium text-zinc-500 dark:text-zinc-400">
<svg class="size-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
<circle cx="5" cy="12" r="1.4" fill="currentColor" />
<circle cx="12" cy="12" r="1.4" fill="currentColor" />
<circle cx="19" cy="12" r="1.4" fill="currentColor" />
</svg>
<span>Altro</span>
</button>
</div>
</nav>
@@ -0,0 +1,32 @@
<div data-sheet-target="panel" class="fixed inset-0 z-40 hidden md:hidden" role="dialog" aria-modal="true" aria-labelledby="mobile-more-title">
<button type="button" class="absolute inset-0 bg-zinc-950/40 dark:bg-black/60" data-action="sheet#hide" aria-label="Chiudi"></button>
<div class="absolute inset-x-0 bottom-0 max-h-[85vh] overflow-y-auto rounded-t-2xl border border-zinc-200 bg-white pb-[calc(env(safe-area-inset-bottom)+1rem)] shadow-xl dark:border-zinc-800 dark:bg-zinc-950">
<div class="sticky top-0 flex items-center justify-between border-b border-zinc-100 bg-white px-4 py-3 dark:border-zinc-800 dark:bg-zinc-950">
<h2 id="mobile-more-title" class="text-base font-semibold">Menu</h2>
<button type="button" data-action="sheet#hide" class="<%= btn_secondary %> px-3" aria-label="Chiudi">Chiudi</button>
</div>
<nav class="space-y-1 p-3">
<%= nav_link "Dashboard", project_root_path %>
<%= nav_link "Contatti", contacts_path %>
<%= nav_link "Task", tasks_path %>
<%= nav_link "Report", reports_path %>
<%= nav_link "Impostazioni", settings_path %>
<%= nav_link "Template email", mail_templates_path %>
<% if current_user.admin? %>
<%= nav_link "Account SMTP", mail_identities_path %>
<%= nav_link "Utenti", users_path %>
<% end %>
</nav>
<div class="border-t border-zinc-100 p-3 dark:border-zinc-800">
<div class="mb-2 text-xs font-medium uppercase tracking-wide text-zinc-400">Cambia progetto</div>
<div class="space-y-1">
<% available_projects.each do |project| %>
<%= link_to project.name,
project_root_path(project_code: project.code),
class: "block truncate rounded-lg px-3 py-2.5 text-sm #{project.id == current_project.id ? 'bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900' : 'text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800'}" %>
<% end %>
</div>
<%= link_to "Tutti i progetti", root_path, class: "mt-2 block rounded-lg px-3 py-2.5 text-sm text-zinc-500 hover:bg-zinc-100 dark:hover:bg-zinc-800" %>
</div>
</div>
</div>
+2 -2
View File
@@ -1,7 +1,7 @@
<div class="overflow-hidden rounded-xl border border-zinc-200 bg-white text-zinc-900 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-100">
<div class="divide-y divide-zinc-100 dark:divide-zinc-800">
<% tasks.each do |task| %>
<div class="flex flex-wrap items-center gap-3 px-4 py-3 <%= 'bg-rose-50' if task.overdue? %> <%= 'bg-amber-50' if task.due_today? %>">
<div class="flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center <%= 'bg-rose-50' if task.overdue? %> <%= 'bg-amber-50' if task.due_today? %>">
<div class="min-w-0 flex-1">
<div class="flex flex-wrap items-center gap-2">
<%= link_to task.organization.name, task.organization, class: "font-medium text-zinc-900 hover:underline dark:text-zinc-100" %>
@@ -14,7 +14,7 @@
<% if task.assigned_user %>· <%= task.assigned_user.full_name %><% end %>
</div>
</div>
<div class="flex items-center gap-2">
<div class="flex w-full flex-wrap items-center gap-2 sm:w-auto">
<%= button_to "Completa", complete_task_path(task), method: :patch, class: "rounded-md bg-emerald-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-emerald-700" %>
<%= link_to "Apri", task.organization, class: "rounded-md border border-zinc-300 px-3 py-1.5 text-xs font-medium text-zinc-700 hover:bg-zinc-50 dark:border-zinc-600 dark:text-zinc-200 dark:hover:bg-zinc-800" %>
</div>
+1 -1
View File
@@ -1,7 +1,7 @@
<button type="button"
data-controller="theme"
data-action="theme#toggle"
class="inline-flex size-9 items-center justify-center rounded-lg border border-zinc-200 text-zinc-600 hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800"
class="inline-flex size-11 items-center justify-center rounded-lg border border-zinc-200 text-zinc-600 hover:bg-zinc-100 md:size-9 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800"
aria-label="Passa al tema scuro o chiaro"
title="Tema">
<svg class="size-4 dark:hidden" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
+8 -7
View File
@@ -1,14 +1,15 @@
<div class="relative" data-controller="dropdown">
<button type="button" data-action="dropdown#toggle" class="flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-zinc-600 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800">
<span class="max-w-[12rem] truncate font-medium text-zinc-900 dark:text-zinc-100"><%= current_user.full_name %></span>
<span class="text-xs text-zinc-400"><%= current_user.admin? ? "Admin" : "Utente" %></span>
<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 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 text-sm text-zinc-700 hover:bg-zinc-50 dark:text-zinc-200 dark:hover:bg-zinc-800" %>
<%= 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 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 text-left text-sm text-zinc-700 hover:bg-zinc-50 dark:text-zinc-200 dark:hover:bg-zinc-800" %>
<%= 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>