mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Support uncategorized investments (#593)
* Support uncategorized investments * FIX sankey id collision * Fix reports * Fix hardcoded string and i8n * FIX plurals * Remove spending patterns section add net worth section to reports
This commit is contained in:
@@ -70,13 +70,9 @@
|
||||
</div>
|
||||
<div class="py-3 shadow-border-xs rounded-lg bg-container font-medium text-sm 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 mx-3 p-3 rounded-lg cursor-pointer group gap-3",
|
||||
data: {
|
||||
turbo_frame: "_top",
|
||||
category_id: category[:id],
|
||||
action: "mouseenter->donut-chart#highlightSegment mouseleave->donut-chart#unhighlightSegment"
|
||||
} do %>
|
||||
<%
|
||||
category_content = capture do
|
||||
%>
|
||||
<div class="flex items-center gap-3 flex-1 min-w-0">
|
||||
<div class="h-6 w-6 flex-shrink-0 group-hover:scale-105 transition-all duration-300 rounded-full flex justify-center items-center"
|
||||
style="
|
||||
@@ -102,6 +98,24 @@
|
||||
<span class="text-sm text-secondary whitespace-nowrap w-10 lg:w-15"><%= category[:percentage] %>%</span>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if category[:clickable] != false %>
|
||||
<%= 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 mx-3 p-3 rounded-lg cursor-pointer group gap-3",
|
||||
data: {
|
||||
turbo_frame: "_top",
|
||||
category_id: category[:id],
|
||||
action: "mouseenter->donut-chart#highlightSegment mouseleave->donut-chart#unhighlightSegment"
|
||||
} do %>
|
||||
<%= category_content %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="flex items-center justify-between mx-3 p-3 rounded-lg group gap-3"
|
||||
data-category-id="<%= category[:id] %>"
|
||||
data-action="mouseenter->donut-chart#highlightSegment mouseleave->donut-chart#unhighlightSegment">
|
||||
<%= category_content %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if idx < outflows_data[:categories].size - 1 %>
|
||||
<%= render "shared/ruler", classes: "mx-3 lg:mx-4" %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user