mirror of
https://github.com/we-promise/sure.git
synced 2026-04-17 11:04:14 +00:00
* Make categories global This solves us A LOT of cash flow and budgeting problems. * Update schema.rb * Update auto_categorizer.rb * Update income_statement.rb * FIX budget sub-categories * FIX sub-categories and tests * Add 2 step migration
49 lines
1.4 KiB
Plaintext
49 lines
1.4 KiB
Plaintext
<%= content_for :page_title, t(".categories") %>
|
|
<%= content_for :page_actions do %>
|
|
<%= render DS::Menu.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 DS::Link.new(
|
|
text: t(".new"),
|
|
variant: "primary",
|
|
icon: "plus",
|
|
href: new_category_path,
|
|
frame: :modal
|
|
) %>
|
|
<% end %>
|
|
|
|
<div class="bg-container rounded-xl shadow-border-xs p-4">
|
|
<% if @categories.any? %>
|
|
<div class="space-y-4">
|
|
<%= render "categories/category_list_group", title: t(".categories"), categories: @categories %>
|
|
</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 DS::Button.new(
|
|
text: t(".bootstrap"),
|
|
href: bootstrap_categories_path,
|
|
) %>
|
|
|
|
<%= render DS::Link.new(
|
|
text: t(".new"),
|
|
variant: "outline",
|
|
icon: "plus",
|
|
href: new_category_path,
|
|
frame: :modal
|
|
) %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|