comments: link votes page in subnav for mods.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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| %>
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
Reference in New Issue
Block a user