1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-07 22:45:20 +02:00
Maybe/app/views/budget_categories/index.html.erb
Zach Gollwitzer d75be2282b
New Design System + Codebase Refresh (#1823)
Since the very first 0.1.0-alpha.1 release, we've been moving quickly to add new features to the Maybe app. In doing so, some parts of the codebase have become outdated, unnecessary, or overly-complex as a natural result of this feature prioritization.

Now that "core" Maybe is complete, we're moving into a second phase of development where we'll be working hard to improve the accuracy of existing features and build additional features on top of "core". This PR is a quick overhaul of the existing codebase aimed to:

- Establish the brand new and simplified dashboard view (pictured above)
- Establish and move towards the conventions introduced in Cursor rules and project design overview #1788
- Consolidate layouts and improve the performance of layout queries
- Organize the core models of the Maybe domain (i.e. Account::Entry, Account::Transaction, etc.) and break out specific traits of each model into dedicated concerns for better readability
- Remove stale / dead code from codebase
- Remove overly complex code paths in favor of simpler ones
2025-02-21 11:57:59 -05:00

53 lines
2 KiB
Text

<%= content_for :header_nav do %>
<%= render "budgets/budget_nav", budget: @budget %>
<% end %>
<%= content_for :previous_path, edit_budget_path(@budget) %>
<%= content_for :cancel_path, budget_path(@budget) %>
<div>
<div class="space-y-6">
<div class="text-center space-y-2">
<h1 class="text-3xl text-primary font-medium">Edit your category budgets</h1>
<p class="text-secondary text-sm max-w-md mx-auto">
Adjust category budgets to set spending limits. Unallocated funds will be automatically assigned as uncategorized.
</p>
</div>
<div class="mx-auto max-w-lg">
<% if @budget.family.categories.empty? %>
<div class="bg-white shadow-border-xs rounded-lg p-4">
<%= render "budget_categories/no_categories" %>
</div>
<% else %>
<div class="max-w-md mx-auto">
<%= render "budget_categories/allocation_progress", budget: @budget %>
<div class="space-y-4 mb-4">
<% BudgetCategory::Group.for(@budget_categories).sort_by(&:name).each do |group| %>
<div class="space-y-4">
<%= render "budget_categories/budget_category_form", budget_category: group.budget_category %>
<div class="space-y-4">
<% group.budget_subcategories.each do |budget_subcategory| %>
<div class="w-full flex items-center gap-4">
<div class="ml-4 flex items-center justify-center text-subdued">
<%= lucide_icon "corner-down-right", class: "w-5 h-5 shrink-0" %>
</div>
<%= render "budget_categories/budget_category_form", budget_category: budget_subcategory %>
</div>
<% end %>
</div>
</div>
<% end %>
<%= render "budget_categories/uncategorized_budget_category_form", budget: @budget %>
</div>
<%= render "budget_categories/confirm_button", budget: @budget %>
</div>
<% end %>
</div>
</div>
</div>