Display tag counts in the filter menu
- Provides a little information scent - Prevents being surprised by "no results"
This commit is contained in:
@@ -13,4 +13,8 @@ class Tag < ApplicationRecord
|
||||
def hashtag
|
||||
"#" + title
|
||||
end
|
||||
|
||||
def cards_count
|
||||
cards.count
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<li class="popup__group flex align-center" data-filter-target="item" data-navigable-list-target="item">
|
||||
<%= icon_tag "tag" %>
|
||||
<%= link_to cards_path(tag_ids: [ tag ]), class: "btn popup__item min-width flex-item-grow" do %>
|
||||
<span class="overflow-ellipsis"><%= tag.title %></span>
|
||||
<span class="overflow-ellipsis"><%= tag.title %> (<%= tag.cards_count %>)</span>
|
||||
<span class="translucent flex-item-no-shrink flex-item-justify-end"> ›</span>
|
||||
<% end %>
|
||||
</li>
|
||||
Reference in New Issue
Block a user