From 3ec8649166de38c88fa9590c2e1ed696ee5715d4 Mon Sep 17 00:00:00 2001 From: hatz Date: Wed, 14 May 2025 06:48:56 -0500 Subject: [PATCH] Use shared ruler for all the places a ruler is used --- .../maybe-design-system/background-utils.css | 8 -------- .../maybe-design-system/border-utils.css | 6 +++++- app/components/menu_item_component.html.erb | 2 +- .../accounts/_accountable_group.html.erb | 8 +++----- app/views/budgets/_budget_categories.html.erb | 4 +--- .../categories/_category_list_group.html.erb | 2 +- app/views/categories/_ruler.html.erb | 3 --- app/views/category/dropdowns/show.html.erb | 2 +- app/views/credit_cards/_form.html.erb | 2 +- app/views/entries/_ruler.html.erb | 1 - app/views/family_merchants/_ruler.html.erb | 3 --- app/views/family_merchants/index.html.erb | 2 +- app/views/holdings/_ruler.html.erb | 1 - app/views/holdings/index.html.erb | 5 ++--- app/views/imports/_ready.html.erb | 4 ++-- app/views/imports/new.html.erb | 20 +++++-------------- app/views/loans/_form.html.erb | 2 +- app/views/properties/_form.html.erb | 2 +- app/views/settings/_settings_nav.html.erb | 2 +- app/views/shared/_ruler.html.erb | 4 ++-- app/views/tags/_ruler.html.erb | 3 --- app/views/tags/index.html.erb | 2 +- app/views/transfers/show.html.erb | 2 +- app/views/valuations/index.html.erb | 2 +- app/views/vehicles/_form.html.erb | 2 +- 25 files changed, 32 insertions(+), 62 deletions(-) delete mode 100644 app/views/categories/_ruler.html.erb delete mode 100644 app/views/entries/_ruler.html.erb delete mode 100644 app/views/family_merchants/_ruler.html.erb delete mode 100644 app/views/holdings/_ruler.html.erb delete mode 100644 app/views/tags/_ruler.html.erb diff --git a/app/assets/tailwind/maybe-design-system/background-utils.css b/app/assets/tailwind/maybe-design-system/background-utils.css index fd5f673f..0e4b85b8 100644 --- a/app/assets/tailwind/maybe-design-system/background-utils.css +++ b/app/assets/tailwind/maybe-design-system/background-utils.css @@ -78,14 +78,6 @@ } } -@utility bg-divider { - @apply bg-alpha-black-100; - - @variant theme-dark { - @apply bg-alpha-white-100; - } -} - @utility bg-overlay { background-color: --alpha(var(--color-gray-100) / 50%); diff --git a/app/assets/tailwind/maybe-design-system/border-utils.css b/app/assets/tailwind/maybe-design-system/border-utils.css index 94c54a55..8fcc1c9c 100644 --- a/app/assets/tailwind/maybe-design-system/border-utils.css +++ b/app/assets/tailwind/maybe-design-system/border-utils.css @@ -63,6 +63,10 @@ } } +@utility border-divider { + @apply border-tertiary; +} + @utility border-subdued { @apply border-alpha-black-50; @@ -85,4 +89,4 @@ @variant theme-dark { @apply border-red-400; } -} \ No newline at end of file +} diff --git a/app/components/menu_item_component.html.erb b/app/components/menu_item_component.html.erb index 273c4551..cb71dc6d 100644 --- a/app/components/menu_item_component.html.erb +++ b/app/components/menu_item_component.html.erb @@ -1,5 +1,5 @@ <% if variant == :divider %> -
+ <%= render "shared/ruler", classes: "my-1" %> <% else %>
<%= wrapper do %> diff --git a/app/views/accounts/_accountable_group.html.erb b/app/views/accounts/_accountable_group.html.erb index a1ab2e3a..e77dc533 100644 --- a/app/views/accounts/_accountable_group.html.erb +++ b/app/views/accounts/_accountable_group.html.erb @@ -6,8 +6,8 @@ <%= tag.p format_money(account_group.total_money), class: "text-sm font-medium text-primary" %> <%= turbo_frame_tag "#{account_group.key}_sparkline", src: accountable_sparkline_path(account_group.key), loading: "lazy" do %> -
-
+
+ <%= render "shared/ruler", classes: "w-full" %>
<% end %>
@@ -33,9 +33,7 @@ <%= tag.p format_money(account.balance_money), class: "text-sm font-medium text-primary whitespace-nowrap" %> <%= turbo_frame_tag dom_id(account, :sparkline), src: sparkline_account_path(account), loading: "lazy" do %> -
-
-
+ <%= render "shared/ruler", classes: "w-6" %> <% end %>
<% end %> diff --git a/app/views/budgets/_budget_categories.html.erb b/app/views/budgets/_budget_categories.html.erb index 5b9e1a1c..99437302 100644 --- a/app/views/budgets/_budget_categories.html.erb +++ b/app/views/budgets/_budget_categories.html.erb @@ -34,9 +34,7 @@ -
-
-
+ <%= render "shared/ruler" %> <% end %> <%= render "budget_categories/budget_category", budget_category: budget.uncategorized_budget_category %> diff --git a/app/views/categories/_category_list_group.html.erb b/app/views/categories/_category_list_group.html.erb index dc343d7f..e7337e45 100644 --- a/app/views/categories/_category_list_group.html.erb +++ b/app/views/categories/_category_list_group.html.erb @@ -17,7 +17,7 @@ <% end %> <% unless idx == Category::Group.for(categories).count - 1 %> - <%= render "categories/ruler" %> + <%= render "shared/ruler" %> <% end %> <% end %> diff --git a/app/views/categories/_ruler.html.erb b/app/views/categories/_ruler.html.erb deleted file mode 100644 index 600fcda1..00000000 --- a/app/views/categories/_ruler.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -
-
-
diff --git a/app/views/category/dropdowns/show.html.erb b/app/views/category/dropdowns/show.html.erb index 65b5c9be..e321e167 100644 --- a/app/views/category/dropdowns/show.html.erb +++ b/app/views/category/dropdowns/show.html.erb @@ -40,7 +40,7 @@ <% end %> -
+ <%= render "shared/ruler", classes: "my-2" %>
<% if @transaction.category %> diff --git a/app/views/credit_cards/_form.html.erb b/app/views/credit_cards/_form.html.erb index 2405b77b..ef3d5d3d 100644 --- a/app/views/credit_cards/_form.html.erb +++ b/app/views/credit_cards/_form.html.erb @@ -1,7 +1,7 @@ <%# locals: (account:, url:) %> <%= render "accounts/form", account: account, url: url do |form| %> -
+ <%= render "shared/ruler", classes: "my-4" %>
<%= form.fields_for :accountable do |credit_card_form| %> diff --git a/app/views/entries/_ruler.html.erb b/app/views/entries/_ruler.html.erb deleted file mode 100644 index 31c6ee6c..00000000 --- a/app/views/entries/_ruler.html.erb +++ /dev/null @@ -1 +0,0 @@ -
diff --git a/app/views/family_merchants/_ruler.html.erb b/app/views/family_merchants/_ruler.html.erb deleted file mode 100644 index 530d99eb..00000000 --- a/app/views/family_merchants/_ruler.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -
-
-
diff --git a/app/views/family_merchants/index.html.erb b/app/views/family_merchants/index.html.erb index 944b4bb9..e54fc02c 100644 --- a/app/views/family_merchants/index.html.erb +++ b/app/views/family_merchants/index.html.erb @@ -20,7 +20,7 @@
- <%= render partial: "family_merchants/family_merchant", collection: @merchants, spacer_template: "family_merchants/ruler" %> + <%= render partial: "family_merchants/family_merchant", collection: @merchants, spacer_template: "shared/ruler" %>
diff --git a/app/views/holdings/_ruler.html.erb b/app/views/holdings/_ruler.html.erb deleted file mode 100644 index 31c6ee6c..00000000 --- a/app/views/holdings/_ruler.html.erb +++ /dev/null @@ -1 +0,0 @@ -
diff --git a/app/views/holdings/index.html.erb b/app/views/holdings/index.html.erb index 2fcd0714..fe098f8b 100644 --- a/app/views/holdings/index.html.erb +++ b/app/views/holdings/index.html.erb @@ -24,11 +24,10 @@
<%= render "holdings/cash", account: @account %> - - <%= render "holdings/ruler" %> + <%= render "shared/ruler" %> <% if @account.current_holdings.any? %> - <%= render partial: "holdings/holding", collection: @account.current_holdings, spacer_template: "ruler" %> + <%= render partial: "holdings/holding", collection: @account.current_holdings, spacer_template: "shared/ruler" %> <% end %>
diff --git a/app/views/imports/_ready.html.erb b/app/views/imports/_ready.html.erb index 225c0dd1..d093694f 100644 --- a/app/views/imports/_ready.html.erb +++ b/app/views/imports/_ready.html.erb @@ -16,7 +16,7 @@ <% import.dry_run.each do |key, count| %> <% resource = dry_run_resource(key) %> -
+
<%= tag.div class: class_names(resource.bg_class, resource.text_class, "w-8 h-8 rounded-full flex justify-center items-center") do %> <%= icon resource.icon, color: "current" %> @@ -29,7 +29,7 @@
<% if key != import.dry_run.keys.last %> -
+ <%= render "shared/ruler" %> <% end %> <% end %>
diff --git a/app/views/imports/new.html.erb b/app/views/imports/new.html.erb index ac739056..a1fcbe0c 100644 --- a/app/views/imports/new.html.erb +++ b/app/views/imports/new.html.erb @@ -21,9 +21,7 @@ <%= icon("chevron-right") %> <% end %> -
-
-
+ <%= render "shared/ruler" %> <% end %> @@ -43,9 +41,7 @@ <%= icon("chevron-right") %> <% end %> -
-
-
+ <%= render "shared/ruler" %> <% end %> @@ -65,9 +61,7 @@ <%= icon("chevron-right") %> <% end %> -
-
-
+ <%= render "shared/ruler" %> <% end %> @@ -87,9 +81,7 @@ <%= icon("chevron-right") %> <% end %> -
-
-
+ <%= render "shared/ruler" %> <% end %> @@ -105,9 +97,7 @@ <%= icon("chevron-right") %> <% end %> -
-
-
+ <%= render "shared/ruler" %> <% end %> diff --git a/app/views/loans/_form.html.erb b/app/views/loans/_form.html.erb index 6af5715f..48d7a0ce 100644 --- a/app/views/loans/_form.html.erb +++ b/app/views/loans/_form.html.erb @@ -1,7 +1,7 @@ <%# locals: (account:, url:) %> <%= render "accounts/form", account: account, url: url do |form| %> -
+ <%= render "shared/ruler", classes: "my-4" %>
<%= form.fields_for :accountable do |loan_form| %> diff --git a/app/views/properties/_form.html.erb b/app/views/properties/_form.html.erb index 61b6cb59..ea7b7ae0 100644 --- a/app/views/properties/_form.html.erb +++ b/app/views/properties/_form.html.erb @@ -5,7 +5,7 @@ Property::SUBTYPES.map { |k, v| [v[:long], k] }, { label: true, prompt: t("properties.form.subtype_prompt"), include_blank: t("properties.form.none") } %> -
+ <%= render "shared/ruler", classes: "my-4" %>
<%= form.fields_for :accountable do |property_form| %> diff --git a/app/views/settings/_settings_nav.html.erb b/app/views/settings/_settings_nav.html.erb index 6a80bb87..acd82489 100644 --- a/app/views/settings/_settings_nav.html.erb +++ b/app/views/settings/_settings_nav.html.erb @@ -48,7 +48,7 @@ nav_sections = [

<%= section[:header] %>

-
+ <%= render "shared/ruler", classes: "w-full" %>
    <% section[:items].each do |item| %> diff --git a/app/views/shared/_ruler.html.erb b/app/views/shared/_ruler.html.erb index 6003fd1c..fa963914 100644 --- a/app/views/shared/_ruler.html.erb +++ b/app/views/shared/_ruler.html.erb @@ -1,2 +1,2 @@ -<%# locals: (margins: nil) %> -
    +<%# locals: (classes: nil) %> +
    diff --git a/app/views/tags/_ruler.html.erb b/app/views/tags/_ruler.html.erb deleted file mode 100644 index 600fcda1..00000000 --- a/app/views/tags/_ruler.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -
    -
    -
    diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index 24bc2d10..cc4a8459 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -35,7 +35,7 @@
    - <%= render partial: @tags, spacer_template: "tags/ruler" %> + <%= render partial: @tags, spacer_template: "shared/ruler" %>
diff --git a/app/views/transfers/show.html.erb b/app/views/transfers/show.html.erb index 42b05219..dc587a4e 100644 --- a/app/views/transfers/show.html.erb +++ b/app/views/transfers/show.html.erb @@ -44,7 +44,7 @@
-
+ <%= render "shared/ruler", classes: "my-2" %>
diff --git a/app/views/valuations/index.html.erb b/app/views/valuations/index.html.erb index aa20b548..427714e3 100644 --- a/app/views/valuations/index.html.erb +++ b/app/views/valuations/index.html.erb @@ -27,7 +27,7 @@ <%= render partial: "valuations/valuation", collection: @entries, as: :entry, - spacer_template: "entries/ruler" %> + spacer_template: "shared/ruler" %> <% else %>

<%= t(".no_valuations") %>

<% end %> diff --git a/app/views/vehicles/_form.html.erb b/app/views/vehicles/_form.html.erb index 97dd7944..a77d88b7 100644 --- a/app/views/vehicles/_form.html.erb +++ b/app/views/vehicles/_form.html.erb @@ -1,7 +1,7 @@ <%# locals: (account:, url:) %> <%= render "accounts/form", account: account, url: url do |form| %> -
+ <%= render "shared/ruler", classes: "my-4" %>
<%= form.fields_for :accountable do |vehicle_form| %>