Remove duplication for tags
This commit is contained in:
@@ -1,22 +1 @@
|
||||
<%= turbo_frame_tag bubble, :tags do %>
|
||||
<div class="card__tags flex align-center flex-item-grow min-width">
|
||||
<div class="overflow-ellipsis">
|
||||
<% if bubble.tags.any? || bubble.creating? %>
|
||||
<span># </span>
|
||||
<% 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 %>
|
||||
<span class="overflow-ellipsis"><%= tag.title %></span>
|
||||
<% end %><%= ", " unless index == bubble.tags.size - 1 %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="position-relative" data-controller="dialog" data-action="keydown.esc->dialog#close click@document->dialog#closeOnClickOutside">
|
||||
<button class="tag-picker__button btn card__hide-on-index <%= bubble.creating? || bubble.drafted? ? "fill-highlight" : "fill-transparent" %>" data-action="click->dialog#open:stop">
|
||||
<%= icon_tag "tag" %>
|
||||
<span class="for-screen-reader">Add a tag</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= render "bubbles/cards/preview/tags", bubble: bubble %>
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
<%= turbo_frame_tag bubble, :tags do %>
|
||||
<div class="card__tags flex align-center flex-item-grow min-width">
|
||||
<div class="overflow-ellipsis">
|
||||
<% if bubble.tags.any? || bubble.creating? %>
|
||||
<span># </span>
|
||||
<% bubble.tags.each_with_index do |tag, index| %>
|
||||
<div class="card__tags flex align-center flex-item-grow min-width">
|
||||
<div class="overflow-ellipsis">
|
||||
<% if bubble.tags.any? %>
|
||||
<span># </span>
|
||||
<% bubble.tags.each_with_index do |tag, index| %>
|
||||
<span class="card__tag btn btn--plain min-width txt-uppercase fill-transparent overflow-ellipsis">
|
||||
<%= tag.title %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user