diff --git a/app/views/events/_filter.html.erb b/app/views/events/_filter.html.erb index 6abe2244d..ab5488fd4 100644 --- a/app/views/events/_filter.html.erb +++ b/app/views/events/_filter.html.erb @@ -29,43 +29,8 @@ <%= form_with url: events_path, method: :get, class: "flex flex-column max-width popup__list full-width", data: { controller: "form" } do |form| %> - <%= link_to events_path(clear_filter: true), 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 - <% end %> - - <% end %> - - <% Current.user.collections.each do |collection| %> - - <% end %> + <%= render "events/filter/all_collections_option", form: form, filter: filter %> + <%= render partial: "events/filter/collection_option", collection: Current.user.collections, as: :collection, locals: { form: form, filter: filter } %> <% end %> diff --git a/app/views/events/filter/_all_collections_option.html.erb b/app/views/events/filter/_all_collections_option.html.erb new file mode 100644 index 000000000..0e4b567dd --- /dev/null +++ b/app/views/events/filter/_all_collections_option.html.erb @@ -0,0 +1,15 @@ +<%= link_to events_path(clear_filter: true), class: "popup__group flex align-center", style: "--hover-size: 0" do %> +
+ <%= check_box_tag "filter_collections", nil, filter.collections.blank?, class: "form-checkbox" %> + + + 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 + <% end %> + +<% end %> diff --git a/app/views/events/filter/_collection_option.html.erb b/app/views/events/filter/_collection_option.html.erb new file mode 100644 index 000000000..c0953abc6 --- /dev/null +++ b/app/views/events/filter/_collection_option.html.erb @@ -0,0 +1,20 @@ +