mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-07 22:45:20 +02:00
* 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
40 lines
1.4 KiB
Text
40 lines
1.4 KiB
Text
<%# locals: (budget:, previous_budget:, next_budget:, latest_budget:) %>
|
|
|
|
<div class="flex items-center gap-1 mb-4">
|
|
<div class="flex items-center gap-2">
|
|
<% if @previous_budget %>
|
|
<%= link_to budget_path(@previous_budget) do %>
|
|
<%= lucide_icon "chevron-left" %>
|
|
<% end %>
|
|
<% else %>
|
|
<%= lucide_icon "chevron-left", class: "text-gray-400" %>
|
|
<% end %>
|
|
|
|
<% if @next_budget %>
|
|
<%= link_to budget_path(@next_budget) do %>
|
|
<%= lucide_icon "chevron-right" %>
|
|
<% end %>
|
|
<% else %>
|
|
<%= lucide_icon "chevron-right", class: "text-gray-400" %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div data-controller="menu" data-menu-placement-value="bottom-start">
|
|
<%= tag.button data: { menu_target: "button" }, class: "flex items-center gap-1 hover:bg-gray-50 rounded-md p-2" do %>
|
|
<span class="text-gray-900 font-medium"><%= @budget.name %></span>
|
|
<%= lucide_icon "chevron-down", class: "w-5 h-5 shrink-0 text-gray-500" %>
|
|
<% end %>
|
|
|
|
<div data-menu-target="content" class="hidden z-10">
|
|
<%= render "budgets/picker", family: Current.family, year: Date.current.year %>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="ml-auto">
|
|
<% if @budget.current? %>
|
|
<span class="border border-alpha-black-200 text-gray-900 text-sm font-medium px-3 py-2 rounded-lg">Today</span>
|
|
<% else %>
|
|
<%= link_to "Today", budget_path(@latest_budget), class: "btn btn--outline" %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|