1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 13:35:21 +02:00

Nested Categories (#1561)
Some checks failed
Publish Docker image / ci (push) Has been cancelled
Publish Docker image / Build docker image (push) Has been cancelled

* Prepare entry search for nested categories

* Subcategory implementation

* Remove caching for test stability
This commit is contained in:
Zach Gollwitzer 2024-12-20 11:37:26 -05:00 committed by GitHub
parent a4d10097d5
commit 77def1db40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 297 additions and 234 deletions

View file

@ -15,6 +15,9 @@
<span class="w-5 h-5">
<%= lucide_icon("check", class: "w-5 h-5 text-gray-500") if is_selected %>
</span>
<% if category.subcategory? %>
<%= lucide_icon "corner-down-right", class: "shrink-0 w-5 h-5 text-gray-400" %>
<% end %>
<%= render partial: "categories/badge", locals: { category: category } %>
<% end %>

View file

@ -10,8 +10,21 @@
<div class="pb-2 pl-4 mr-2 text-gray-500 hidden" data-list-filter-target="emptyMessage">
<%= t(".no_categories") %>
</div>
<% @categories.each do |category| %>
<%= render partial: "category/dropdowns/row", locals: { category: } %>
<% if @categories.any? %>
<% Category::Group.for(@categories).each do |group| %>
<%= render "category/dropdowns/row", category: group.category %>
<% group.subcategories.each do |category| %>
<%= render "category/dropdowns/row", category: category %>
<% end %>
<% end %>
<% else %>
<div class="flex justify-center items-center py-12">
<div class="text-center flex flex-col items-center max-w-[500px]">
<p class="text-sm text-gray-500 font-normal mb-4"><%= t(".empty") %></p>
<%= button_to t(".bootstrap"), bootstrap_categories_path, class: "btn btn--outline", data: { turbo_frame: :_top } %>
</div>
</div>
<% end %>
</div>
<hr>