From a41ee80e917ed4a2eaaea313ec6d8db62a02ec2b Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Fri, 4 Apr 2025 17:27:36 +0200 Subject: [PATCH] Remove duplication for tags --- app/views/bubbles/cards/mini/_tags.html.erb | 23 +------------------ .../bubbles/cards/preview/_tags.html.erb | 16 ++++++------- 2 files changed, 8 insertions(+), 31 deletions(-) diff --git a/app/views/bubbles/cards/mini/_tags.html.erb b/app/views/bubbles/cards/mini/_tags.html.erb index 41bfb947e..b68e98529 100644 --- a/app/views/bubbles/cards/mini/_tags.html.erb +++ b/app/views/bubbles/cards/mini/_tags.html.erb @@ -1,22 +1 @@ -<%= turbo_frame_tag bubble, :tags do %> -
-
- <% if bubble.tags.any? || bubble.creating? %> - # - <% bubble.tags.each_with_index do |tag, index| %> - <%= link_to bubbles_path(bucket_ids: [ bubble.bucket ], tag_ids: [ tag.id ]), - class: "card__tag btn btn--plain min-width txt-uppercase fill-transparent", data: { turbo_frame: "_top" } do %> - <%= tag.title %> - <% end %><%= ", " unless index == bubble.tags.size - 1 %> - <% end %> - <% end %> -
- -
- -
-
-<% end %> +<%= render "bubbles/cards/preview/tags", bubble: bubble %> diff --git a/app/views/bubbles/cards/preview/_tags.html.erb b/app/views/bubbles/cards/preview/_tags.html.erb index c3493e658..66de991bc 100644 --- a/app/views/bubbles/cards/preview/_tags.html.erb +++ b/app/views/bubbles/cards/preview/_tags.html.erb @@ -1,14 +1,12 @@ -<%= turbo_frame_tag bubble, :tags do %> -
-
- <% if bubble.tags.any? || bubble.creating? %> - # - <% bubble.tags.each_with_index do |tag, index| %> +
+
+ <% if bubble.tags.any? %> + # + <% bubble.tags.each_with_index do |tag, index| %> <%= tag.title %> - <% end %> + <% end %> <% end %> -
-<% end %> +