Skip to content

Commit 7984fc9

Browse files
authored
Update _user_controls.html.erb with more menu items on /tag/____ card menus (#8399)
* Update _user_controls.html.erb * Update show.html.erb * Update _user_controls.html.erb
1 parent bd81b6f commit 7984fc9

File tree

2 files changed

+39
-19
lines changed

2 files changed

+39
-19
lines changed

app/views/tag/show.html.erb

+8-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
<div class="tag-buttons">
112112
<div class="btn-group" role="group">
113113
<% if current_user && current_user.following(params[:id]) %>
114-
<a rel="tooltip" title="<%= translation('sidebar._post_button.share_your_work') %>" data-placement="bottom" href="/post?tags=<%= @title %>" class="btn btn-primary requireLogin">New post <i class="fa fa-plus fa-white"></i></a>
114+
<a data-toggle="tooltip" title="<%= translation('sidebar._post_button.share_your_work') %>" data-placement="bottom" href="/post?tags=<%= @title %>" class="btn btn-primary requireLogin">New post <i class="fa fa-plus fa-white"></i></a>
115115
<% else %>
116116
<a class="btn btn-primary requireLogin" target="_blank" href="/subscribe/tag/<%= params[:id] %>"> Follow</a>
117117
<% if @related_tags %>
@@ -185,3 +185,10 @@
185185
color: #666;
186186
}
187187
</style>
188+
189+
190+
<script>
191+
$(function () {
192+
$('.tag-header [data-toggle="tooltip"]').tooltip();
193+
});
194+
</script>

app/views/tag/show/_user_controls.html.erb

+31-18
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,48 @@
22
<!-- AJAXify -->
33
<a class="ellipsis" data-toggle="dropdown">&nbsp<i class="fa fa-ellipsis-h" style="color : #666; font-size:15px; float:right;"></i></a>
44
<div class="dropdown-menu">
5-
<div class="dropdown-item">
6-
<a href="/feed/tag/<%= params[:id] %>.rss"><i class="fa fa-rss"></i> RSS</a>
7-
</div>
85
<% unless @wildcard %>
96
<% if current_user.following(params[:id]) %>
107
<div class="dropdown-item">
118
<a style="width: 100px;" rel="tooltip" title="<%= translation('tag.show.unfollow') %>" class="btn btn-light btn-sm active" href="/unsubscribe/tag/<%= params[:id] %>"> <%= translation('tag.index.unsubscribe') %></a>
129
</div>
10+
<div class="dropdown-divider"></div>
1311
<% else %>
14-
<div class="dropdown-item">
15-
<a style="width: 100px;" class="btn btn-outline-secondary btn-sm" href="/subscribe/tag/<%= params[:id] %>" data-remote="true">
16-
<%= translation('tag.index.subscribe') %>
17-
</a>
12+
<div class="dropdown-item">
13+
<a style="width: 100px;" class="btn btn-outline-secondary btn-sm" href="/subscribe/tag/<%= params[:id] %>" data-remote="true">
14+
<%= translation('tag.index.subscribe') %>
15+
</a>
1816
</div>
1917
<% end %>
20-
<div class="dropdown-item">
21-
<%= link_to tag_stats_path, id: params[:id] ,title: "Click to view graph" do %>
22-
<i class="fa fa-bar-chart"></i> Topic statistics
23-
<% end %>
24-
</div>
25-
<div class="dropdown-item">
26-
<a href="/tag-pages">How to edit this card</a>
27-
</div>
2818

29-
<div class="dropdown-divider"></div>
30-
<% unless @tags.try(:first).try(:parent).nil? %>
31-
<small>Alias of: <%= @tags.first.parent %></small>
19+
<div class="dropdown-item">
20+
<a href="/feed/tag/<%= params[:id] %>.rss"><i class="fa fa-rss"></i> RSS</a>
21+
</div>
22+
23+
<div class="dropdown-item">
24+
<a href="/tag-pages">How to edit this card</a>
25+
</div>
26+
27+
<div class="dropdown-item">
28+
<%= link_to tag_stats_path, id: params[:id] ,title: "Click to view graph" do %>
29+
<i class="fa fa-bar-chart"></i> Topic statistics
3230
<% end %>
31+
</div>
32+
33+
<div class="dropdown-item">
34+
<a href="/tags">All topics</a>
35+
</div>
36+
37+
<div class="dropdown-item">
38+
<a href="/stats/subscriptions">Statistics for all topics</a>
39+
</div>
40+
41+
<% unless @tags.try(:first).try(:parent).nil? %>
42+
<div class="dropdown-divider"></div>
43+
<small>Alias of: <%= @tags.first.parent %></small>
3344
<% end %>
45+
46+
<% end %>
3447
</div>
3548

3649
<!-- AJAXify -->

0 commit comments

Comments
 (0)