pundit: convert moderation reports to pundit.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<% if policy(forum_post).show_deleted? %>
|
||||
<article class="forum-post message" id="forum_post_<%= forum_post.id %>"
|
||||
data-forum-post-id="<%= forum_post.id %>"
|
||||
<% if CurrentUser.is_moderator? %>
|
||||
<% if policy(moderation_reports).show? %>
|
||||
data-is-reported="<%= moderation_reports.pluck(:model_id).include?(forum_post.id) %>"
|
||||
<% end %>
|
||||
data-creator="<%= forum_post.creator.name %>">
|
||||
@@ -37,7 +37,7 @@
|
||||
<li><%= link_to "Edit", edit_forum_post_path(forum_post.id), :id => "edit_forum_post_link_#{forum_post.id}", :class => "edit_forum_post_link" %></li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if forum_post.reportable_by?(CurrentUser.user) %>
|
||||
<% if policy(forum_post).reportable? %>
|
||||
<li><%= link_to "Report", new_moderation_report_path(moderation_report: { model_type: "ForumPost", model_id: forum_post.id }), remote: true, title: "Report this forum post to the moderators" %></li>
|
||||
<% end %>
|
||||
<% if forum_post.bulk_update_request.present? %>
|
||||
|
||||
Reference in New Issue
Block a user