From 583d91291f42005430ea6bef4deb31296f3d4aa4 Mon Sep 17 00:00:00 2001 From: Chakib Date: Sun, 22 Feb 2026 22:25:58 +0100 Subject: [PATCH 1/4] 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 --- app/assets/tailwind/application.css | 1 + app/assets/tailwind/privacy-mode.css | 14 ++++++++ .../controllers/privacy_mode_controller.js | 32 +++++++++++++++++++ app/views/accounts/_account.html.erb | 2 +- .../accounts/_accountable_group.html.erb | 4 +-- .../_allocation_progress.erb | 8 ++--- .../_budget_category.html.erb | 12 +++---- app/views/budget_categories/show.html.erb | 20 ++++++------ app/views/budgets/_actuals_summary.html.erb | 4 +-- app/views/budgets/_budget_donut.html.erb | 8 ++--- app/views/budgets/_budgeted_summary.html.erb | 8 ++--- app/views/layouts/application.html.erb | 2 +- app/views/pages/dashboard.html.erb | 32 +++++++++++++------ .../pages/dashboard/_balance_sheet.html.erb | 8 ++--- .../pages/dashboard/_group_weight.html.erb | 2 +- .../dashboard/_investment_summary.html.erb | 14 ++++---- .../pages/dashboard/_net_worth_chart.html.erb | 2 +- .../pages/dashboard/_outflows_donut.html.erb | 10 +++--- .../_projected_transaction.html.erb | 2 +- .../recurring_transactions/index.html.erb | 4 +-- app/views/reports/_breakdown_table.html.erb | 2 +- .../reports/_budget_performance.html.erb | 8 ++--- app/views/reports/_category_row.html.erb | 2 +- app/views/reports/_investment_flows.html.erb | 6 ++-- .../reports/_investment_performance.html.erb | 18 +++++------ app/views/reports/_net_worth.html.erb | 12 +++---- app/views/reports/_summary_dashboard.html.erb | 12 +++---- app/views/reports/_trends_insights.html.erb | 12 +++---- app/views/shared/_trend_change.html.erb | 2 +- app/views/transactions/_summary.html.erb | 6 ++-- config/locales/views/pages/de.yml | 1 + config/locales/views/pages/en.yml | 1 + 32 files changed, 166 insertions(+), 105 deletions(-) create mode 100644 app/assets/tailwind/privacy-mode.css create mode 100644 app/javascript/controllers/privacy_mode_controller.js diff --git a/app/assets/tailwind/application.css b/app/assets/tailwind/application.css index 583b228a0..36b65b467 100644 --- a/app/assets/tailwind/application.css +++ b/app/assets/tailwind/application.css @@ -13,6 +13,7 @@ @import "./google-sign-in.css"; @import "./date-picker-dark-mode.css"; @import "./print-report.css"; +@import "./privacy-mode.css"; @layer components { .pcr-app{ diff --git a/app/assets/tailwind/privacy-mode.css b/app/assets/tailwind/privacy-mode.css new file mode 100644 index 000000000..3702b1525 --- /dev/null +++ b/app/assets/tailwind/privacy-mode.css @@ -0,0 +1,14 @@ +/* Privacy Mode - blurs financial numbers when activated */ +html.privacy-mode .privacy-sensitive { + filter: blur(8px); + user-select: none; + transition: filter 0.2s ease; +} + +html.privacy-mode .privacy-sensitive:hover { + filter: blur(4px); +} + +html:not(.privacy-mode) .privacy-sensitive { + transition: filter 0.2s ease; +} \ No newline at end of file diff --git a/app/javascript/controllers/privacy_mode_controller.js b/app/javascript/controllers/privacy_mode_controller.js new file mode 100644 index 000000000..a2358b064 --- /dev/null +++ b/app/javascript/controllers/privacy_mode_controller.js @@ -0,0 +1,32 @@ +import { Controller } from "@hotwired/stimulus" + +// Privacy Mode Controller +// Toggles visibility of financial numbers across the page. +// Elements with class "privacy-sensitive" will be blurred when active. +// State persists in localStorage so it survives page navigations. +export default class extends Controller { + static targets = ["toggle"] + + connect() { + this.active = localStorage.getItem("privacyMode") === "true" + this._apply() + } + + toggle() { + this.active = !this.active + localStorage.setItem("privacyMode", this.active.toString()) + this._apply() + } + + _apply() { + if (this.active) { + document.documentElement.classList.add("privacy-mode") + } else { + document.documentElement.classList.remove("privacy-mode") + } + + this.toggleTargets.forEach((el) => { + el.setAttribute("aria-pressed", this.active.toString()) + }) + } +} \ No newline at end of file diff --git a/app/views/accounts/_account.html.erb b/app/views/accounts/_account.html.erb index c9eadeb86..40f0e0927 100644 --- a/app/views/accounts/_account.html.erb +++ b/app/views/accounts/_account.html.erb @@ -56,7 +56,7 @@ <% elsif account.syncing? %>
<% else %> -

"> +

"> <%= format_money account.balance_money %>

<% end %> diff --git a/app/views/accounts/_accountable_group.html.erb b/app/views/accounts/_accountable_group.html.erb index 934f2bb3e..2ccea54a1 100644 --- a/app/views/accounts/_accountable_group.html.erb +++ b/app/views/accounts/_accountable_group.html.erb @@ -12,7 +12,7 @@
- <%= tag.p format_money(account_group.total_money), class: "text-sm font-medium text-primary" %> + <%= tag.p format_money(account_group.total_money), class: "text-sm font-medium text-primary privacy-sensitive" %> <%= turbo_frame_tag "#{account_group.key}_sparkline", src: accountable_sparkline_path(account_group.key), loading: "lazy", data: { controller: "turbo-frame-timeout", turbo_frame_timeout_timeout_value: 10000 } do %>
@@ -39,7 +39,7 @@
- <%= tag.p format_money(account.balance_money), class: "text-sm font-medium text-primary whitespace-nowrap" %> + <%= tag.p format_money(account.balance_money), class: "text-sm font-medium text-primary whitespace-nowrap privacy-sensitive" %> <%= turbo_frame_tag dom_id(account, :sparkline), src: sparkline_account_path(account), loading: "lazy", data: { controller: "turbo-frame-timeout", turbo_frame_timeout_timeout_value: 10000 } do %>
diff --git a/app/views/budget_categories/_allocation_progress.erb b/app/views/budget_categories/_allocation_progress.erb index 8302a57d0..af854fe00 100644 --- a/app/views/budget_categories/_allocation_progress.erb +++ b/app/views/budget_categories/_allocation_progress.erb @@ -17,9 +17,9 @@ <% end %>

- "><%= format_money(budget.allocated_spending_money) %> + "><%= format_money(budget.allocated_spending_money) %> / - <%= format_money(budget.budgeted_spending_money) %> + <%= format_money(budget.budgeted_spending_money) %>

@@ -34,10 +34,10 @@
<% if budget.available_to_allocate.negative? %>

- Budget exceeded by <%= format_money(budget.available_to_allocate_money.abs) %> + Budget exceeded by <%= format_money(budget.available_to_allocate_money.abs) %>

<% else %> - <%= format_money(budget.available_to_allocate_money) %> + <%= format_money(budget.available_to_allocate_money) %> left to allocate <% end %>
diff --git a/app/views/budget_categories/_budget_category.html.erb b/app/views/budget_categories/_budget_category.html.erb index efa6467c1..8597a1b93 100644 --- a/app/views/budget_categories/_budget_category.html.erb +++ b/app/views/budget_categories/_budget_category.html.erb @@ -57,13 +57,13 @@
<%= t("reports.budget_performance.spent") %>: - + <%= format_money(budget_category.actual_spending_money) %>
<%= t("reports.budget_performance.budgeted") %>: - + <%= format_money(budget_category.budgeted_spending_money) %> <% if budget_category.inherits_parent_budget? %> @@ -73,12 +73,12 @@
<% if budget_category.available_to_spend >= 0 %> <%= t("reports.budget_performance.remaining") %>: - "> + privacy-sensitive"> <%= format_money(budget_category.available_to_spend_money) %> <% else %> <%= t("reports.budget_performance.over_by") %>: - + <%= format_money(budget_category.available_to_spend_money.abs) %> <% end %> @@ -116,13 +116,13 @@

<%= budget_category.category.name %>

-

+

<%= budget_category.median_monthly_expense_money.format %> avg

-

<%= format_money(budget_category.actual_spending_money) %>

+

<%= format_money(budget_category.actual_spending_money) %>

<% end %> diff --git a/app/views/budget_categories/show.html.erb b/app/views/budget_categories/show.html.erb index affb01afc..154a7958f 100644 --- a/app/views/budget_categories/show.html.erb +++ b/app/views/budget_categories/show.html.erb @@ -8,11 +8,11 @@ <% if @budget_category.budget.initialized? %>

- + <%= format_money(@budget_category.actual_spending_money) %> / - <%= format_money(@budget_category.budgeted_spending_money) %> + <%= format_money(@budget_category.budgeted_spending_money) %>

<% end %>
@@ -33,7 +33,7 @@
<%= @budget_category.budget.start_date.strftime("%b %Y") %> spending
-
+
<%= format_money @budget_category.actual_spending_money %>
@@ -42,19 +42,19 @@
Status
<% if @budget_category.available_to_spend.negative? %> -
+
<%= icon "alert-circle", size: "sm", color: "destructive" %> <%= format_money @budget_category.available_to_spend_money.abs %> overspent
<% elsif @budget_category.available_to_spend.zero? %> -
+
<%= icon "x-circle", size: "sm", color: "warning" %> <%= format_money @budget_category.available_to_spend_money %> left
<% else %> -
+
<%= icon "check-circle", size: "sm", color: "success" %> <%= format_money @budget_category.available_to_spend_money %> left @@ -64,7 +64,7 @@
Budgeted
-
+
<%= format_money @budget_category.budgeted_spending_money %>
@@ -72,14 +72,14 @@
Monthly average spending
-
+
<%= @budget_category.avg_monthly_expense_money.format %>
Monthly median spending
-
+
<%= @budget_category.median_monthly_expense_money.format %>
@@ -111,7 +111,7 @@ class: "text-primary hover:underline", data: { turbo_frame: :_top } %>
-

+

<%= format_money transaction.entry.amount_money %>

diff --git a/app/views/budgets/_actuals_summary.html.erb b/app/views/budgets/_actuals_summary.html.erb index 5b4adf1d6..fe9509d9a 100644 --- a/app/views/budgets/_actuals_summary.html.erb +++ b/app/views/budgets/_actuals_summary.html.erb @@ -4,7 +4,7 @@

Income

- + <%= budget.actual_income_money.format %> @@ -32,7 +32,7 @@

Expenses

- <%= budget.actual_spending_money.format %> + <%= budget.actual_spending_money.format %> <% if budget.expense_category_totals.any? %>
diff --git a/app/views/budgets/_budget_donut.html.erb b/app/views/budgets/_budget_donut.html.erb index 8726f4e43..8879d9bfc 100644 --- a/app/views/budgets/_budget_donut.html.erb +++ b/app/views/budgets/_budget_donut.html.erb @@ -8,7 +8,7 @@ Spent
-
"> +
"> <%= format_money(budget.actual_spending_money) %>
@@ -21,7 +21,7 @@ href: edit_budget_path(budget) ) %> <% else %> -
+
<%= format_money Money.new(0, budget.currency || budget.family.currency) %>
@@ -42,7 +42,7 @@

<%= bc.category.name %>

-

"> +

"> <%= format_money(bc.actual_spending_money) %>

@@ -61,7 +61,7 @@ diff --git a/app/views/budgets/_budgeted_summary.html.erb b/app/views/budgets/_budgeted_summary.html.erb index 37e225e75..07905d0d3 100644 --- a/app/views/budgets/_budgeted_summary.html.erb +++ b/app/views/budgets/_budgeted_summary.html.erb @@ -4,7 +4,7 @@

Expected income

- + <%= format_money(budget.expected_income_money) %> @@ -18,7 +18,7 @@
<% end %>
-
+

<%= format_money(budget.actual_income_money) %> earned

<% if budget.remaining_expected_income.negative? %> @@ -34,7 +34,7 @@

Budgeted

- + <%= format_money(budget.budgeted_spending_money) %> @@ -48,7 +48,7 @@
<% end %>
-
+

<%= format_money(budget.actual_spending_money) %> spent

<% if budget.available_to_spend.negative? %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 9d5bc708c..bc2c0ddf8 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -22,7 +22,7 @@ end %> <%= render "layouts/shared/htmldoc" do %>

diff --git a/app/views/pages/dashboard.html.erb b/app/views/pages/dashboard.html.erb index dbb03ca02..4e0122026 100644 --- a/app/views/pages/dashboard.html.erb +++ b/app/views/pages/dashboard.html.erb @@ -9,21 +9,33 @@

- <%= render DS::Link.new( - icon: "plus", - text: t("pages.dashboard.new"), - href: new_account_path, - frame: :modal, - class: "hidden lg:inline-flex" - ) %> +
+ - <%= render DS::Link.new( - variant: "icon-inverse", + <%= render DS::Link.new( icon: "plus", + text: t("pages.dashboard.new"), href: new_account_path, frame: :modal, - class: "rounded-full lg:hidden" + class: "hidden lg:inline-flex" ) %> + + <%= render DS::Link.new( + variant: "icon-inverse", + icon: "plus", + href: new_account_path, + frame: :modal, + class: "rounded-full lg:hidden" + ) %> +
<% end %> diff --git a/app/views/pages/dashboard/_balance_sheet.html.erb b/app/views/pages/dashboard/_balance_sheet.html.erb index 5bacd50c5..0f8710581 100644 --- a/app/views/pages/dashboard/_balance_sheet.html.erb +++ b/app/views/pages/dashboard/_balance_sheet.html.erb @@ -11,7 +11,7 @@ <% if classification_group.account_groups.any? %> · - <%= classification_group.total_money.format(precision: 0) %> + <%= classification_group.total_money.format(precision: 0) %> <% end %>
@@ -29,7 +29,7 @@

<%= account_group.name %>

-

<%= number_to_percentage(account_group.weight, precision: 0) %>

+

<%= number_to_percentage(account_group.weight, precision: 0) %>

<% end %>
@@ -67,7 +67,7 @@
-

<%= format_money(account_group.total_money) %>

+

<%= format_money(account_group.total_money) %>

@@ -92,7 +92,7 @@
-

<%= format_money(account.balance_money) %>

+

<%= format_money(account.balance_money) %>

diff --git a/app/views/pages/dashboard/_group_weight.html.erb b/app/views/pages/dashboard/_group_weight.html.erb index c00655a23..d3bf08e5c 100644 --- a/app/views/pages/dashboard/_group_weight.html.erb +++ b/app/views/pages/dashboard/_group_weight.html.erb @@ -8,5 +8,5 @@
" style="background-color: <%= color %>;">
<% end %> -

<%= number_to_percentage(effective_weight, precision: 2) %>

+

<%= number_to_percentage(effective_weight, precision: 2) %>

diff --git a/app/views/pages/dashboard/_investment_summary.html.erb b/app/views/pages/dashboard/_investment_summary.html.erb index f10f0d776..b6e39afef 100644 --- a/app/views/pages/dashboard/_investment_summary.html.erb +++ b/app/views/pages/dashboard/_investment_summary.html.erb @@ -8,7 +8,7 @@

<%= t(".title") %>

-

+

<%= format_money(investment_statement.portfolio_value_money) %>

@@ -16,7 +16,7 @@ <% if trend %>
<%= t(".total_return") %>: - + <%= format_money(Money.new(trend.value, Current.family.currency)) %> (<%= trend.percent_formatted %>) @@ -52,17 +52,17 @@
-
+
<%= number_to_percentage(holding.weight || 0, precision: 1) %>
-
+
<%= format_money(holding.amount_money) %>
<% if holding.trend %> - + <%= holding.trend.percent_formatted %> <% else %> @@ -90,7 +90,7 @@

<%= t(".contributions") %>

-

<%= format_money(totals.contributions) %>

+

<%= format_money(totals.contributions) %>

@@ -99,7 +99,7 @@

<%= t(".withdrawals") %>

-

<%= format_money(totals.withdrawals) %>

+

<%= format_money(totals.withdrawals) %>

diff --git a/app/views/pages/dashboard/_net_worth_chart.html.erb b/app/views/pages/dashboard/_net_worth_chart.html.erb index 2ac67416b..08e284ae5 100644 --- a/app/views/pages/dashboard/_net_worth_chart.html.erb +++ b/app/views/pages/dashboard/_net_worth_chart.html.erb @@ -5,7 +5,7 @@
<% if series.trend.present? %> -

"> +

"> <%= series.trend.current.format %>

<%= render partial: "shared/trend_change", locals: { trend: series.trend, comparison_label: period.comparison_label } %> diff --git a/app/views/pages/dashboard/_outflows_donut.html.erb b/app/views/pages/dashboard/_outflows_donut.html.erb index 5079dcc9d..8e563e528 100644 --- a/app/views/pages/dashboard/_outflows_donut.html.erb +++ b/app/views/pages/dashboard/_outflows_donut.html.erb @@ -31,7 +31,7 @@ <%= t("pages.dashboard.outflows_donut.total_outflows") %>
-
+
<%= format_money Money.new(outflows_data[:total], outflows_data[:currency]) %>
@@ -41,11 +41,11 @@

<%= category[:name] %>

-

+

<%= outflows_data[:currency_symbol] %><%= number_with_delimiter(category[:amount], delimiter: ",") %>

-

<%= category[:percentage] %>%

+

<%= category[:percentage] %>%

<% end %> @@ -94,8 +94,8 @@ <%= category[:name] %>
- <%= format_money Money.new(category[:amount], category[:currency]) %> - <%= category[:percentage] %>% + <%= format_money Money.new(category[:amount], category[:currency]) %> + <%= category[:percentage] %>%
<% end %> diff --git a/app/views/recurring_transactions/_projected_transaction.html.erb b/app/views/recurring_transactions/_projected_transaction.html.erb index 0f7b8b59d..3659e3fe2 100644 --- a/app/views/recurring_transactions/_projected_transaction.html.erb +++ b/app/views/recurring_transactions/_projected_transaction.html.erb @@ -56,6 +56,6 @@
<% display_amount = recurring_transaction.manual? && recurring_transaction.expected_amount_avg.present? ? recurring_transaction.expected_amount_avg : recurring_transaction.amount %> - <%= content_tag :p, format_money(-Money.new(display_amount, recurring_transaction.currency)), class: ["font-medium", display_amount.negative? ? "text-success" : "text-subdued"] %> + <%= content_tag :p, format_money(-Money.new(display_amount, recurring_transaction.currency)), class: ["font-medium", "privacy-sensitive", display_amount.negative? ? "text-success" : "text-subdued"] %>
diff --git a/app/views/recurring_transactions/index.html.erb b/app/views/recurring_transactions/index.html.erb index 06374fef6..184556a78 100644 --- a/app/views/recurring_transactions/index.html.erb +++ b/app/views/recurring_transactions/index.html.erb @@ -128,11 +128,11 @@ <% end %> - "> + "> <% if recurring_transaction.manual? && recurring_transaction.has_amount_variance? %>
"> ~ - <%= format_money(-recurring_transaction.expected_amount_avg_money) %> + <%= format_money(-recurring_transaction.expected_amount_avg_money) %>
<% else %> <%= format_money(-recurring_transaction.amount_money) %> diff --git a/app/views/reports/_breakdown_table.html.erb b/app/views/reports/_breakdown_table.html.erb index 2034ba4cb..28a3d36c0 100644 --- a/app/views/reports/_breakdown_table.html.erb +++ b/app/views/reports/_breakdown_table.html.erb @@ -11,7 +11,7 @@
<%= icon(icon_name, class: "w-5 h-5") %> <%= t(title_key) %>: - <%= Money.new(total, Current.family.currency).format %> + <%= Money.new(total, Current.family.currency).format %>
diff --git a/app/views/reports/_budget_performance.html.erb b/app/views/reports/_budget_performance.html.erb index a66a50a89..23b93bc3c 100644 --- a/app/views/reports/_budget_performance.html.erb +++ b/app/views/reports/_budget_performance.html.erb @@ -63,13 +63,13 @@
<%= t("reports.budget_performance.spent") %>: - + <%= Money.new(budget_item[:actual], Current.family.currency).format %>
<%= t("reports.budget_performance.budgeted") %>: - + <%= Money.new(budget_item[:budgeted], Current.family.currency).format %>
@@ -78,12 +78,12 @@
<% if budget_item[:remaining] >= 0 %> <%= t("reports.budget_performance.remaining") %>: - + <%= Money.new(budget_item[:remaining], Current.family.currency).format %> <% else %> <%= t("reports.budget_performance.over_by") %>: - + <%= Money.new(budget_item[:remaining].abs, Current.family.currency).format %> <% end %> diff --git a/app/views/reports/_category_row.html.erb b/app/views/reports/_category_row.html.erb index ac37dafe6..80c31245a 100644 --- a/app/views/reports/_category_row.html.erb +++ b/app/views/reports/_category_row.html.erb @@ -37,7 +37,7 @@
- + <%= Money.new(item[:total], Current.family.currency).format %>
diff --git a/app/views/reports/_investment_flows.html.erb b/app/views/reports/_investment_flows.html.erb index 99a01273a..83db092e2 100644 --- a/app/views/reports/_investment_flows.html.erb +++ b/app/views/reports/_investment_flows.html.erb @@ -11,7 +11,7 @@ <%= icon("trending-up", size: "sm", class: "text-green-600") %>

Contributions

-
+
<%= format_money(investment_flows.contributions) %>

Money added to investments

@@ -23,7 +23,7 @@ <%= icon("trending-down", size: "sm", class: "text-orange-600") %>

Withdrawals

-
+
<%= format_money(investment_flows.withdrawals) %>

Money withdrawn from investments

@@ -35,7 +35,7 @@ <%= icon("arrow-right-left", size: "sm", class: "text-primary") %>

Net Flow

-
+
<%= format_money(investment_flows.net_flow) %>

Total net change

diff --git a/app/views/reports/_investment_performance.html.erb b/app/views/reports/_investment_performance.html.erb index aa63cbf4d..a3c514553 100644 --- a/app/views/reports/_investment_performance.html.erb +++ b/app/views/reports/_investment_performance.html.erb @@ -10,7 +10,7 @@ <%= icon("briefcase", size: "sm") %> <%= t("reports.investment_performance.portfolio_value") %>
-

+

<%= format_money(investment_metrics[:portfolio_value]) %>

@@ -22,7 +22,7 @@ <%= t("reports.investment_performance.total_return") %> <% if investment_metrics[:unrealized_trend] %> -

+

<%= format_money(Money.new(investment_metrics[:unrealized_trend].value, Current.family.currency)) %> (<%= investment_metrics[:unrealized_trend].percent_formatted %>)

@@ -37,7 +37,7 @@ <%= icon("arrow-down-to-line", size: "sm") %> <%= t("reports.investment_performance.contributions") %> -

+

<%= format_money(investment_metrics[:period_contributions]) %>

@@ -48,7 +48,7 @@ <%= icon("arrow-up-from-line", size: "sm") %> <%= t("reports.investment_performance.withdrawals") %> -

+

<%= format_money(investment_metrics[:period_withdrawals]) %>

@@ -85,7 +85,7 @@
<%= number_to_percentage(holding.weight || 0, precision: 1) %>
-
<%= format_money(holding.amount_money) %>
+
<%= format_money(holding.amount_money) %>
<% if holding.trend %> @@ -117,7 +117,7 @@ "> <%= t("accounts.tax_treatments.#{treatment}") %> - + <%= format_money(data[:total_gain]) %>
@@ -125,11 +125,11 @@
<%= t("reports.investment_performance.unrealized_gains") %> - <%= format_money(data[:unrealized_gain]) %> + <%= format_money(data[:unrealized_gain]) %>
<%= t("reports.investment_performance.realized_gains") %> - <%= format_money(data[:realized_gain]) %> + <%= format_money(data[:realized_gain]) %>
@@ -205,7 +205,7 @@

<%= account.short_subtype_label %>

-

<%= format_money(account.balance_money) %>

+

<%= format_money(account.balance_money) %>

<% end %> <% end %> diff --git a/app/views/reports/_net_worth.html.erb b/app/views/reports/_net_worth.html.erb index e3c8f01df..0ed1dc2b3 100644 --- a/app/views/reports/_net_worth.html.erb +++ b/app/views/reports/_net_worth.html.erb @@ -4,7 +4,7 @@ <%# Current Net Worth %>

<%= t("reports.net_worth.current_net_worth") %>

-

"> +

"> <%= net_worth_metrics[:current_net_worth].format %>

@@ -14,7 +14,7 @@

<%= t("reports.net_worth.period_change") %>

<% if net_worth_metrics[:trend] %> <% trend = net_worth_metrics[:trend] %> -

+

<%= trend.value.format(signify_positive: true) %>

@@ -29,9 +29,9 @@

<%= t("reports.net_worth.assets_vs_liabilities") %>

- <%= net_worth_metrics[:total_assets].format %> + <%= net_worth_metrics[:total_assets].format %> - - <%= net_worth_metrics[:total_liabilities].format %> + <%= net_worth_metrics[:total_liabilities].format %>
@@ -47,7 +47,7 @@ <% net_worth_metrics[:asset_groups].each_with_index do |group, idx| %>
<%= group[:name] %>
-
<%= group[:total].format %>
+
<%= group[:total].format %>
<% if idx < net_worth_metrics[:asset_groups].size - 1 %> <%= render "shared/ruler", classes: "mx-3 lg:mx-4" %> @@ -68,7 +68,7 @@ <% net_worth_metrics[:liability_groups].each_with_index do |group, idx| %>
<%= group[:name] %>
-
<%= group[:total].format %>
+
<%= group[:total].format %>
<% if idx < net_worth_metrics[:liability_groups].size - 1 %> <%= render "shared/ruler", classes: "mx-3 lg:mx-4" %> diff --git a/app/views/reports/_summary_dashboard.html.erb b/app/views/reports/_summary_dashboard.html.erb index 7ad7ffb8e..927cfd2a7 100644 --- a/app/views/reports/_summary_dashboard.html.erb +++ b/app/views/reports/_summary_dashboard.html.erb @@ -11,12 +11,12 @@
-

+

<%= metrics[:current_income].format %>

<% if metrics[:income_change] %> -
+
<% if metrics[:income_change] >= 0 %> <%= icon("arrow-up", size: "sm") %> @@ -48,12 +48,12 @@
-

+

<%= metrics[:current_expenses].format %>

<% if metrics[:expense_change] %> -
+
<% if metrics[:expense_change] >= 0 %> <%= icon("arrow-up", class: "w-4 h-4 text-destructive") %> @@ -85,7 +85,7 @@
-

"> +

"> <%= metrics[:net_savings].format %>

@@ -108,7 +108,7 @@
<% if metrics[:budget_percent] %> -

+

<%= metrics[:budget_percent] %>%

diff --git a/app/views/reports/_trends_insights.html.erb b/app/views/reports/_trends_insights.html.erb index 397de8ed1..419341853 100644 --- a/app/views/reports/_trends_insights.html.erb +++ b/app/views/reports/_trends_insights.html.erb @@ -24,13 +24,13 @@ (<%= t("reports.trends.current") %>) <% end %>
-
+
<%= Money.new(trend[:income], Current.family.currency).format %>
-
+
<%= Money.new(trend[:expenses], Current.family.currency).format %>
-
"> +
"> <%= Money.new(trend[:net], Current.family.currency).format %>
"> @@ -54,21 +54,21 @@

<%= t("reports.trends.avg_monthly_income") %>

-

+

<%= Money.new(avg_income, Current.family.currency).format %>

<%= t("reports.trends.avg_monthly_expenses") %>

-

+

<%= Money.new(avg_expenses, Current.family.currency).format %>

<%= t("reports.trends.avg_monthly_savings") %>

-

"> +

"> <%= Money.new(avg_net, Current.family.currency).format %>

diff --git a/app/views/shared/_trend_change.html.erb b/app/views/shared/_trend_change.html.erb index ad9c44cf8..7da471193 100644 --- a/app/views/shared/_trend_change.html.erb +++ b/app/views/shared/_trend_change.html.erb @@ -1,6 +1,6 @@ <%# locals: { trend:, comparison_label: nil } %> -

+

<% if trend.direction.flat? %> <%= t(".no_change") %><%= " #{comparison_label}" if defined?(comparison_label) && comparison_label.present? %> <% else %> diff --git a/app/views/transactions/_summary.html.erb b/app/views/transactions/_summary.html.erb index 818283f2c..117b4e933 100644 --- a/app/views/transactions/_summary.html.erb +++ b/app/views/transactions/_summary.html.erb @@ -2,17 +2,17 @@

Total transactions

-

<%= totals.count.round(0) %>

+

<%= totals.count.round(0) %>

Income

-

+

<%= totals.income_money.format %>

Expenses

-

+

<%= totals.expense_money.format %>

diff --git a/config/locales/views/pages/de.yml b/config/locales/views/pages/de.yml index 4df171506..337559dae 100644 --- a/config/locales/views/pages/de.yml +++ b/config/locales/views/pages/de.yml @@ -7,6 +7,7 @@ de: welcome: "Willkommen zurück, %{name}" subtitle: "Hier siehst du, was in deinen Finanzen passiert." new: "Neu" + privacy_mode: "Datenschutzmodus umschalten" net_worth_chart: data_not_available: Für den ausgewählten Zeitraum sind keine Daten verfügbar. title: Nettovermögen diff --git a/config/locales/views/pages/en.yml b/config/locales/views/pages/en.yml index bded845ee..5ccfa5df4 100644 --- a/config/locales/views/pages/en.yml +++ b/config/locales/views/pages/en.yml @@ -15,6 +15,7 @@ en: welcome: "Welcome back, %{name}" subtitle: "Here's what's happening with your finances" new: "New" + privacy_mode: "Toggle privacy mode" drag_to_reorder: "Drag to reorder section" toggle_section: "Toggle section visibility" net_worth_chart: From d5d450fc1a7715faf998fbf9102932715508668d Mon Sep 17 00:00:00 2001 From: Chakib Date: Sun, 1 Mar 2026 17:46:50 +0100 Subject: [PATCH 2/4] Optimize privacy mode: move toggle to breadcrumbs bar, fix flash, improve UX - Move privacy toggle button from dashboard-only to global breadcrumbs bar (desktop) and mobile top nav so it's accessible on every page - Add _privacy_mode_check.html.erb inline script in to prevent flash of unblurred content on first page load (same pattern as dark mode) - Improve Stimulus controller: add iconOn/iconOff targets to toggle between eye/eye-off icons; update aria-pressed on all toggle targets simultaneously - Remove hover-unblur (blur(4px) on hover) from CSS for security; add pointer-events: none to prevent interaction with blurred values - Move i18n key from pages.dashboard scope to layouts.application scope; add privacy_mode translation to all 12 locales (EN, DE, FR, ES, CA, NL, NB, PT-BR, RO, TR, ZH-CN, ZH-TW) --- app/assets/tailwind/privacy-mode.css | 5 +--- .../controllers/privacy_mode_controller.js | 13 +++++++- .../layouts/_privacy_mode_check.html.erb | 5 ++++ app/views/layouts/application.html.erb | 30 +++++++++++++++++-- app/views/layouts/shared/_head.html.erb | 1 + app/views/pages/dashboard.html.erb | 10 ------- config/locales/views/layout/ca.yml | 1 + config/locales/views/layout/de.yml | 1 + config/locales/views/layout/en.yml | 1 + config/locales/views/layout/es.yml | 1 + config/locales/views/layout/fr.yml | 1 + config/locales/views/layout/nb.yml | 1 + config/locales/views/layout/nl.yml | 1 + config/locales/views/layout/pt-BR.yml | 1 + config/locales/views/layout/ro.yml | 1 + config/locales/views/layout/tr.yml | 1 + config/locales/views/layout/zh-CN.yml | 1 + config/locales/views/layout/zh-TW.yml | 1 + config/locales/views/pages/de.yml | 1 - config/locales/views/pages/en.yml | 1 - 20 files changed, 59 insertions(+), 19 deletions(-) create mode 100644 app/views/layouts/_privacy_mode_check.html.erb diff --git a/app/assets/tailwind/privacy-mode.css b/app/assets/tailwind/privacy-mode.css index 3702b1525..e57eaa246 100644 --- a/app/assets/tailwind/privacy-mode.css +++ b/app/assets/tailwind/privacy-mode.css @@ -2,13 +2,10 @@ html.privacy-mode .privacy-sensitive { filter: blur(8px); user-select: none; + pointer-events: none; transition: filter 0.2s ease; } -html.privacy-mode .privacy-sensitive:hover { - filter: blur(4px); -} - html:not(.privacy-mode) .privacy-sensitive { transition: filter 0.2s ease; } \ No newline at end of file diff --git a/app/javascript/controllers/privacy_mode_controller.js b/app/javascript/controllers/privacy_mode_controller.js index a2358b064..5d968e6c9 100644 --- a/app/javascript/controllers/privacy_mode_controller.js +++ b/app/javascript/controllers/privacy_mode_controller.js @@ -4,8 +4,10 @@ import { Controller } from "@hotwired/stimulus" // Toggles visibility of financial numbers across the page. // Elements with class "privacy-sensitive" will be blurred when active. // State persists in localStorage so it survives page navigations. +// A synchronous inline script in pre-applies the class to prevent +// a flash of unblurred content on first paint (see _privacy_mode_check.html.erb). export default class extends Controller { - static targets = ["toggle"] + static targets = ["toggle", "iconOn", "iconOff"] connect() { this.active = localStorage.getItem("privacyMode") === "true" @@ -25,8 +27,17 @@ export default class extends Controller { document.documentElement.classList.remove("privacy-mode") } + // Update button state this.toggleTargets.forEach((el) => { el.setAttribute("aria-pressed", this.active.toString()) }) + + // Toggle icon visibility: show eye when active (click to reveal), eye-off when inactive + this.iconOnTargets.forEach((el) => { + el.classList.toggle("hidden", !this.active) + }) + this.iconOffTargets.forEach((el) => { + el.classList.toggle("hidden", this.active) + }) } } \ No newline at end of file diff --git a/app/views/layouts/_privacy_mode_check.html.erb b/app/views/layouts/_privacy_mode_check.html.erb new file mode 100644 index 000000000..6e9299901 --- /dev/null +++ b/app/views/layouts/_privacy_mode_check.html.erb @@ -0,0 +1,5 @@ + diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index bc2c0ddf8..9d3b97e87 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -54,7 +54,19 @@ end %> <%= image_tag "logomark-color.svg", class: "w-9 h-9 mx-auto" %> <% end %> - <%= render "users/user_menu", user: Current.user, placement: "bottom-end", offset: 12, intro_mode: intro_mode %> +
+ + <%= render "users/user_menu", user: Current.user, placement: "bottom-end", offset: 12, intro_mode: intro_mode %> +
<%# DESKTOP - Left navbar %> @@ -138,7 +150,21 @@ end %> <%= render "layouts/shared/breadcrumbs", breadcrumbs: @breadcrumbs %> <% end %>
- <%= icon("panel-right", as_button: true, data: { action: "app-layout#toggleRightSidebar" }) %> + +
+ + + <%= icon("panel-right", as_button: true, data: { action: "app-layout#toggleRightSidebar" }) %> +
<% end %> diff --git a/app/views/layouts/shared/_head.html.erb b/app/views/layouts/shared/_head.html.erb index b96ce2c61..560bece5d 100644 --- a/app/views/layouts/shared/_head.html.erb +++ b/app/views/layouts/shared/_head.html.erb @@ -11,6 +11,7 @@ <%= yield :plaid_link %> <%= javascript_importmap_tags %> <%= render "layouts/dark_mode_check" %> + <%= render "layouts/privacy_mode_check" %> <%= turbo_refreshes_with method: :morph, scroll: :preserve %> diff --git a/app/views/pages/dashboard.html.erb b/app/views/pages/dashboard.html.erb index 4e0122026..2f5c14b81 100644 --- a/app/views/pages/dashboard.html.erb +++ b/app/views/pages/dashboard.html.erb @@ -10,16 +10,6 @@
- - <%= render DS::Link.new( icon: "plus", text: t("pages.dashboard.new"), diff --git a/config/locales/views/layout/ca.yml b/config/locales/views/layout/ca.yml index 5f6a3b9f8..8868c451c 100644 --- a/config/locales/views/layout/ca.yml +++ b/config/locales/views/layout/ca.yml @@ -2,6 +2,7 @@ ca: layouts: application: + privacy_mode: Alternar mode de privadesa nav: assistant: Assistent budgets: Pressupostos diff --git a/config/locales/views/layout/de.yml b/config/locales/views/layout/de.yml index 219e60f8f..3af54c26b 100644 --- a/config/locales/views/layout/de.yml +++ b/config/locales/views/layout/de.yml @@ -2,6 +2,7 @@ de: layouts: application: + privacy_mode: Datenschutzmodus umschalten nav: assistant: Assistent budgets: Budgets diff --git a/config/locales/views/layout/en.yml b/config/locales/views/layout/en.yml index 8e41636c0..86ad78ace 100644 --- a/config/locales/views/layout/en.yml +++ b/config/locales/views/layout/en.yml @@ -2,6 +2,7 @@ en: layouts: application: + privacy_mode: Toggle privacy mode nav: assistant: Assistant budgets: Budgets diff --git a/config/locales/views/layout/es.yml b/config/locales/views/layout/es.yml index bc14dd208..b1627fd14 100644 --- a/config/locales/views/layout/es.yml +++ b/config/locales/views/layout/es.yml @@ -2,6 +2,7 @@ es: layouts: application: + privacy_mode: Alternar modo de privacidad nav: assistant: Asistente budgets: Presupuestos diff --git a/config/locales/views/layout/fr.yml b/config/locales/views/layout/fr.yml index fb99e913e..54f9cca4b 100644 --- a/config/locales/views/layout/fr.yml +++ b/config/locales/views/layout/fr.yml @@ -2,6 +2,7 @@ fr: layouts: application: + privacy_mode: Activer/désactiver le mode confidentialité nav: assistant: Assistant budgets: Budgets diff --git a/config/locales/views/layout/nb.yml b/config/locales/views/layout/nb.yml index 42aeca716..ebabc16cf 100644 --- a/config/locales/views/layout/nb.yml +++ b/config/locales/views/layout/nb.yml @@ -2,6 +2,7 @@ nb: layouts: application: + privacy_mode: Veksle personvernmodus nav: assistant: Assistent budgets: Budsjett diff --git a/config/locales/views/layout/nl.yml b/config/locales/views/layout/nl.yml index 43bee1c11..9ee7a2b1b 100644 --- a/config/locales/views/layout/nl.yml +++ b/config/locales/views/layout/nl.yml @@ -2,6 +2,7 @@ nl: layouts: application: + privacy_mode: Privacymodus in-/uitschakelen nav: assistant: Assistent budgets: Budgetten diff --git a/config/locales/views/layout/pt-BR.yml b/config/locales/views/layout/pt-BR.yml index 580269edf..2f76fecca 100644 --- a/config/locales/views/layout/pt-BR.yml +++ b/config/locales/views/layout/pt-BR.yml @@ -2,6 +2,7 @@ pt-BR: layouts: application: + privacy_mode: Alternar modo de privacidade nav: assistant: Assistente budgets: Orçamentos diff --git a/config/locales/views/layout/ro.yml b/config/locales/views/layout/ro.yml index fc2f35f0a..15ed02dac 100644 --- a/config/locales/views/layout/ro.yml +++ b/config/locales/views/layout/ro.yml @@ -2,6 +2,7 @@ ro: layouts: application: + privacy_mode: Comutare mod confidențialitate nav: assistant: Asistent budgets: Bugete diff --git a/config/locales/views/layout/tr.yml b/config/locales/views/layout/tr.yml index cff503f7c..d7a482e42 100644 --- a/config/locales/views/layout/tr.yml +++ b/config/locales/views/layout/tr.yml @@ -2,6 +2,7 @@ tr: layouts: application: + privacy_mode: Gizlilik modunu değiştir nav: assistant: Asistan budgets: Bütçeler diff --git a/config/locales/views/layout/zh-CN.yml b/config/locales/views/layout/zh-CN.yml index 2d22156d1..8fc58045e 100644 --- a/config/locales/views/layout/zh-CN.yml +++ b/config/locales/views/layout/zh-CN.yml @@ -3,6 +3,7 @@ zh-CN: layouts: application: + privacy_mode: 切换隐私模式 nav: assistant: 智能助手 budgets: 预算管理 diff --git a/config/locales/views/layout/zh-TW.yml b/config/locales/views/layout/zh-TW.yml index 9c1b4da94..091625bea 100644 --- a/config/locales/views/layout/zh-TW.yml +++ b/config/locales/views/layout/zh-TW.yml @@ -2,6 +2,7 @@ zh-TW: layouts: application: + privacy_mode: 切換隱私模式 nav: assistant: 助手 budgets: 預算 diff --git a/config/locales/views/pages/de.yml b/config/locales/views/pages/de.yml index 337559dae..4df171506 100644 --- a/config/locales/views/pages/de.yml +++ b/config/locales/views/pages/de.yml @@ -7,7 +7,6 @@ de: welcome: "Willkommen zurück, %{name}" subtitle: "Hier siehst du, was in deinen Finanzen passiert." new: "Neu" - privacy_mode: "Datenschutzmodus umschalten" net_worth_chart: data_not_available: Für den ausgewählten Zeitraum sind keine Daten verfügbar. title: Nettovermögen diff --git a/config/locales/views/pages/en.yml b/config/locales/views/pages/en.yml index 5ccfa5df4..bded845ee 100644 --- a/config/locales/views/pages/en.yml +++ b/config/locales/views/pages/en.yml @@ -15,7 +15,6 @@ en: welcome: "Welcome back, %{name}" subtitle: "Here's what's happening with your finances" new: "New" - privacy_mode: "Toggle privacy mode" drag_to_reorder: "Drag to reorder section" toggle_section: "Toggle section visibility" net_worth_chart: From 71c0735824c1667137fcca3298f56bc81c3bc54c Mon Sep 17 00:00:00 2001 From: sokiee Date: Sun, 22 Mar 2026 10:48:54 +0100 Subject: [PATCH 3/4] Linter --- app/components/DS/select.html.erb | 4 ++-- app/views/admin/users/index.html.erb | 4 ++-- app/views/pending_duplicate_merges/new.html.erb | 2 +- app/views/transactions/_attachments.html.erb | 4 ++-- app/views/transactions/searches/filters/_tag_filter.html.erb | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/components/DS/select.html.erb b/app/components/DS/select.html.erb index 4b07ccd7b..170d3ee26 100644 --- a/app/components/DS/select.html.erb +++ b/app/components/DS/select.html.erb @@ -33,7 +33,7 @@ <%= helpers.icon("search", class: "absolute inset-0 ml-2 transform top-1/2 -translate-y-1/2") %>
<% end %> -
<% items.each do |item| %> <% is_selected = item[:value] == selected_value %> @@ -91,4 +91,4 @@ <% end %>
-
\ No newline at end of file +
diff --git a/app/views/admin/users/index.html.erb b/app/views/admin/users/index.html.erb index ac30a0062..6d10e0570 100644 --- a/app/views/admin/users/index.html.erb +++ b/app/views/admin/users/index.html.erb @@ -53,7 +53,7 @@ <% pending_invitations = @invitations_by_family[family.id] || [] %>
+ data-admin-invitation-delete-delete-all-label-value="<%= t(".invitations.delete_all") %>">
<%= icon "users", class: "w-5 h-5 text-secondary shrink-0" %> @@ -75,7 +75,7 @@ <% elsif sub %> + <%= sub.active? ? "bg-green-100 text-green-800" : "bg-surface text-secondary" %>"> <%= sub.status.humanize %> <% else %> diff --git a/app/views/pending_duplicate_merges/new.html.erb b/app/views/pending_duplicate_merges/new.html.erb index f2eb8bc12..580603f62 100644 --- a/app/views/pending_duplicate_merges/new.html.erb +++ b/app/views/pending_duplicate_merges/new.html.erb @@ -52,7 +52,7 @@
<%= entry.name %>
- <%= I18n.l(entry.date, format: :short) %> • + <%= I18n.l(entry.date, format: :short) %> • <%= number_to_currency(entry.amount.abs, unit: Money::Currency.new(entry.currency).symbol) %>
diff --git a/app/views/transactions/_attachments.html.erb b/app/views/transactions/_attachments.html.erb index 7dc5df74c..8688e6285 100644 --- a/app/views/transactions/_attachments.html.erb +++ b/app/views/transactions/_attachments.html.erb @@ -13,7 +13,7 @@ } do |form| %>
-
@@ -28,7 +28,7 @@ <%= form.file_field :attachments, multiple: true, - accept: Transaction::ALLOWED_CONTENT_TYPES.join(','), + accept: Transaction::ALLOWED_CONTENT_TYPES.join(","), class: "hidden", data: { attachment_upload_target: "fileInput", diff --git a/app/views/transactions/searches/filters/_tag_filter.html.erb b/app/views/transactions/searches/filters/_tag_filter.html.erb index 0c6b93873..8ba4fd0cc 100644 --- a/app/views/transactions/searches/filters/_tag_filter.html.erb +++ b/app/views/transactions/searches/filters/_tag_filter.html.erb @@ -20,7 +20,7 @@ <%= tag.name %> From b6b093c57840bf554ccd3a4db0fc7957a9a7acb5 Mon Sep 17 00:00:00 2001 From: sokiee Date: Sun, 22 Mar 2026 10:57:56 +0100 Subject: [PATCH 4/4] Extend privacy headers Extend privacy mode coverage to remaining financial views Transfers, trades, valuations, and holdings detail views were missing the privacy-sensitive class, leaving amounts visible when privacy mode was enabled. Also adds blur to the summary card partial (used by credit cards, loans, etc.), account chart balances, and time series chart containers (dashboard net worth and per-account charts). --- app/components/UI/account/chart.html.erb | 6 +++--- app/views/accounts/_summary_card.html.erb | 2 +- app/views/holdings/_holding.html.erb | 6 +++--- app/views/pages/dashboard/_net_worth_chart.html.erb | 2 +- app/views/trades/_header.html.erb | 6 +++--- app/views/transfers/show.html.erb | 6 +++--- app/views/valuations/_header.html.erb | 2 +- app/views/valuations/_valuation.html.erb | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/components/UI/account/chart.html.erb b/app/components/UI/account/chart.html.erb index ff54a5789..ac935938d 100644 --- a/app/components/UI/account/chart.html.erb +++ b/app/components/UI/account/chart.html.erb @@ -9,10 +9,10 @@ <% end %>
- <%= tag.p view_balance_money.format, class: "text-primary text-3xl font-medium truncate" %> + <%= tag.p view_balance_money.format, class: "text-primary text-3xl font-medium truncate privacy-sensitive" %> <% if converted_balance_money %> - <%= tag.p converted_balance_money.format, class: "text-sm font-medium text-secondary" %> + <%= tag.p converted_balance_money.format, class: "text-sm font-medium text-secondary privacy-sensitive" %> <% end %>
@@ -45,7 +45,7 @@ <% if series.any? %>
<% else %> diff --git a/app/views/accounts/_summary_card.html.erb b/app/views/accounts/_summary_card.html.erb index fe327728e..b711c1cd9 100644 --- a/app/views/accounts/_summary_card.html.erb +++ b/app/views/accounts/_summary_card.html.erb @@ -2,7 +2,7 @@

<%= title %>

-

+

<%= content %>

diff --git a/app/views/holdings/_holding.html.erb b/app/views/holdings/_holding.html.erb index 164acfc1e..c0ba88e64 100644 --- a/app/views/holdings/_holding.html.erb +++ b/app/views/holdings/_holding.html.erb @@ -37,7 +37,7 @@
<% if holding.amount_money %> - <%= tag.p format_money holding.amount_money %> + <%= tag.p format_money(holding.amount_money), class: "privacy-sensitive" %> <% else %> <%= tag.p "--", class: "text-secondary" %> <% end %> @@ -47,8 +47,8 @@
<%# Show Total Return (unrealized G/L) when cost basis exists (from trades or manual) %> <% if holding.trend %> - <%= tag.p format_money(holding.trend.value), style: "color: #{holding.trend.color};" %> - <%= tag.p "(#{holding.trend.percent_formatted})", style: "color: #{holding.trend.color};" %> + <%= tag.p format_money(holding.trend.value), class: "privacy-sensitive", style: "color: #{holding.trend.color};" %> + <%= tag.p "(#{holding.trend.percent_formatted})", class: "privacy-sensitive", style: "color: #{holding.trend.color};" %> <% else %> <%= tag.p "--", class: "text-secondary" %> <%= tag.p t(".no_cost_basis"), class: "text-xs text-secondary" %> diff --git a/app/views/pages/dashboard/_net_worth_chart.html.erb b/app/views/pages/dashboard/_net_worth_chart.html.erb index 08e284ae5..1a5f81d68 100644 --- a/app/views/pages/dashboard/_net_worth_chart.html.erb +++ b/app/views/pages/dashboard/_net_worth_chart.html.erb @@ -26,7 +26,7 @@ <% if series.any? %>
<% else %> diff --git a/app/views/trades/_header.html.erb b/app/views/trades/_header.html.erb index 68976a392..3cd66872e 100644 --- a/app/views/trades/_header.html.erb +++ b/app/views/trades/_header.html.erb @@ -8,7 +8,7 @@

- + <%= format_money entry.amount_money %> @@ -48,14 +48,14 @@
<%= t(".purchase_price_label") %>
-
<%= format_money trade.price_money %>
+
<%= format_money trade.price_money %>
<% end %> <% if trade.security.current_price.present? %>
<%= t(".current_market_price_label") %>
-
<%= format_money trade.security.current_price %>
+
<%= format_money trade.security.current_price %>
<% end %> diff --git a/app/views/transfers/show.html.erb b/app/views/transfers/show.html.erb index 5a369a2c6..792899bbb 100644 --- a/app/views/transfers/show.html.erb +++ b/app/views/transfers/show.html.erb @@ -3,7 +3,7 @@

- + <%= format_money @transfer.amount_abs %> @@ -35,7 +35,7 @@
Amount
-
<%= format_money @transfer.outflow_transaction.entry.amount_money * -1 %>
+
<%= format_money @transfer.outflow_transaction.entry.amount_money * -1 %>

<%= render "shared/ruler", classes: "my-2" %> @@ -53,7 +53,7 @@
Amount
-
+<%= format_money @transfer.inflow_transaction.entry.amount_money * -1 %>
+
+<%= format_money @transfer.inflow_transaction.entry.amount_money * -1 %>

diff --git a/app/views/valuations/_header.html.erb b/app/views/valuations/_header.html.erb index e00959ef4..2db8c8739 100644 --- a/app/views/valuations/_header.html.erb +++ b/app/views/valuations/_header.html.erb @@ -7,7 +7,7 @@

- + <%= format_money entry.amount_money %> diff --git a/app/views/valuations/_valuation.html.erb b/app/views/valuations/_valuation.html.erb index 201628ff1..46ca62eda 100644 --- a/app/views/valuations/_valuation.html.erb +++ b/app/views/valuations/_valuation.html.erb @@ -26,7 +26,7 @@

- <%= tag.p format_money(entry.amount_money), class: "font-bold text-sm text-primary" %> + <%= tag.p format_money(entry.amount_money), class: "font-bold text-sm text-primary privacy-sensitive" %>
<% end %>