mirror of
https://github.com/we-promise/sure.git
synced 2026-07-20 00:35:22 +00:00
The goals status callout colored its entire body (icon, label and context) with text-warning / text-success / text-secondary, so a behind goal rendered as all-yellow text. That diverges from the DS::Alert recipe, where tinted boxes keep neutral body text (text-primary) and only the icon carries the status color. Drop the text-* tokens from the container, add text-primary, and move the warning/success color onto the icon via color:.
35 lines
1.2 KiB
Plaintext
35 lines
1.2 KiB
Plaintext
<%
|
|
context = goal.status_callout_context
|
|
return if context.blank?
|
|
|
|
variant_classes = case goal.status
|
|
when :behind
|
|
"bg-warning/10 border-warning/20"
|
|
when :on_track
|
|
"bg-success/10 border-success/20"
|
|
else
|
|
"bg-surface-inset border-secondary"
|
|
end
|
|
|
|
icon_glyph = case goal.status
|
|
when :behind then "triangle-alert"
|
|
when :on_track then "circle-check"
|
|
when :no_target_date then "infinity"
|
|
else "info"
|
|
end
|
|
|
|
icon_color = case goal.status
|
|
when :behind then "warning"
|
|
when :on_track then "success"
|
|
else "default"
|
|
end
|
|
|
|
label = t("goals.status.#{goal.status}", default: goal.status.to_s.titleize)
|
|
%>
|
|
<div class="rounded-lg border px-3 py-2 text-sm flex items-center gap-2 text-primary <%= variant_classes %>">
|
|
<span class="shrink-0"><%= icon(icon_glyph, size: "sm", color: icon_color) %></span>
|
|
<span class="font-medium"><%= label %></span>
|
|
<span class="opacity-60">·</span>
|
|
<span class="opacity-90 <%= "privacy-sensitive" if goal.status == :behind %>"><%= context %></span>
|
|
</div>
|