diff --git a/app/assets/stylesheets/card-filters.css b/app/assets/stylesheets/card-filters.css index 5f2e3817e..b142c055a 100644 --- a/app/assets/stylesheets/card-filters.css +++ b/app/assets/stylesheets/card-filters.css @@ -2,6 +2,8 @@ .card-filter--collection { > button { --hover-size: 0; + + inline-size: auto; } } diff --git a/app/helpers/filters_helper.rb b/app/helpers/filters_helper.rb index 6fd5554f8..9c29d545d 100644 --- a/app/helpers/filters_helper.rb +++ b/app/helpers/filters_helper.rb @@ -1,7 +1,7 @@ module FiltersHelper def filter_title(filter) if filter.collections.none? - "All collections" + Current.user.collections.one? ? Current.user.collections.first.name : "All collections" elsif filter.collections.one? filter.collections.first.name else diff --git a/app/views/cards/index/_collections_filter.html.erb b/app/views/cards/index/_collections_filter.html.erb index 8b07eab87..86c4592ee 100644 --- a/app/views/cards/index/_collections_filter.html.erb +++ b/app/views/cards/index/_collections_filter.html.erb @@ -4,40 +4,49 @@ <%= filter_hidden_field_tag key, value %> <% end %> - <%= link_to cards_path(filter.as_params.except(:collection_ids)), class: "popup__group flex align-center", style: "--hover-size: 0" do %> -
- > - - - See everything in all collections - - <%= icon_tag "check", size: 18, class: "checked" %> -
- <%= tag.div class: "btn popup__item min-width flex-item-grow" do %> - All collections - GO TO + <% if Current.user.collections.one? %> + <%= link_to cards_path(filter.as_params.except(:collection_ids)), class: "popup__group flex align-center", style: "--hover-size: 0" do %> + <%= tag.div class: "btn popup__item min-width flex-item-grow" do %> + <%= Current.user.collections.first.name %> + GO TO + <% end %> <% end %> - <% end %> - - <% Current.user.collections.order(:name).each do |collection| %> - + <% end %> + + <% Current.user.collections.order(:name).each do |collection| %> + + <% end %> <% end %> <% end %> diff --git a/app/views/cards/index/_header.html.erb b/app/views/cards/index/_header.html.erb index 218554519..7ec915b4d 100644 --- a/app/views/cards/index/_header.html.erb +++ b/app/views/cards/index/_header.html.erb @@ -24,15 +24,13 @@ filter_active_class: "filter--active", filter_selected_class: "selected" } do %>
- - <%= icon_tag "filter" %> - Collections
+ <%= render "events/filter/new_collection_option" %> <% if Current.user.collections.count > 15 %> <% end %> diff --git a/app/views/events/_filter.html.erb b/app/views/events/_filter.html.erb index d4b0fad0e..9f46f826f 100644 --- a/app/views/events/_filter.html.erb +++ b/app/views/events/_filter.html.erb @@ -26,9 +26,12 @@ <%= form_with url: events_path, method: :get, class: "flex flex-column max-width popup__list full-width", data: { controller: "form" } do |form| %> <%= render "events/filter/all_collections_option", form: form, filter: filter %> - - <%= render partial: "events/filter/collection_option", collection: Current.user.collections.alphabetically, as: :collection, locals: { form: form, filter: filter } %> - + + <% if Current.user.collections.many? %> + + <%= render partial: "events/filter/collection_option", collection: Current.user.collections.alphabetically, as: :collection, locals: { form: form, filter: filter } %> + + <% end %> <% end %>

diff --git a/app/views/events/filter/_all_collections_option.html.erb b/app/views/events/filter/_all_collections_option.html.erb index 27857fb1f..24ab518df 100644 --- a/app/views/events/filter/_all_collections_option.html.erb +++ b/app/views/events/filter/_all_collections_option.html.erb @@ -1,17 +1,26 @@ -

+<% end %> \ No newline at end of file diff --git a/app/views/events/filter/_new_collection_option.html.erb b/app/views/events/filter/_new_collection_option.html.erb index 71914e7df..7ead8d946 100644 --- a/app/views/events/filter/_new_collection_option.html.erb +++ b/app/views/events/filter/_new_collection_option.html.erb @@ -2,6 +2,6 @@ <%= link_to new_collection_path, class: "btn popup__new popup__item", style: "view-transition-name: new-collection" do %> <%= icon_tag "add" %> Add a new collection -
<% end %> +