comments: link votes page in subnav for mods.

This commit is contained in:
evazion
2020-04-03 15:43:01 -05:00
parent dc0442bd17
commit 3e792019e5
3 changed files with 9 additions and 0 deletions

View File

@@ -3,4 +3,8 @@ class CommentVotePolicy < ApplicationPolicy
# XXX permissions are checked in Comment#unvote!
true
end
def can_see_votes?
user.is_moderator?
end
end

View File

@@ -1,3 +1,5 @@
<%= render "comments/secondary_links" %>
<div id="c-comment-votes">
<div id="a-index">
<%= search_form_for(comment_votes_path) do |f| %>

View File

@@ -2,5 +2,8 @@
<%= quick_search_form_for(:body_matches, comments_path, "comments") %>
<%= subnav_link_to "Listing", comments_path(:group_by => "post") %>
<%= subnav_link_to "Search", search_comments_path %>
<% if policy(CommentVote).can_see_votes? %>
<%= subnav_link_to "Votes", comment_votes_path %>
<% end %>
<%= subnav_link_to "Help", wiki_page_path("help:comments") %>
<% end %>