diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css index 3f7b012..e87cf44 100644 --- a/app/assets/stylesheets/application.tailwind.css +++ b/app/assets/stylesheets/application.tailwind.css @@ -41,6 +41,27 @@ border-radius: 0.5rem; color: #2b2b2b; } + + .active-toolbar-tab { + background-color: white; + display: inline-block; + padding: 16px; + color: rgb(107 33 168); + border-top-left-radius: 0.5rem; + border-top-right-radius: 0.5rem; + } + + .inactive-toolbar-tab { + display: inline-block; + padding: 16px; + border-top-left-radius: 0.5rem; + border-top-right-radius: 0.5rem; + } + + .inactive-toolbar-tab:hover { + color: rgb(75 85 99); + background-color: rgb(249 250 251); + } } diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 189a80d..295b4ff 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -4,6 +4,10 @@ class DashboardController < ApplicationController def index build_dashboard_variables! + respond_to do |format| + format.turbo_stream + format.html + end end def switch_taxable_income diff --git a/app/views/components/_toolbar.html.erb b/app/views/components/_toolbar.html.erb index 01c0b14..c0d842d 100644 --- a/app/views/components/_toolbar.html.erb +++ b/app/views/components/_toolbar.html.erb @@ -1,17 +1,19 @@ - +<%= turbo_frame_tag "dashboard_toolbar" do %> + +<% end %> diff --git a/app/views/dashboard/_index.html.erb b/app/views/dashboard/_index.html.erb index 0a3998f..dd6f393 100644 --- a/app/views/dashboard/_index.html.erb +++ b/app/views/dashboard/_index.html.erb @@ -1,11 +1,5 @@ <%= turbo_frame_tag "primary_frame" do %>
-
-
- <%= render partial: "components/toolbar" %> -
-
-
@@ -95,5 +89,5 @@ <%= render partial: "shared/total_costs", locals: { total_cost: @total_cost } %>
-
-<% end %> + <% end %> +
diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb index 5ff9740..a2a1e0c 100644 --- a/app/views/dashboard/index.html.erb +++ b/app/views/dashboard/index.html.erb @@ -1 +1,2 @@ +<%= render partial: "components/toolbar", locals: { active_tab: :budget_calculator } %> <%= render partial: "dashboard/index" %> diff --git a/app/views/dashboard/index.turbo_stream.erb b/app/views/dashboard/index.turbo_stream.erb new file mode 100644 index 0000000..5a27425 --- /dev/null +++ b/app/views/dashboard/index.turbo_stream.erb @@ -0,0 +1,2 @@ +<%= turbo_stream.replace "primary_frame", partial: "dashboard/index" %> +<%= turbo_stream.replace "dashboard_toolbar", partial: "components/toolbar", locals: { active_tab: :budget_calculator } %> \ No newline at end of file diff --git a/app/views/federal_tax_brackets/_index.html.erb b/app/views/federal_tax_brackets/_index.html.erb index b21ab8c..7d0fdce 100644 --- a/app/views/federal_tax_brackets/_index.html.erb +++ b/app/views/federal_tax_brackets/_index.html.erb @@ -1,17 +1,30 @@ -<%= turbo_frame_tag :federal_tax_brackets do %> -
-
-
- <% tax_headings = ["Filing Status", "Tier", "From", "To", "Rate", "Cumulative"] %> - <% tax_headings.each do |tax_heading| %> -
- <%= tax_heading %> +<%= turbo_frame_tag "primary_frame" do %> + <%= turbo_frame_tag :federal_tax_brackets do %> +
+
+
+
+

Federal Tax Brackets

+ <%= link_to 'New federal tax bracket', new_federal_tax_bracket_path, class: "rounded-lg py-2 px-5 bg-blue-600 text-white block font-medium" %>
- <% end %> -
+
- <%= render @federal_tax_brackets %> +
+
+
+ <% tax_headings = ["Filing Status", "Tier", "From", "To", "Rate", "Cumulative"] %> + <% tax_headings.each do |tax_heading| %> +
+ <%= tax_heading %> +
+ <% end %> +
+
+ + <%= render @federal_tax_brackets %> +
+
-
+ <% end %> <% end %> diff --git a/app/views/federal_tax_brackets/index.html.erb b/app/views/federal_tax_brackets/index.html.erb index 3b6f7f7..8c292dc 100644 --- a/app/views/federal_tax_brackets/index.html.erb +++ b/app/views/federal_tax_brackets/index.html.erb @@ -3,12 +3,5 @@

<%= notice %>

<% end %> -
-
-

Federal Tax Brackets

- <%= link_to 'New federal tax bracket', new_federal_tax_bracket_path, class: "rounded-lg py-2 px-5 bg-blue-600 text-white block font-medium" %> -
-
- <%= render partial: "federal_tax_brackets/index" %>
diff --git a/app/views/federal_tax_brackets/index.turbo_stream.erb b/app/views/federal_tax_brackets/index.turbo_stream.erb index 5eb6353..821b797 100644 --- a/app/views/federal_tax_brackets/index.turbo_stream.erb +++ b/app/views/federal_tax_brackets/index.turbo_stream.erb @@ -1 +1,2 @@ -<%= turbo_stream.replace "primary_frame", partial: "federal_tax_brackets/index" %> \ No newline at end of file +<%= turbo_stream.replace "primary_frame", partial: "federal_tax_brackets/index" %> +<%= turbo_stream.replace "dashboard_toolbar", partial: "components/toolbar", locals: { active_tab: :federal_tax_brackets } %> \ No newline at end of file