2025-02-21 11:57:59 -05:00
|
|
|
<header class="flex items-center justify-between">
|
|
|
|
<h1 class="text-primary text-xl font-medium"><%= t(".categories") %></h1>
|
2024-05-02 07:24:31 -06:00
|
|
|
|
2025-04-18 11:39:58 -04:00
|
|
|
<div class="flex items-center gap-2">
|
2025-07-18 08:30:00 -04:00
|
|
|
<%= render DS::Menu.new do |menu| %>
|
2025-04-30 18:14:22 -04:00
|
|
|
<% menu.with_item(
|
|
|
|
variant: "button",
|
|
|
|
text: "Delete all",
|
|
|
|
href: destroy_all_categories_path,
|
|
|
|
method: :delete,
|
|
|
|
icon: "trash-2",
|
2025-05-05 11:43:46 -05:00
|
|
|
confirm: CustomConfirm.for_resource_deletion("all categories", high_severity: true)) %>
|
2025-04-18 11:39:58 -04:00
|
|
|
<% end %>
|
|
|
|
|
2025-07-18 08:30:00 -04:00
|
|
|
<%= render DS::Link.new(
|
2025-04-30 18:14:22 -04:00
|
|
|
text: t(".new"),
|
|
|
|
variant: "primary",
|
|
|
|
icon: "plus",
|
|
|
|
href: new_category_path,
|
|
|
|
frame: :modal
|
|
|
|
) %>
|
2025-04-18 11:39:58 -04:00
|
|
|
</div>
|
2025-02-21 11:57:59 -05:00
|
|
|
</header>
|
2024-05-02 07:24:31 -06:00
|
|
|
|
2025-05-21 09:28:56 -05:00
|
|
|
<div class="bg-container rounded-xl shadow-border-xs p-4">
|
2025-02-21 11:57:59 -05:00
|
|
|
<% 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 %>
|
2025-01-16 14:36:37 -05:00
|
|
|
|
2025-02-21 11:57:59 -05:00
|
|
|
<% 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">
|
2025-07-18 08:30:00 -04:00
|
|
|
<%= render DS::Button.new(
|
2025-04-30 18:14:22 -04:00
|
|
|
text: t(".bootstrap"),
|
|
|
|
href: bootstrap_categories_path,
|
|
|
|
) %>
|
2024-12-20 11:37:26 -05:00
|
|
|
|
2025-07-18 08:30:00 -04:00
|
|
|
<%= render DS::Link.new(
|
2025-04-30 18:14:22 -04:00
|
|
|
text: t(".new"),
|
|
|
|
variant: "outline",
|
|
|
|
icon: "plus",
|
|
|
|
href: new_category_path,
|
|
|
|
frame: :modal
|
|
|
|
) %>
|
2024-08-27 17:06:41 -04:00
|
|
|
</div>
|
2024-05-02 07:24:31 -06:00
|
|
|
</div>
|
2025-02-21 11:57:59 -05:00
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|