-
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.
Refactor to update streams on multiple crud. (#37)
* Refactor to update streams on multiple crud. * Capitalize new income on dashboard index
- Loading branch information
Showing
10 changed files
with
155 additions
and
172 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
<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> | ||
<%= 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> | ||
|
||
<%= render @fixed_expenses %> | ||
<%= render @fixed_expenses %> | ||
<% 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,31 +1,28 @@ | ||
<%= turbo_stream.replace "fixed_expenses" do %> | ||
<%= render @fixed_expenses %> | ||
<%= turbo_stream.replace :fixed_expenses do %> | ||
<%= render "fixed_expenses/index" %> | ||
<% end %> | ||
|
||
<%= turbo_stream.replace "total_costs" do %> | ||
<%= render partial: "shared/total_costs", locals: { total_cost: @total_cost } %> | ||
<% end %> | ||
<%= turbo_stream.update "total_costs", | ||
partial: "shared/total_costs", | ||
locals: { total_cost: @total_cost } | ||
%> | ||
|
||
<%= turbo_stream.replace "salary_budget" do %> | ||
<%= render partial: "budget/salary_budget", | ||
locals: { | ||
income: @salary_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @salary_invest, | ||
savings_amount: @salary_saving, | ||
guilt_free: @guilt_free_salary | ||
} | ||
%> | ||
<% end %> | ||
<%= turbo_stream.update "salary_budget", | ||
partial: "budget/salary_budget", | ||
locals: { | ||
income: @salary_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @salary_invest, | ||
savings_amount: @salary_saving, | ||
guilt_free: @guilt_free_salary } | ||
%> | ||
|
||
<%= turbo_stream.replace "hourly_budget" do %> | ||
<%= render partial: "budget/hourly_budget", | ||
locals: { | ||
income: @hourly_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @hourly_invest, | ||
savings_amount: @hourly_saving, | ||
guilt_free: @guilt_free_hourly | ||
} | ||
%> | ||
<% end %> | ||
<%= turbo_stream.update "hourly_budget", | ||
partial: "budget/hourly_budget", | ||
locals: { | ||
income: @hourly_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @hourly_invest, | ||
savings_amount: @hourly_saving, | ||
guilt_free: @guilt_free_hourly } | ||
%> |
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,29 +1,26 @@ | ||
<%= turbo_stream.remove @fixed_expense %> | ||
|
||
<%= turbo_stream.replace "total_costs" do %> | ||
<%= render partial: "shared/total_costs", locals: { total_cost: @total_cost } %> | ||
<% end %> | ||
<%= turbo_stream.update "total_costs", | ||
partial: "shared/total_costs", | ||
locals: { total_cost: @total_cost } | ||
%> | ||
|
||
<%= turbo_stream.replace "salary_budget" do %> | ||
<%= render partial: "budget/salary_budget", | ||
locals: { | ||
income: @salary_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @salary_invest, | ||
savings_amount: @salary_saving, | ||
guilt_free: @guilt_free_salary | ||
} | ||
%> | ||
<% end %> | ||
<%= turbo_stream.update "salary_budget", | ||
partial: "budget/salary_budget", | ||
locals: { | ||
income: @salary_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @salary_invest, | ||
savings_amount: @salary_saving, | ||
guilt_free: @guilt_free_salary } | ||
%> | ||
|
||
<%= turbo_stream.replace "hourly_budget" do %> | ||
<%= render partial: "budget/hourly_budget", | ||
locals: { | ||
income: @hourly_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @hourly_invest, | ||
savings_amount: @hourly_saving, | ||
guilt_free: @guilt_free_hourly | ||
} | ||
%> | ||
<% end %> | ||
<%= turbo_stream.update "hourly_budget", | ||
partial: "budget/hourly_budget", | ||
locals: { | ||
income: @hourly_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @hourly_invest, | ||
savings_amount: @hourly_saving, | ||
guilt_free: @guilt_free_hourly } | ||
%> |
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,29 +1,26 @@ | ||
<%= turbo_stream.update @fixed_expense %> | ||
|
||
<%= turbo_stream.replace "total_costs" do %> | ||
<%= render partial: "shared/total_costs", locals: { total_cost: @total_cost } %> | ||
<% end %> | ||
<%= turbo_stream.update "total_costs", | ||
partial: "shared/total_costs", | ||
locals: { total_cost: @total_cost } | ||
%> | ||
|
||
<%= turbo_stream.replace "salary_budget" do %> | ||
<%= render partial: "budget/salary_budget", | ||
locals: { | ||
income: @salary_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @salary_invest, | ||
savings_amount: @salary_saving, | ||
guilt_free: @guilt_free_salary | ||
} | ||
%> | ||
<% end %> | ||
<%= turbo_stream.update "salary_budget", | ||
partial: "budget/salary_budget", | ||
locals: { | ||
income: @salary_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @salary_invest, | ||
savings_amount: @salary_saving, | ||
guilt_free: @guilt_free_salary } | ||
%> | ||
|
||
<%= turbo_stream.replace "hourly_budget" do %> | ||
<%= render partial: "budget/hourly_budget", | ||
locals: { | ||
income: @hourly_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @hourly_invest, | ||
savings_amount: @hourly_saving, | ||
guilt_free: @guilt_free_hourly | ||
} | ||
%> | ||
<% end %> | ||
<%= turbo_stream.update "hourly_budget", | ||
partial: "budget/hourly_budget", | ||
locals: { | ||
income: @hourly_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @hourly_invest, | ||
savings_amount: @hourly_saving, | ||
guilt_free: @guilt_free_hourly } | ||
%> |
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,11 @@ | ||
<h3>Net Income</h3> | ||
<div class="grid grid-cols-5"> | ||
<% income_headings = ["Income Type", "Rate", "Hours", "Weekly Gross"] %> | ||
<% income_headings.each do |income_heading| %> | ||
<div class="px-5"><strong><%= income_heading %></strong></div> | ||
<% end %> | ||
</div> | ||
<%= turbo_frame_tag :incomes do %> | ||
<h3>Net Income</h3> | ||
<div class="grid grid-cols-5"> | ||
<% income_headings = ["Income Type", "Rate", "Hours", "Weekly Gross"] %> | ||
<% income_headings.each do |income_heading| %> | ||
<div class="px-5"><strong><%= income_heading %></strong></div> | ||
<% end %> | ||
</div> | ||
|
||
<%= render @incomes %> | ||
<%= render @incomes %> | ||
<% 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,34 +1,29 @@ | ||
<%= turbo_stream.update @income %> | ||
|
||
<%= turbo_stream.replace "taxed_incomes" do %> | ||
<%= render partial: "shared/taxed_incomes", | ||
locals: { | ||
salary_taxed: @salary_taxed, | ||
hourly_taxed: @hourly_taxed | ||
} | ||
%> | ||
<% end %> | ||
<%= turbo_stream.update "taxed_incomes", | ||
partial: "shared/taxed_incomes", | ||
locals: { | ||
salary_taxed: @salary_taxed, | ||
hourly_taxed: @hourly_taxed | ||
} | ||
%> | ||
|
||
<%= turbo_stream.replace "salary_budget" do %> | ||
<%= render partial: "budget/salary_budget", | ||
locals: { | ||
income: @salary_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @salary_invest, | ||
savings_amount: @salary_saving, | ||
guilt_free: @guilt_free_salary | ||
} | ||
%> | ||
<% end %> | ||
<%= turbo_stream.update "salary_budget", | ||
partial: "budget/salary_budget", | ||
locals: { | ||
income: @salary_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @salary_invest, | ||
savings_amount: @salary_saving, | ||
guilt_free: @guilt_free_salary } | ||
%> | ||
|
||
<%= turbo_stream.replace "hourly_budget" do %> | ||
<%= render partial: "budget/hourly_budget", | ||
locals: { | ||
income: @hourly_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @hourly_invest, | ||
savings_amount: @hourly_saving, | ||
guilt_free: @guilt_free_hourly | ||
} | ||
%> | ||
<% end %> | ||
<%= turbo_stream.update "hourly_budget", | ||
partial: "budget/hourly_budget", | ||
locals: { | ||
income: @hourly_taxed, | ||
total_cost: @total_cost, | ||
investing_amount: @hourly_invest, | ||
savings_amount: @hourly_saving, | ||
guilt_free: @guilt_free_hourly } | ||
%> |
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,37 +1,39 @@ | ||
<h3>Gross Income Annual</h3> | ||
<div class="grid grid-cols-5"> | ||
<% fixed_headings = ["Income Type", "Federal Tax", "Fica Tax", "State Tax", "Annual"] %> | ||
<% fixed_headings.each do |fixed_heading| %> | ||
<div class="px-5"><strong><%= fixed_heading %></strong></div> | ||
<% end %> | ||
</div> | ||
<%= turbo_frame_tag "taxed_incomes" do %> | ||
<h3>Gross Income Annual</h3> | ||
<div class="grid grid-cols-5"> | ||
<% fixed_headings = ["Income Type", "Federal Tax", "Fica Tax", "State Tax", "Annual"] %> | ||
<% fixed_headings.each do |fixed_heading| %> | ||
<div class="px-5"><strong><%= fixed_heading %></strong></div> | ||
<% end %> | ||
</div> | ||
|
||
<div class="grid grid-cols-5"> | ||
<div class="px-5">Salary</div> | ||
<%= render partial: "shared/taxed_income", locals: { taxed_income: salary_taxed, annual: true } %> | ||
</div> | ||
<div class="grid grid-cols-5"> | ||
<div class="px-5">Salary</div> | ||
<%= render partial: "shared/taxed_income", locals: { taxed_income: salary_taxed, annual: true } %> | ||
</div> | ||
|
||
<div class="grid grid-cols-5"> | ||
<div class="px-5">Hourly</div> | ||
<%= render partial: "shared/taxed_income", locals: { taxed_income: hourly_taxed, annual: true } %> | ||
</div> | ||
<div class="grid grid-cols-5"> | ||
<div class="px-5">Hourly</div> | ||
<%= render partial: "shared/taxed_income", locals: { taxed_income: hourly_taxed, annual: true } %> | ||
</div> | ||
|
||
<br> | ||
<br> | ||
|
||
<h3>Gross Income Bi-Weekly</h3> | ||
<div class="grid grid-cols-5"> | ||
<% fixed_headings = ["Income Type", "Federal Tax", "Fica Tax", "State Tax", "Bi-weekly"] %> | ||
<% fixed_headings.each do |fixed_heading| %> | ||
<div class="px-5"><strong><%= fixed_heading %></strong></div> | ||
<% end %> | ||
</div> | ||
<h3>Gross Income Bi-Weekly</h3> | ||
<div class="grid grid-cols-5"> | ||
<% fixed_headings = ["Income Type", "Federal Tax", "Fica Tax", "State Tax", "Bi-weekly"] %> | ||
<% fixed_headings.each do |fixed_heading| %> | ||
<div class="px-5"><strong><%= fixed_heading %></strong></div> | ||
<% end %> | ||
</div> | ||
|
||
<div class="grid grid-cols-5"> | ||
<div class="px-5">Salary</div> | ||
<%= render partial: "shared/taxed_income", locals: { taxed_income: salary_taxed, annual: false } %> | ||
</div> | ||
<div class="grid grid-cols-5"> | ||
<div class="px-5">Salary</div> | ||
<%= render partial: "shared/taxed_income", locals: { taxed_income: salary_taxed, annual: false } %> | ||
</div> | ||
|
||
<div class="grid grid-cols-5"> | ||
<div class="px-5">Hourly</div> | ||
<%= render partial: "shared/taxed_income", locals: { taxed_income: hourly_taxed, annual: false } %> | ||
</div> | ||
<div class="grid grid-cols-5"> | ||
<div class="px-5">Hourly</div> | ||
<%= render partial: "shared/taxed_income", locals: { taxed_income: hourly_taxed, annual: false } %> | ||
</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