Rende leggibili card, badge e testi mute in tema scuro.

Le righe task di oggi restavano crema con testo chiaro; i badge e gli heading senza dark: si perdevano sullo sfondo.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-03 07:36:48 +02:00
co-authored by Cursor
parent 8f73105dfe
commit b5737a7ee7
11 changed files with 104 additions and 47 deletions
+31 -31
View File
@@ -79,41 +79,41 @@ module ApplicationHelper
def status_badge(status)
colors = {
"prospect" => "bg-sky-100 text-sky-800",
"active_customer" => "bg-emerald-100 text-emerald-800",
"inactive_customer" => "bg-slate-100 text-slate-700",
"partner" => "bg-violet-100 text-violet-800",
"lost" => "bg-rose-100 text-rose-800"
"prospect" => "bg-sky-100 text-sky-800 dark:bg-sky-950 dark:text-sky-200",
"active_customer" => "bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200",
"inactive_customer" => "bg-slate-100 text-slate-700 dark:bg-zinc-800 dark:text-zinc-300",
"partner" => "bg-violet-100 text-violet-800 dark:bg-violet-950 dark:text-violet-200",
"lost" => "bg-rose-100 text-rose-800 dark:bg-rose-950 dark:text-rose-200"
}
content_tag :span, Catalog.label_for(Catalog::ORGANIZATION_STATUSES, status),
class: "inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium #{colors[status] || 'bg-slate-100 text-slate-700'}"
class: "inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium #{colors[status] || 'bg-slate-100 text-slate-700 dark:bg-zinc-800 dark:text-zinc-300'}"
end
def stage_badge(stage)
colors = {
"to_contact" => "bg-slate-100 text-slate-700",
"contacted" => "bg-sky-100 text-sky-800",
"replied" => "bg-cyan-100 text-cyan-800",
"interested" => "bg-amber-100 text-amber-800",
"demo_trial" => "bg-orange-100 text-orange-800",
"first_use" => "bg-lime-100 text-lime-800",
"proposal" => "bg-indigo-100 text-indigo-800",
"won" => "bg-emerald-100 text-emerald-800",
"lost" => "bg-rose-100 text-rose-800"
"to_contact" => "bg-slate-100 text-slate-700 dark:bg-zinc-800 dark:text-zinc-300",
"contacted" => "bg-sky-100 text-sky-800 dark:bg-sky-950 dark:text-sky-200",
"replied" => "bg-cyan-100 text-cyan-800 dark:bg-cyan-950 dark:text-cyan-200",
"interested" => "bg-amber-100 text-amber-800 dark:bg-amber-950 dark:text-amber-200",
"demo_trial" => "bg-orange-100 text-orange-800 dark:bg-orange-950 dark:text-orange-200",
"first_use" => "bg-lime-100 text-lime-800 dark:bg-lime-950 dark:text-lime-200",
"proposal" => "bg-indigo-100 text-indigo-800 dark:bg-indigo-950 dark:text-indigo-200",
"won" => "bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200",
"lost" => "bg-rose-100 text-rose-800 dark:bg-rose-950 dark:text-rose-200"
}
content_tag :span, Catalog.label_for(Catalog::PIPELINE_STAGES, stage),
class: "inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium #{colors[stage] || 'bg-slate-100 text-slate-700'}"
class: "inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium #{colors[stage] || 'bg-slate-100 text-slate-700 dark:bg-zinc-800 dark:text-zinc-300'}"
end
def priority_badge(priority)
colors = {
"low" => "bg-slate-100 text-slate-600",
"normal" => "bg-sky-100 text-sky-700",
"high" => "bg-amber-100 text-amber-800",
"urgent" => "bg-rose-100 text-rose-800"
"low" => "bg-slate-100 text-slate-600 dark:bg-zinc-800 dark:text-zinc-300",
"normal" => "bg-sky-100 text-sky-700 dark:bg-sky-950 dark:text-sky-200",
"high" => "bg-amber-100 text-amber-800 dark:bg-amber-950 dark:text-amber-200",
"urgent" => "bg-rose-100 text-rose-800 dark:bg-rose-950 dark:text-rose-200"
}
content_tag :span, Catalog.label_for(Catalog::TASK_PRIORITIES, priority),
class: "inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium #{colors[priority] || 'bg-slate-100'}"
class: "inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium #{colors[priority] || 'bg-slate-100 text-slate-700 dark:bg-zinc-800 dark:text-zinc-300'}"
end
def format_money(value)
@@ -139,7 +139,7 @@ module ApplicationHelper
end
def progress_bar(percentage, color: "bg-emerald-500")
content_tag :div, class: "h-3 w-full overflow-hidden rounded-full bg-slate-200 dark:bg-zinc-700" do
content_tag :div, class: "h-3 w-full overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-600" do
content_tag :div, "", class: "h-full #{color} transition-all", style: "width: #{percentage.to_i}%"
end
end
@@ -167,7 +167,7 @@ module ApplicationHelper
"cancelled" => "bg-rose-100 text-rose-800 dark:bg-rose-950 dark:text-rose-200"
}
content_tag :span, Catalog.label_for(Catalog::MAILING_STATUSES, status),
class: "inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium #{colors[status] || 'bg-zinc-100 text-zinc-700'}"
class: "inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium #{colors[status] || 'bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-200'}"
end
def mailing_recipient_status_badge(status)
@@ -179,7 +179,7 @@ module ApplicationHelper
"failed" => "bg-rose-100 text-rose-800 dark:bg-rose-950 dark:text-rose-200"
}
content_tag :span, Catalog.label_for(Catalog::MAILING_RECIPIENT_STATUSES, status),
class: "inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium #{colors[status] || 'bg-zinc-100 text-zinc-700'}"
class: "inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium #{colors[status] || 'bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-200'}"
end
def mailing_open_badge(recipient)
@@ -203,7 +203,7 @@ module ApplicationHelper
"B" => "bg-fuchsia-100 text-fuchsia-800 dark:bg-fuchsia-950 dark:text-fuchsia-200"
}
content_tag :span, "Test #{variant}",
class: "inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium #{colors[variant] || 'bg-zinc-100 text-zinc-700'}"
class: "inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium #{colors[variant] || 'bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-200'}"
end
def sanitize_email_html(html)
@@ -218,14 +218,14 @@ module ApplicationHelper
return if status.blank?
colors = {
"not_detected" => "bg-zinc-100 text-zinc-700",
"limited" => "bg-amber-100 text-amber-800",
"yes_partial" => "bg-sky-100 text-sky-800",
"yes" => "bg-emerald-100 text-emerald-800",
"yes_sportcam" => "bg-emerald-100 text-emerald-800"
"not_detected" => "bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300",
"limited" => "bg-amber-100 text-amber-800 dark:bg-amber-950 dark:text-amber-200",
"yes_partial" => "bg-sky-100 text-sky-800 dark:bg-sky-950 dark:text-sky-200",
"yes" => "bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200",
"yes_sportcam" => "bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200"
}
content_tag :span, Catalog.label_for(Catalog::STREAMING_STATUSES, status),
class: "inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium #{colors[status] || 'bg-zinc-100 text-zinc-700'}"
class: "inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium #{colors[status] || 'bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300'}"
end
def yes_no(value)