-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Clean up forms and add attributes to income_tax_calculator.rb * Style dashboard page
- Loading branch information
Showing
9 changed files
with
136 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<%= form_with url: income_switch_url, local: true do |form| %> | ||
<label class="relative inline-flex items-center cursor-pointer"> | ||
<%= form.check_box :enabled, class: "sr-only peer", onchange: "this.form.requestSubmit()" %> | ||
<div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"></div> | ||
<div class="w-11 h-6 bg-gray-800 peer-focus:outline-none rounded-full peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-purple-800"></div> | ||
<span class="ms-3 text-sm font-medium text-gray-900">Switch income type</span> | ||
</label> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,57 @@ | ||
<div class="min-h-full"> | ||
<header class="bg-white shadow"> | ||
<div class="mx-auto max-w-7xl px-4 py-6 sm:px-6 lg:px-8"> | ||
<h1 class="text-3xl font-bold tracking-tight text-gray-900">Budget Calculator</h1> | ||
<div class="primary-card"> | ||
<div class="mx-auto px-4 py-6 sm:px-6 lg:px-8"> | ||
<h1>Budget Calculator</h1> | ||
</div> | ||
</header> | ||
</div> | ||
|
||
<main> | ||
|
||
<div class="bg-white shadow"> | ||
<div class="mx-auto max-w-7xl py-6 sm:px-6 lg:px-8"> | ||
<div class="mt-5"> | ||
<h3 class="text-2xl font-bold tracking-tight text-gray-900">Final Budget</h3> | ||
<div class="pt-4"> | ||
<%= render partial: "components/income_switch" %> | ||
</div> | ||
</div> | ||
<div id="final_income"> | ||
<%= render partial: "budget/salary_budget", locals: {totals: @totals, income: @salary_taxed} %> | ||
</div> | ||
<div class="primary-card"> | ||
<div class="mx-auto py-6 sm:px-6 lg:px-8"> | ||
<h3>Final Budget</h3> | ||
<div class="pt-4"> | ||
<%= render partial: "components/income_switch" %> | ||
</div> | ||
</div> | ||
|
||
<div class="bg-white shadow"> | ||
<div class="mx-auto max-w-7xl py-6 sm:px-6 lg:px-8"> | ||
<%= turbo_frame_tag "income_header_frame" do %> | ||
<div class="mt-5"> | ||
<h3 class="text-2xl font-bold tracking-tight text-gray-900">Income</h3> | ||
<%= link_to "New Income", new_income_path, data: { turbo_frame: :incomes } %> | ||
</div> | ||
<% end %> | ||
|
||
<div class="pt-4"> | ||
<%= turbo_frame_tag :incomes do %> | ||
<%= render "incomes/index" %> | ||
<% end %> | ||
</div> | ||
|
||
<div class="pt-4"> | ||
<%= turbo_frame_tag "taxed_incomes" do %> | ||
<%= render partial: "shared/taxed_incomes", locals: { salary_taxed: @salary_taxed, hourly_taxed: @hourly_taxed} %> | ||
<% end %> | ||
</div> | ||
<div id="final_income"> | ||
<%= render partial: "budget/salary_budget", locals: {totals: @totals, income: @salary_taxed} %> | ||
</div> | ||
</div> | ||
|
||
<div class="bg-white shadow"> | ||
<div class="mx-auto max-w-7xl py-6 sm:px-6 lg:px-8"> | ||
<%= turbo_frame_tag "fixed_expense_header_frame" do %> | ||
<div class="mt-3"> | ||
<h3 class="text-2xl font-bold tracking-tight text-gray-900">Fixed Expenses</h3> | ||
<%= link_to "New Fixed Expense", new_fixed_expense_path, data: { turbo_frame: :fixed_expenses } %> | ||
</div> | ||
</div> | ||
|
||
<div class="primary-card"> | ||
<div class="mx-auto py-6 sm:px-6 lg:px-8"> | ||
<%= turbo_frame_tag "income_header_frame" do %> | ||
<h3>Income</h3> | ||
<%= link_to "New Income", new_income_path, data: { turbo_frame: :incomes }, class: "btn btn-primary" %> | ||
<% end %> | ||
|
||
<div class="pt-4"> | ||
<%= turbo_frame_tag :incomes do %> | ||
<%= render "incomes/index" %> | ||
<% end %> | ||
</div> | ||
|
||
<%= turbo_frame_tag :fixed_expenses do %> | ||
<%= render "fixed_expenses/index" %> | ||
<% end %> | ||
|
||
<%= turbo_frame_tag "total_costs" do %> | ||
<%= render partial: "shared/total_costs", locals: { totals: @totals } %> | ||
<div class="pt-4"> | ||
<%= turbo_frame_tag "taxed_incomes" do %> | ||
<%= render partial: "shared/taxed_incomes", locals: { salary_taxed: @salary_taxed, hourly_taxed: @hourly_taxed} %> | ||
<% end %> | ||
</div> | ||
</div> | ||
</main> | ||
</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 %> | ||
<h3>Fixed Expenses</h3> | ||
<%= link_to "New Fixed Expense", new_fixed_expense_path, data: { turbo_frame: :fixed_expenses }, class: "btn btn-primary" %> | ||
<% end %> | ||
|
||
<%= turbo_frame_tag :fixed_expenses do %> | ||
<%= render "fixed_expenses/index" %> | ||
<% end %> | ||
|
||
<%= turbo_frame_tag "total_costs" do %> | ||
<%= render partial: "shared/total_costs", locals: { totals: @totals } %> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<%= turbo_frame_tag dom_id(fixed_expense) do %> | ||
<div class="grid grid-cols-6"> | ||
<div class="grid grid-cols-6 pb-1"> | ||
<% attributes = [fixed_expense.expense_name, humanized_money_with_symbol(fixed_expense.annual_cost), humanized_money_with_symbol(fixed_expense.monthly_cost), humanized_money_with_symbol(fixed_expense.bi_weekly_cost)] %> | ||
<% attributes.each do |attribute| %> | ||
<div class="px-5"><%= attribute %></div> | ||
<% end %> | ||
<div class="px-5"><%= link_to "Edit", edit_fixed_expense_path(fixed_expense), class:"rounded-lg px-2 bg-gray-100 inline-block font-medium" %></div> | ||
<div class=""><%= button_to "Delete", fixed_expense_path(fixed_expense), method: :delete, class:"rounded-lg px-2 bg-gray-100 inline-block font-medium" %></div> | ||
<div class=""><%= link_to "Edit", edit_fixed_expense_path(fixed_expense), class:"btn btn-primary" %></div> | ||
<div class=""><%= button_to "Delete", fixed_expense_path(fixed_expense), method: :delete, class:"btn btn-danger" %></div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<%= turbo_frame_tag dom_id(income) do %> | ||
<div class="grid grid-cols-6"> | ||
<div class="grid grid-cols-6 pb-1"> | ||
<% attributes = [income.income_type, humanized_money_with_symbol(income.rate), income.hours, humanized_money_with_symbol(income.weekly_income)] %> | ||
<% attributes.each do |attribute| %> | ||
<div class="px-5"><%= attribute %></div> | ||
<% end %> | ||
<div class="px-5"><%= link_to "Edit", edit_income_path(income), class:"rounded-lg px-2 bg-gray-100 inline-block font-medium" %></div> | ||
<div class="px-5"><%= link_to "Edit", edit_income_path(income), class:"btn btn-primary" %></div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters