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!
|
# XXX permissions are checked in Comment#unvote!
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def can_see_votes?
|
||||||
|
user.is_moderator?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<%= render "comments/secondary_links" %>
|
||||||
|
|
||||||
<div id="c-comment-votes">
|
<div id="c-comment-votes">
|
||||||
<div id="a-index">
|
<div id="a-index">
|
||||||
<%= search_form_for(comment_votes_path) do |f| %>
|
<%= search_form_for(comment_votes_path) do |f| %>
|
||||||
|
|||||||
@@ -2,5 +2,8 @@
|
|||||||
<%= quick_search_form_for(:body_matches, comments_path, "comments") %>
|
<%= quick_search_form_for(:body_matches, comments_path, "comments") %>
|
||||||
<%= subnav_link_to "Listing", comments_path(:group_by => "post") %>
|
<%= subnav_link_to "Listing", comments_path(:group_by => "post") %>
|
||||||
<%= subnav_link_to "Search", search_comments_path %>
|
<%= 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") %>
|
<%= subnav_link_to "Help", wiki_page_path("help:comments") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user