Skip to content

Commit

Permalink
Update _user_controls.html.erb with more menu items on /tag/____ card…
Browse files Browse the repository at this point in the history
… menus (#8399)

* Update _user_controls.html.erb

* Update show.html.erb

* Update _user_controls.html.erb
  • Loading branch information
jywarren authored Sep 15, 2020
1 parent bd81b6f commit 7984fc9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 19 deletions.
9 changes: 8 additions & 1 deletion app/views/tag/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<div class="tag-buttons">
<div class="btn-group" role="group">
<% if current_user && current_user.following(params[:id]) %>
<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>
<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>
<% else %>
<a class="btn btn-primary requireLogin" target="_blank" href="/subscribe/tag/<%= params[:id] %>"> Follow</a>
<% if @related_tags %>
Expand Down Expand Up @@ -185,3 +185,10 @@
color: #666;
}
</style>


<script>
$(function () {
$('.tag-header [data-toggle="tooltip"]').tooltip();
});
</script>
49 changes: 31 additions & 18 deletions app/views/tag/show/_user_controls.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,48 @@
<!-- AJAXify -->
<a class="ellipsis" data-toggle="dropdown">&nbsp<i class="fa fa-ellipsis-h" style="color : #666; font-size:15px; float:right;"></i></a>
<div class="dropdown-menu">
<div class="dropdown-item">
<a href="/feed/tag/<%= params[:id] %>.rss"><i class="fa fa-rss"></i> RSS</a>
</div>
<% unless @wildcard %>
<% if current_user.following(params[:id]) %>
<div class="dropdown-item">
<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>
</div>
<div class="dropdown-divider"></div>
<% else %>
<div class="dropdown-item">
<a style="width: 100px;" class="btn btn-outline-secondary btn-sm" href="/subscribe/tag/<%= params[:id] %>" data-remote="true">
<%= translation('tag.index.subscribe') %>
</a>
<div class="dropdown-item">
<a style="width: 100px;" class="btn btn-outline-secondary btn-sm" href="/subscribe/tag/<%= params[:id] %>" data-remote="true">
<%= translation('tag.index.subscribe') %>
</a>
</div>
<% end %>
<div class="dropdown-item">
<%= link_to tag_stats_path, id: params[:id] ,title: "Click to view graph" do %>
<i class="fa fa-bar-chart"></i> Topic statistics
<% end %>
</div>
<div class="dropdown-item">
<a href="/tag-pages">How to edit this card</a>
</div>

<div class="dropdown-divider"></div>
<% unless @tags.try(:first).try(:parent).nil? %>
<small>Alias of: <%= @tags.first.parent %></small>
<div class="dropdown-item">
<a href="/feed/tag/<%= params[:id] %>.rss"><i class="fa fa-rss"></i> RSS</a>
</div>

<div class="dropdown-item">
<a href="/tag-pages">How to edit this card</a>
</div>

<div class="dropdown-item">
<%= link_to tag_stats_path, id: params[:id] ,title: "Click to view graph" do %>
<i class="fa fa-bar-chart"></i> Topic statistics
<% end %>
</div>

<div class="dropdown-item">
<a href="/tags">All topics</a>
</div>

<div class="dropdown-item">
<a href="/stats/subscriptions">Statistics for all topics</a>
</div>

<% unless @tags.try(:first).try(:parent).nil? %>
<div class="dropdown-divider"></div>
<small>Alias of: <%= @tags.first.parent %></small>
<% end %>
<% end %>
</div>

<!-- AJAXify -->
Expand Down

0 comments on commit 7984fc9

Please sign in to comment.