From 4e52f9b9a98acbe87eab074065d3c609349feca0 Mon Sep 17 00:00:00 2001 From: "Stanko K.R." Date: Tue, 25 Nov 2025 11:24:21 +0100 Subject: [PATCH] Show tags the card is tagged with first --- app/controllers/cards/taggings_controller.rb | 3 ++- app/views/cards/taggings/_tag.html.erb | 8 ++++++++ app/views/cards/taggings/new.html.erb | 12 ++---------- 3 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 app/views/cards/taggings/_tag.html.erb diff --git a/app/controllers/cards/taggings_controller.rb b/app/controllers/cards/taggings_controller.rb index d388fae22..9190b20f1 100644 --- a/app/controllers/cards/taggings_controller.rb +++ b/app/controllers/cards/taggings_controller.rb @@ -2,7 +2,8 @@ class Cards::TaggingsController < ApplicationController include CardScoped def new - @tags = Current.account.tags.all.alphabetically + @tagged_with = @card.tags.alphabetically + @tags = Current.account.tags.all.alphabetically.where.not(id: @tagged_with) fresh_when etag: [ @tags, @card.tags ] end diff --git a/app/views/cards/taggings/_tag.html.erb b/app/views/cards/taggings/_tag.html.erb new file mode 100644 index 000000000..ad183bdef --- /dev/null +++ b/app/views/cards/taggings/_tag.html.erb @@ -0,0 +1,8 @@ + diff --git a/app/views/cards/taggings/new.html.erb b/app/views/cards/taggings/new.html.erb index e348f531f..644b29d2b 100644 --- a/app/views/cards/taggings/new.html.erb +++ b/app/views/cards/taggings/new.html.erb @@ -18,16 +18,8 @@ <% end %>