1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 07:25:19 +02:00
Maybe/app/views/budgets/_budget_nav.html.erb
Zach Gollwitzer 195ec85d96
Budgeting V1 (#1609)
* Budgeting V1

* Basic UI template

* Fully scaffolded budgeting v1

* Basic working budget

* Finalize donut chart for budgets

* Allow categorization of loan payments for budget

* Include loan payments in incomes_and_expenses scope

* Add budget allocations progress

* Empty states

* Clean up budget methods

* Category aggregation queries

* Handle overage scenarios in form

* Finalize budget donut chart controller

* Passing tests

* Fix allocation naming

* Add income category migration

* Native support for uncategorized budget category

* Formatting

* Fix subcategory sort order, padding

* Fix calculation for category rollups in budget
2025-01-16 14:36:37 -05:00

37 lines
1.4 KiB
Text

<%# locals: (budget:) %>
<% steps = [
{ name: "Setup", path: edit_budget_path(budget), is_complete: budget.initialized?, step_number: 1 },
{ name: "Categories", path: budget_budget_categories_path(budget), is_complete: budget.allocations_valid?, step_number: 2 },
] %>
<ul class="flex items-center gap-2">
<% steps.each_with_index do |step, idx| %>
<li class="flex items-center gap-2 group">
<% is_current = request.path == step[:path] %>
<% text_class = if is_current
"text-gray-900"
else
step[:is_complete] ? "text-green-600" : "text-gray-500"
end %>
<% step_class = if is_current
"bg-gray-900 text-white"
else
step[:is_complete] ? "bg-green-600/10 border-alpha-black-25" : "bg-gray-50"
end %>
<%= link_to step[:path], class: "flex items-center gap-3" do %>
<div class="flex items-center gap-2 text-sm font-medium <%= text_class %>">
<span class="<%= step_class %> w-7 h-7 rounded-full shrink-0 inline-flex items-center justify-center border border-transparent">
<%= step[:is_complete] && !is_current ? lucide_icon("check", class: "w-4 h-4") : idx + 1 %>
</span>
<span><%= step[:name] %></span>
</div>
<% end %>
<div class="h-px bg-alpha-black-200 w-12 group-last:hidden"></div>
</li>
<% end %>
</ul>