Skip to content

Commit 56c3751

Browse files
committed
Refactor to show tags more than 5
1 parent 5af742d commit 56c3751

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

app/views/shared/_dojo.html.erb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<%= link_to "#{dojo.name} (#{dojo.prefecture.name})", dojo.url, target: "_blank", rel: "external noopener" %>
77
<% if not dojo.counter == 1 %>
88
<span class="dojo-counter"
9-
data-original-title="道場数"
9+
data-original-title="道場数"
1010
data-placement="bottom"
1111
data-toggle="tooltip"><%= dojo.counter %></span>
1212
<% end %>
@@ -18,14 +18,11 @@
1818
<li><%= tag %></li>
1919
<% end %>
2020

21-
<% if dojo.tags.drop(5).any? %>
22-
<li class="tags-more"
23-
data-toggle="tooltip"
24-
data-placement="bottom"
25-
data-html="true"
26-
title="<%= dojo.tags[5..].join(', ') %>">
27-
...
28-
</li>
21+
<% if dojo.tags.length > 5 %>
22+
<li class="dojo-counter"
23+
data-title="<%= dojo.tags[5..].join(', ') %>"
24+
data-placement="bottom"
25+
data-toggle="tooltip">...</li>
2926
<% end %>
3027
</ul>
3128

0 commit comments

Comments
 (0)