From c28dd8f9408c3a6d217b094c8fce0ab9eb016e99 Mon Sep 17 00:00:00 2001 From: Zach Gollwitzer Date: Fri, 13 Sep 2024 11:28:47 -0400 Subject: [PATCH] Omit trend if zero in sidebar (#1173) * Omit trend if zero in sidebar * Lint fix --- app/views/accounts/_account_list.html.erb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/views/accounts/_account_list.html.erb b/app/views/accounts/_account_list.html.erb index 6066c61a..b42df152 100644 --- a/app/views/accounts/_account_list.html.erb +++ b/app/views/accounts/_account_list.html.erb @@ -39,8 +39,9 @@

<%= format_money account.balance_money %>

-
- <%= + <% unless account_value_node.series.trend.direction.flat? %> +
+ <%= tag.div( id: dom_id(account, :list_sparkline), class: "h-3 w-8 ml-auto", @@ -52,10 +53,11 @@ "time-series-chart-use-tooltip-value": false } ) - %> - <% styles = trend_styles(account_value_node.series.trend) %> - <%= sprintf("%+.2f", account_value_node.series.trend.percent) %>% -
+ %> + <% styles = trend_styles(account_value_node.series.trend) %> + <%= sprintf("%+.2f", account_value_node.series.trend.percent) %>% +
+ <% end %>
<% end %> <% end %>