From 56c4ce911dc5900c58db84fa0e481e742dac0cf3 Mon Sep 17 00:00:00 2001 From: Alessio Cappa Date: Thu, 22 Jan 2026 22:32:57 +0100 Subject: [PATCH] fix: Improve net worth tables --- app/views/reports/_net_worth.html.erb | 52 +++++++++++-------- .../reports/_transactions_breakdown.html.erb | 2 +- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/app/views/reports/_net_worth.html.erb b/app/views/reports/_net_worth.html.erb index d7fa0beff..cc1be261f 100644 --- a/app/views/reports/_net_worth.html.erb +++ b/app/views/reports/_net_worth.html.erb @@ -3,31 +3,31 @@
<%# Current Net Worth %>
-

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

-

"> +

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

+

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

<%# Period Change %>
-

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

+

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

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

+

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

<%= trend.value >= 0 ? "+" : "" %><%= trend.percent_formatted %>

<% else %> -

--

+

--

<% end %>
<%# Assets vs Liabilities %>
-

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

+

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

<%= net_worth_metrics[:total_assets].format %> - @@ -39,30 +39,40 @@ <%# Asset/Liability Breakdown %>
<%# Assets Summary %> -
-

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

-
- <% net_worth_metrics[:asset_groups].each do |group| %> -
- <%= group[:name] %> - <%= group[:total].format %> +
+
+
<%= t("reports.net_worth.total_assets") %>
+
+
+ <% net_worth_metrics[:asset_groups].each_with_index do |group, idx| %> +
+
<%= group[:name] %>
+
<%= group[:total].format %>
+ <% if idx < net_worth_metrics[:asset_groups].size - 1 %> + <%= render "shared/ruler", classes: "mx-3 lg:mx-4" %> + <% end %> <% end %> <% if net_worth_metrics[:asset_groups].empty? %> -

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

+

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

<% end %>
<%# Liabilities Summary %> -
-

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

-
- <% net_worth_metrics[:liability_groups].each do |group| %> -
- <%= group[:name] %> - <%= group[:total].format %> +
+
+
<%= t("reports.net_worth.total_liabilities") %>
+
+
+ <% net_worth_metrics[:liability_groups].each_with_index do |group, idx| %> +
+
<%= group[:name] %>
+
<%= group[:total].format %>
+ <% if idx < net_worth_metrics[:liability_groups].size - 1 %> + <%= render "shared/ruler", classes: "mx-3 lg:mx-4" %> + <% end %> <% end %> <% if net_worth_metrics[:liability_groups].empty? %>

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

diff --git a/app/views/reports/_transactions_breakdown.html.erb b/app/views/reports/_transactions_breakdown.html.erb index c271b982a..0e1d6531d 100644 --- a/app/views/reports/_transactions_breakdown.html.erb +++ b/app/views/reports/_transactions_breakdown.html.erb @@ -76,7 +76,7 @@
<%# Summary Stats %> -
+
<%= t("reports.transactions_breakdown.pagination.showing", count: transactions.sum { |g| g[:count] }) %>
<% else %>