From b91ba6d8efe47d06ad790891182aff409d2879b6 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Thu, 12 Jun 2025 16:46:01 -0500 Subject: [PATCH] Add Fizzy menu to card perma --- app/views/cards/show.html.erb | 5 +-- app/views/cards/show/_collections.html.erb | 48 ++++++++++++++++++++++ app/views/cards/show/_header.html.erb | 43 +++++++++++++++++++ 3 files changed, 92 insertions(+), 4 deletions(-) create mode 100644 app/views/cards/show/_collections.html.erb create mode 100644 app/views/cards/show/_header.html.erb diff --git a/app/views/cards/show.html.erb b/app/views/cards/show.html.erb index f8d83cfb0..4b7cf2f5b 100644 --- a/app/views/cards/show.html.erb +++ b/app/views/cards/show.html.erb @@ -23,10 +23,7 @@ <% end %> - + <%= render "cards/show/header" %> <% end %>
diff --git a/app/views/cards/show/_collections.html.erb b/app/views/cards/show/_collections.html.erb new file mode 100644 index 000000000..581ed1c10 --- /dev/null +++ b/app/views/cards/show/_collections.html.erb @@ -0,0 +1,48 @@ +<%= form_with url: cards_path, method: :get, class: "flex flex-column max-width popup__list full-width", + data: { controller: "form" } do |form| %> + <% if Current.user.collections.one? %> + <%= link_to cards_path, class: "popup__group flex align-center", data: { value: Current.user.collections.first.name.downcase, filter_target: "item", navigable_list_target: "item" } do %> + <%= tag.div class: "btn popup__item min-width flex-item-grow" do %> + <%= Current.user.collections.first.name %> + GO TO + <% end %> + <% end %> + <% elsif Current.user.collections.many? %> + <%= link_to cards_path, class: "popup__group flex align-center", data: { value: "all collections", filter_target: "item", navigable_list_target: "item" } do %> + + <%= tag.div class: "btn popup__item min-width flex-item-grow" do %> + All collections + GO TO + <% end %> + <% end %> + + <% Current.user.collections.order(:name).each do |collection| %> + + <% end %> + <% end %> +<% end %> diff --git a/app/views/cards/show/_header.html.erb b/app/views/cards/show/_header.html.erb new file mode 100644 index 000000000..e0ccbb91b --- /dev/null +++ b/app/views/cards/show/_header.html.erb @@ -0,0 +1,43 @@ + \ No newline at end of file