mirror of
https://github.com/we-promise/sure.git
synced 2026-04-08 14:54:49 +00:00
* fix: Budget UI improvements * feat: Reduce padding for sub-categories * fix: Adjust padding for sub-category arrow * Revert "feat: Reduce padding for sub-categories" This reverts commit7516c5a8e0. * Revert "fix: Adjust padding for sub-category arrow" This reverts commitebc82542cf. * fix: adjust padding for sub-categories * fix: Add padding to uncategorized budget * fix: Remove unnecessary HTML tag * feat: Add translation keys for budgeted/actual
68 lines
2.4 KiB
Plaintext
68 lines
2.4 KiB
Plaintext
<div class="pb-12">
|
|
<%= render "budgets/budget_header",
|
|
budget: @budget,
|
|
previous_budget: @previous_budget,
|
|
next_budget: @next_budget,
|
|
latest_budget: @latest_budget %>
|
|
|
|
<div class="space-y-4">
|
|
<%# Top Section: Donut and Summary side by side %>
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
<%# Budget Donut %>
|
|
<div class="h-[300px] bg-container rounded-xl shadow-border-xs p-8">
|
|
<% if @budget.available_to_allocate.negative? %>
|
|
<%= render "budgets/over_allocation_warning", budget: @budget %>
|
|
<% else %>
|
|
<%= render "budgets/budget_donut", budget: @budget %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<%# Actuals Summary %>
|
|
<% if @budget.initialized? && @budget.available_to_allocate.positive? %>
|
|
<%= render DS::Tabs.new(active_tab: params[:tab].presence || "budgeted") do |tabs| %>
|
|
<% tabs.with_nav do |nav| %>
|
|
<% nav.with_btn(id: "budgeted", label: t("budgets.show.tabs.budgeted")) %>
|
|
<% nav.with_btn(id: "actuals", label: t("budgets.show.tabs.actual")) %>
|
|
<% end %>
|
|
|
|
<% tabs.with_panel(tab_id: "budgeted") do %>
|
|
<div class="bg-container rounded-xl shadow-border-xs">
|
|
<%= render "budgets/budgeted_summary", budget: @budget %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% tabs.with_panel(tab_id: "actuals") do %>
|
|
<div class="bg-container rounded-xl shadow-border-xs">
|
|
<%= render "budgets/actuals_summary", budget: @budget %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
<% else %>
|
|
<div class="bg-container rounded-xl shadow-border-xs">
|
|
<%= render "budgets/actuals_summary", budget: @budget %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<%# Bottom Section: Categories full width %>
|
|
<div class="w-full bg-container rounded-xl shadow-border-xs p-4">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h2 class="text-lg font-medium">Categories</h2>
|
|
|
|
<% if @budget.initialized? %>
|
|
<%= render DS::Link.new(
|
|
text: "Edit",
|
|
variant: "secondary",
|
|
icon: "settings-2",
|
|
href: budget_budget_categories_path(@budget)
|
|
) %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="bg-container-inset rounded-xl p-1">
|
|
<%= render "budgets/budget_categories", budget: @budget %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|