From 00d68a482cbf9dfaa7a2491674b902e50ebed765 Mon Sep 17 00:00:00 2001 From: Andy Smith Date: Tue, 8 Jul 2025 15:30:43 -0500 Subject: [PATCH] Move Add Card button to header --- app/assets/stylesheets/header.css | 25 +++++++++---------- app/views/cards/index.html.erb | 16 +++++++++--- .../index/engagement/_considering.html.erb | 9 ------- app/views/events/index.html.erb | 6 ++--- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/app/assets/stylesheets/header.css b/app/assets/stylesheets/header.css index 0fb0ce6fe..acbb3eb59 100644 --- a/app/assets/stylesheets/header.css +++ b/app/assets/stylesheets/header.css @@ -1,8 +1,9 @@ @layer components { /* Centered title with space for two buttons on either side */ .header { - --header-gap: 0.5rem; - --header-btn-size: 2.65em; + --header-gap: 0.5ch; + --btn-icon-size: 1rem; + --header-btn-size: 2rem; --header-button-count: 0; --header-actions-width: calc((var(--header-btn-size) + var(--header-gap)) * var(--header-button-count)); @@ -18,13 +19,20 @@ .header__actions { display: flex; + font-size: var(--text-x-small); gap: var(--header-gap); inline-size: var(--header-actions-width); min-inline-size: fit-content; } - .header__actions--start { margin-inline-end: auto; } - .header__actions--end { margin-inline-start: auto; } + .header__actions--start { + margin-inline-end: auto; + } + + .header__actions--end { + margin-inline-start: auto; + justify-content: flex-end; + } .header__title { color: inherit; @@ -33,13 +41,4 @@ margin: 0 auto; text-align: center; } - - .header__title--actions { - --btn-size: 2rem; - --btn-icon-size: 1rem; - - display: flex; - align-items: center; - gap: 0.33ch; - } } diff --git a/app/views/cards/index.html.erb b/app/views/cards/index.html.erb index 9c0cb7bac..33665c526 100644 --- a/app/views/cards/index.html.erb +++ b/app/views/cards/index.html.erb @@ -6,9 +6,19 @@ <%= render "cards/index/header", filter: @filter %> <% end %> -
-

+
+
+ <% if collection = @filter.single_collection || Current.user.collections.first %> + <%= button_to collection_cards_path(collection), method: :post, class: "btn btn--link" do %> + <%= icon_tag "add" %> + Add a card + <% end %> + <% end %> +
+

<%= filter_title @filter %> +

+
<% if collection = @filter.single_collection %> <%= access_involvement_advance_button collection, Current.user %> @@ -17,7 +27,7 @@ Settings for <%= collection.name %> <% end %> <% end %> -

+
<%= render "filters/settings", filter: @filter %> diff --git a/app/views/cards/index/engagement/_considering.html.erb b/app/views/cards/index/engagement/_considering.html.erb index 311303b68..fb4a70a25 100644 --- a/app/views/cards/index/engagement/_considering.html.erb +++ b/app/views/cards/index/engagement/_considering.html.erb @@ -3,15 +3,6 @@ Considering - <% if collection = filter.single_collection || Current.user.collections.first %> - <%= button_to collection_cards_path(collection), method: :post, class: "card card--new-card-button btn", form_class: "full-width" do %> -
- <%= icon_tag "add" %> - Add a new card -
- <% end %> - <% end %> - <% if page.used? %> <%= render partial: "cards/display/preview", collection: page.records, as: :card, locals: { draggable: true }, cached: true %> diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index dc9a9a643..76cb128c5 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -9,9 +9,9 @@ <% end %>
-
+
<% if collection = @filter.single_collection || Current.user.collections.first %> - <%= button_to collection_cards_path(collection), method: :post, class: "btn btn--link txt-small" do %> + <%= button_to collection_cards_path(collection), method: :post, class: "btn btn--link" do %> <%= icon_tag "add" %> Add a card <% end %> @@ -37,7 +37,7 @@ <% end %> -
+
<%= render "events/day", day_timeline: @day_timeline %>