1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 15:35:22 +02:00
Maybe/app/views/categories/index.html.erb
Alex Hatzenbuhler 8070986763
Some checks are pending
Publish Docker image / ci (push) Waiting to run
Publish Docker image / Build docker image (push) Blocked by required conditions
Standardize corners, backgrounds, and borders (#2271)
* Create shared ruler view

* Use collection rendering/spacer templates for rules, and new shared_ruler

* Use shared ruler for all the places a ruler is used

* Use shared ruler for imports and balance sheet

* Fix brakeman by using a static partial with a defined collection

* Standardize & improve a bunch of corners, fix some backgrounds, fix merchants for dark mode

* Update balance sheet

* misc cleanup

* Fix import table

* Remove middot
2025-05-21 10:28:56 -04:00

57 lines
1.8 KiB
Text

<header class="flex items-center justify-between">
<h1 class="text-primary text-xl font-medium"><%= t(".categories") %></h1>
<div class="flex items-center gap-2">
<%= render MenuComponent.new do |menu| %>
<% menu.with_item(
variant: "button",
text: "Delete all",
href: destroy_all_categories_path,
method: :delete,
icon: "trash-2",
confirm: CustomConfirm.for_resource_deletion("all categories", high_severity: true)) %>
<% end %>
<%= render LinkComponent.new(
text: t(".new"),
variant: "primary",
icon: "plus",
href: new_category_path,
frame: :modal
) %>
</div>
</header>
<div class="bg-container rounded-xl shadow-border-xs p-4">
<% if @categories.any? %>
<div class="space-y-4">
<% if @categories.incomes.any? %>
<%= render "categories/category_list_group", title: t(".categories_incomes"), categories: @categories.incomes %>
<% end %>
<% if @categories.expenses.any? %>
<%= render "categories/category_list_group", title: t(".categories_expenses"), categories: @categories.expenses %>
<% end %>
</div>
<% else %>
<div class="flex justify-center items-center py-20">
<div class="text-center flex flex-col items-center max-w-[500px]">
<p class="text-sm text-secondary mb-4"><%= t(".empty") %></p>
<div class="flex items-center gap-2">
<%= render ButtonComponent.new(
text: t(".bootstrap"),
href: bootstrap_categories_path,
) %>
<%= render LinkComponent.new(
text: t(".new"),
variant: "outline",
icon: "plus",
href: new_category_path,
frame: :modal
) %>
</div>
</div>
</div>
<% end %>
</div>