Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style Fixed expense page #58

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions app/views/dashboard/_index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,7 @@
</div>

<div class="primary-card">
<div class="mx-auto py-6 sm:px-6 lg:px-8">
<%= turbo_frame_tag "fixed_expense_header_frame" do %>
<strong>Fixed Expenses</strong>
<div class="mt-4">
<%= link_to "New Fixed Expense", new_fixed_expense_path, data: { turbo_frame: :fixed_expenses }, class: "btn btn-primary" %>
</div>
<% end %>

<div class="pb-6">
<%= render "fixed_expenses/index" %>

<%= render partial: "shared/total_costs", locals: { total_cost: @total_cost } %>
Expand Down
25 changes: 18 additions & 7 deletions app/views/fixed_expenses/_index.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
<%= turbo_frame_tag :fixed_expenses do %>
<div id="fixed_expense_labels" class="grid grid-cols-5">
<% fixed_headings = %w[Expense Annual Monthly Bi-weekly] %>
<% fixed_headings.each do |fixed_heading| %>
<div class="px-5 pt-4"><strong><%= fixed_heading %></strong></div>
<% end %>
</div>
<div class="primary-card">
<div class="mx-auto pt-6 sm:px-6 lg:px-8">
<%= turbo_frame_tag "fixed_expense_header_frame" do %>
<strong>Fixed Expenses</strong>
<div class="mt-4">
<%= link_to "New Fixed Expense", new_fixed_expense_path, data: { turbo_frame: :fixed_expenses }, class: "btn btn-primary" %>
</div>
<% end %>

<div id="fixed_expense_labels" class="grid grid-cols-5">
<% fixed_headings = %w[Expense Annual Monthly Bi-weekly] %>
<% fixed_headings.each do |fixed_heading| %>
<div class="px-5 pt-4"><strong><%= fixed_heading %></strong></div>
<% end %>
</div>

<%= render @fixed_expenses %>
<%= render @fixed_expenses %>
</div>
</div>
<% end %>
11 changes: 1 addition & 10 deletions app/views/fixed_expenses/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,5 @@
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>

<div class="flex justify-between items-center">
<%= turbo_frame_tag :fixed_expenses do %>
<h1 class="font-bold text-4xl">Fixed expenses</h1>
<%= link_to 'New fixed expense', new_fixed_expense_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %>
<% end %>
</div>

<div id="fixed_expenses" class="min-w-full">
<%= render @fixed_expenses %>
</div>
<%= render "fixed_expenses/index" %>
</div>
38 changes: 20 additions & 18 deletions app/views/shared/_total_costs.html.erb
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
<%= turbo_frame_tag "total_costs" do %>
<div class="grid grid-cols-5">
<div class="px-5">
<strong>Total</strong>
</div>
<div class="mx-auto sm:px-6 lg:px-8">
<div class="grid grid-cols-5">
<div class="px-5">
<strong>Total</strong>
</div>

<div>
<strong>
<%= render partial: "shared/total", locals: { total: total_cost.annual_cost } %>
</strong>
</div>
<div>
<strong>
<%= render partial: "shared/total", locals: { total: total_cost.annual_cost } %>
</strong>
</div>

<div>
<strong>
<%= render partial: "shared/total", locals: { total: total_cost.monthly_cost } %>
</strong>
</div>
<div>
<strong>
<%= render partial: "shared/total", locals: { total: total_cost.monthly_cost } %>
</strong>
</div>

<div>
<strong>
<%= render partial: "shared/total", locals: { total: total_cost.bi_weekly_cost } %>
</strong>
<div>
<strong>
<%= render partial: "shared/total", locals: { total: total_cost.bi_weekly_cost } %>
</strong>
</div>
</div>
</div>
<% end %>