From 69c5df73d9da3394c984d0337f63efee94cb0255 Mon Sep 17 00:00:00 2001 From: Josh Pigford Date: Thu, 8 Feb 2024 15:52:33 -0600 Subject: [PATCH] Only show account grouping if sum > 0 --- app/views/accounts/_account_list.html.erb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/accounts/_account_list.html.erb b/app/views/accounts/_account_list.html.erb index 6d9617a6..0692bfa2 100644 --- a/app/views/accounts/_account_list.html.erb +++ b/app/views/accounts/_account_list.html.erb @@ -2,7 +2,8 @@ <% accounts = Current.family.accounts.where(accountable_type: type.name) %> -
+<% if accounts.sum(&:balance) > 0 %> +
<%= lucide_icon("chevron-down", class: "hidden group-open:block text-[#737373] w-5 h-5") %> <%= lucide_icon("chevron-right", class: "group-open:hidden text-[#737373] w-5 h-5") %> @@ -11,7 +12,7 @@ <% accounts.each do |account| %> -
+

<%= account.name %>

<% if account.subtype %> @@ -27,4 +28,4 @@

New <%= type.model_name.human.downcase %>

<% end %>
- +<% end %>