|
1 | 1 | <% user = user || @user # allow overriding w/ local variable %>
|
2 |
| -<style> |
3 |
| - .popover { |
4 |
| - max-width: 300px |
5 |
| - } |
6 |
| -</style> |
7 |
| -
|
8 | 2 | <div class="tags-list">
|
9 | 3 | <% tags.each_with_index do |tag, i| %>
|
10 |
| - <% if tag.try(:author) && !tag.try(:author).banned? %> |
11 |
| - <% if tag.class == NodeTag %> |
| 4 | + <% if tag.class == NodeTag %> |
12 | 5 |
|
13 |
| - <% if !power_tag && i < 2 # just the first 2 get special display, power tags excluded %> |
14 |
| - <%= render partial: 'tag/miniCard', locals: { tag: tag } %> |
15 |
| - <% else %> |
| 6 | + <% if !power_tag && i < 2 # just the first 2 get special display, power tags excluded %> |
| 7 | + <%= render partial: 'tag/miniCard', locals: { tag: tag } %> |
| 8 | + <% else %> |
16 | 9 |
|
17 |
| - <% if i == 2 && !power_tag %> |
18 |
| - <a class="show-more-tags" href="javascript:void(0);"><p style="float:left; color:#666; margin-top:14px; margin-left:5px;"><u><%= tags.length - 2 %> more</u>   </p></a> |
19 |
| - <% end %> |
20 |
| -
|
21 |
| - <%= render partial: 'tag/miniCard', locals: { tag: tag, grey: power_tag } %> |
| 10 | + <% if i == 2 && !power_tag %> |
| 11 | + <a class="show-more-tags" href="javascript:void(0);"><p style="float:left; color:#666; margin-top:14px; margin-left:5px;"><u><%= tags.length - 2 %> more</u>   </p></a> |
| 12 | + <% end %> |
22 | 13 |
|
| 14 | + <% if (tag.name.include? ':') && i == 0 %> |
| 15 | + <p style="margin-top:14px;"><%= render partial: 'tag/miniCard', locals: { tag: tag, grey: power_tag } %></p> |
| 16 | + |
| 17 | + <% else %> |
| 18 | + <p class="badge <%= badge_name %> pop more-tags" style="display:none;cursor:pointer;margin-bottom:3px;" id="tag_<%= tag.tid %>" data-toggle="popover" data-trigger="focus" data-count=0 data-placement="top" data-content="<p style='text-align:center;'><a href='/tag/<%= tag.name %>'><%= Tag.tagged_node_count(tag.name) || 0 %> notes</a> - <a href='/contributors/<%= tag.name %>'><%= Tag.contributors(tag.name).count %> people <br></a></p> <p style='text-align:center;font-size:12px;'><%if tag.description %><%= tag.description %> |<% end %> created by <a href='/profile/<%= tag.try(:author).try(:username) %>'><%= tag.try(:author).try(:username) %></a> <%= time_ago_in_words(Time.at(tag.date)) %> ago </p><div class='text-center'><a href='/subscribe/tag/<%= tag.name %>' class='btn btn-primary'>Follow</a></div>" data-html="true" title="<%= tag.name %>"> |
| 19 | + <a class='tag-name' href='/tag/<%= tag.name %>'><%= tag.name %></a> |
| 20 | + <% if logged_in_as(['admin', 'moderator']) || (current_user && ( current_user.uid == @node.uid || current_user.uid == tag.uid)) %> |
| 21 | + <% if tag.name.include? ':' %> |
| 22 | + <a aria-label="Delete tag" data-confirm="This is a power tag (see https://publiclab.org/wiki/power-tags) -- and may drive a specific function on this page. Are you sure you want to delete it?" class="tag-delete" data-remote="true" href="/tag/delete/<%= @node.id %>/<%= tag.tid %>" data-tag-id="<%= tag.tid %>" data-method="delete"><i class='fa fa-times-circle fa-white blue pl-1' aria-hidden='true' ></i></a> |
| 23 | + <% else %> |
| 24 | + <a data-confirm="Are you sure you want to delete it?" class="tag-delete" data-remote="true" href="/tag/delete/<%= @node.id %>/<%= tag.tid %>" data-tag-id="<%= tag.tid %>" data-method="delete"><i class='fa fa-times-circle fa-white blue pl-1' aria-hidden='true' ></i></a> |
| 25 | + <% end %> |
| 26 | + <% end %> |
| 27 | + </p> |
23 | 28 | <% end %>
|
24 | 29 |
|
25 |
| - <% elsif tag.class == UserTag && (tag.name[0..4] != "oauth" || (logged_in_as(['admin', 'moderator']) || (current_user && current_user.uid == tag.uid))) %> |
| 30 | + <% end %> |
26 | 31 |
|
27 |
| - <li style="width: 100%;"> |
28 |
| - <span id="tag_<%= tag.id %>" class="badge <%= badge_name %> pop" style="cursor:pointer" data-toggle="popover" data-trigger="manual" data-count=0 data-placement="top" data-content="<a href='/contributors/<%= tag.name %>'><%= Tag.tagged_node_count(tag.name) || 0 %> notes - <%= Tag.contributors(tag.name).count %> people <br></a>" data-html="true" title="<%= tag.name %>"> |
29 |
| - <a class='tag-name' href='/tag/<%= tag.name %>'> |
30 |
| - <% if tag.name[0..4] != "oauth" %> |
31 |
| - <%= tag.name %> |
32 |
| - <% else %> |
33 |
| - <%= tag.name[0..5] + tag.name.split(':')[1] %> |
34 |
| - <% end %> |
35 |
| - </a> |
36 |
| - <% if logged_in_as(['admin', 'moderator']) || (current_user && current_user.uid == tag.uid) %> |
37 |
| - <a aria-label="Delete tag" data-confirm="Are you sure you want to delete it?" class="tag-delete" data-remote="true" href="/profile/tags/delete/<%= user.id %>?name=<%= tag.name %>" data-method="delete"><i class='fa fa-times-circle fa-white blue pl-1' aria-hidden='true' ></i></a> |
| 32 | + <% elsif tag.class == UserTag && (tag.name[0..4] != "oauth" || (logged_in_as(['admin', 'moderator']) || (current_user && current_user.uid == tag.uid))) %> |
| 33 | +
|
| 34 | + <li style="width: 100%;"> |
| 35 | + <span id="tag_<%= tag.id %>" class="badge <%= badge_name %> pop" style="cursor:pointer" data-toggle="popover" data-trigger="manual" data-count=0 data-placement="top" data-content="<a href='/contributors/<%= tag.name %>'><%= Tag.tagged_node_count(tag.name) || 0 %> notes - <%= Tag.contributors(tag.name).count %> people <br></a>" data-html="true" title="<%= tag.name %>"> |
| 36 | + <a class='tag-name' href='/tag/<%= tag.name %>'> |
| 37 | + <% if tag.name[0..4] != "oauth" %> |
| 38 | + <%= tag.name %> |
| 39 | + <% else %> |
| 40 | + <%= tag.name[0..5] + tag.name.split(':')[1] %> |
38 | 41 | <% end %>
|
39 |
| - </span> |
40 |
| - </li> |
| 42 | + </a> |
| 43 | + <% if logged_in_as(['admin', 'moderator']) || (current_user && current_user.uid == tag.uid) %> |
| 44 | + <a aria-label="Delete tag" data-confirm="Are you sure you want to delete it?" class="tag-delete" data-remote="true" href="/profile/tags/delete/<%= user.id %>?name=<%= tag.name %>" data-method="delete"><i class='fa fa-times-circle fa-white blue pl-1' aria-hidden='true' ></i></a> |
| 45 | + <% end %> |
| 46 | + </span> |
| 47 | + </li> |
41 | 48 |
|
42 |
| - <% end %> |
43 | 49 | <% end %>
|
44 | 50 | <% end %>
|
45 | 51 | <script type="text/javascript">
|
|
0 commit comments