Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

UI Improvements for Ouflows Section (#334)

Alessio Cappab16857b040ae
diff --git a/app/views/pages/dashboard/_balance_sheet.html.erb b/app/views/pages/dashboard/_balance_sheet.html.erb
index 5273e50318..af9ab31652 100644
--- a/app/views/pages/dashboard/_balance_sheet.html.erb
+++ b/app/views/pages/dashboard/_balance_sheet.html.erb
@@ -35,7 +35,7 @@
</div>
</div>
- <div class="bg-surface rounded-xl p-1 space-y-1 overflow-x-auto">
+ <div class="bg-container-inset rounded-xl p-1 space-y-1 overflow-x-auto">
<div class="px-4 py-2 flex items-center uppercase text-xs font-medium text-secondary">
<div class="w-40">Name</div>
<div class="ml-auto text-right flex items-center gap-6">
@@ -50,11 +50,11 @@
<div class="shadow-border-xs rounded-lg bg-container font-medium text-sm min-w-fit">
<% classification_group.account_groups.each_with_index do |account_group, idx| %>
- <details class="group open:bg-surface
+ <details class="group open:bg-container
<%= idx == 0 ? "rounded-t-lg" : "" %>
<%= idx == classification_group.account_groups.size - 1 ? "rounded-b-lg" : "" %>
">
- <summary class="cursor-pointer p-4 group-open:bg-surface rounded-lg flex items-center justify-between">
+ <summary class="cursor-pointer p-4 group-open:bg-container rounded-lg flex items-center justify-between">
<div class="w-40 shrink-0 flex items-center gap-4">
<%= icon("chevron-right", class: "group-open:rotate-90") %>
diff --git a/app/views/pages/dashboard/_outflows_donut.html.erb b/app/views/pages/dashboard/_outflows_donut.html.erb
index dd1aab80f9..b1132cf9b1 100644
--- a/app/views/pages/dashboard/_outflows_donut.html.erb
+++ b/app/views/pages/dashboard/_outflows_donut.html.erb
@@ -59,11 +59,24 @@
</div>
<!-- Category List -->
- <div class="w-full lg:w-2/3">
- <div class="space-y-2">
- <% outflows_data[:categories].each do |category| %>
+ <div class="w-full lg:w-2/3 bg-container-inset rounded-xl p-1 space-y-1 overflow-x-auto">
+ <div class="px-4 py-2 flex items-center uppercase text-xs font-medium text-secondary">
+ <div class="w-16 lg:w-40">
+ <p><%= t("pages.dashboard.outflows_donut.categories") %><span class="text-subdued mx-1">&middot;</span><%= outflows_data[:categories].count %></p>
+ </div>
+ <div class="ml-auto text-right flex items-center gap-6">
+ <div class="w-16 lg:w-40">
+ <p><%= t("pages.dashboard.outflows_donut.value") %></p>
+ </div>
+ <div class="w-16">
+ <p><%= t("pages.dashboard.outflows_donut.weight") %></p>
+ </div>
+ </div>
+ </div>
+ <div class="py-3 shadow-border-xs rounded-lg bg-container font-medium text-sm min-w-fit max-w-full">
+ <% outflows_data[:categories].each_with_index do |category, idx| %>
<%= link_to transactions_path(q: { categories: [category[:name]], start_date: period.date_range.first, end_date: period.date_range.last }),
- class: "flex items-center justify-between p-3 rounded-lg hover:bg-container-inset transition-colors cursor-pointer group",
+ class: "flex items-center justify-between mx-3 p-3 rounded-lg cursor-pointer group",
data: {
turbo_frame: "_top",
category_id: category[:id],
@@ -79,6 +92,9 @@
<span class="text-sm text-secondary whitespace-nowrap"><%= category[:percentage] %>%</span>
</div>
<% end %>
+ <% if idx < outflows_data[:categories].size - 1 %>
+ <%= render "shared/ruler", classes: "mx-3 lg:mx-4" %>
+ <% end %>
<% end %>
</div>
</div>
diff --git a/config/locales/views/pages/en.yml b/config/locales/views/pages/en.yml
index f33a3e00ae..572b06c784 100644
--- a/config/locales/views/pages/en.yml
+++ b/config/locales/views/pages/en.yml
@@ -29,3 +29,6 @@ en:
outflows_donut:
title: "Outflows"
total_outflows: "Total Outflows"
+ categories: "Categories"
+ value: "Value"
+ weight: "Weight"