Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Display tag moderators on tag page (#1739)
  • Loading branch information
seanmfox authored and maestromac committed Feb 12, 2019
1 parent d8de2b0 commit 1acd5b7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/stories_controller.rb
Expand Up @@ -81,6 +81,7 @@ def handle_tag_index
@tag = params[:tag].downcase
@page = (params[:page] || 1).to_i
@tag_model = Tag.find_by_name(@tag) || not_found
@moderators = User.with_role(:tag_moderator, @tag_model)
add_param_context(:tag, :page)
if @tag_model.alias_for.present?
redirect_to "/t/#{@tag_model.alias_for}"
Expand Down
16 changes: 16 additions & 0 deletions app/views/articles/tags/_sidebar.html.erb
Expand Up @@ -35,6 +35,22 @@
</div>
</div>
<% end %>
<% if @moderators.present? %>
<div class="widget">
<header>
<h4>tag moderators</h4>
</header>
<div class="widget-body">
<% @moderators.each do |user| %>
<div class="widget-user-pic">
<a href="/<%= user.username %>" title="<%= user.username %>">
<img src="<%= ProfileImage.new(user).get(90) %>" />
</a>
</div>
<% end %>
</div>
</div>
<% end %>
<div class="sidebar-data">
<div>
<%= pluralize Article.cached_tagged_with(@tag).where(published: true).size, "Post" %> Published
Expand Down

0 comments on commit 1acd5b7

Please sign in to comment.