Files
sure/app/views/shared/_trend_change.html.erb
Chakib 583d91291f Add privacy mode with blur toggle for financial data
- Stimulus controller on global layout (persists across all pages)
- CSS blur effect on .privacy-sensitive elements (8px active, 4px on hover)
- localStorage persistence survives page navigations
- Toggle button on dashboard with aria-pressed for accessibility
- Applied to 28+ views: accounts, budgets, transactions, reports, etc.

Fixes: UTF-8 encoding, global controller mount, aria-pressed attribute
2026-02-22 23:20:49 +01:00

18 lines
773 B
Plaintext

<%# locals: { trend:, comparison_label: nil } %>
<p class="text-sm privacy-sensitive" style="color: <%= trend.color %>">
<% if trend.direction.flat? %>
<%= t(".no_change") %><%= " #{comparison_label}" if defined?(comparison_label) && comparison_label.present? %>
<% else %>
<span class="font-mono">
<%= trend.value.is_a?(Money) ? format_money(trend.value) : trend.value.round(2) %>
</span>
<% unless trend.percent.infinite? %>
<span class="font-mono">(<%= icon(trend.icon, size: "sm", color: "current", class: "mb-0.5 inline") %><%= trend.percent_formatted %>)</span>
<% end %>
<span class="text-secondary">
<%= " #{comparison_label}" if defined?(comparison_label) && comparison_label.present? %>
</span>
<% end %>
</p>