pundit: convert posts to pundit.

This commit is contained in:
evazion
2020-03-20 01:55:51 -05:00
parent dd39913e55
commit a5418abb31
18 changed files with 178 additions and 95 deletions

View File

@@ -41,7 +41,7 @@
<%= render "post_disapprovals/counts", :disapprovals => post.disapprovals, :post => post %>
<% if CurrentUser.can_approve_posts? && !post.disapproved_by?(CurrentUser.user) %>
<% if policy(PostDisapproval).create? && !post.disapproved_by?(CurrentUser.user) %>
<%= render "modqueue/quick_mod", post: post %>
<%= render "post_disapprovals/detailed_rejection_dialog" %>
<% end %>
@@ -67,7 +67,7 @@
</div>
<% end %>
<% if post.visible? && post.has_large? && !post.is_ugoira? %>
<% if policy(post).visible? && post.has_large? && !post.is_ugoira? %>
<div class="notice notice-small post-notice post-notice-resized" id="image-resize-notice" style="<%= CurrentUser.default_image_size == "original" ? "display: none;" : "" %>">
<span>Resized to <%= number_to_percentage post.resize_percentage.floor, :precision => 0 %> of original (<%= link_to "view original", post.tagged_file_url, :id => "image-resize-link" %>)</span>
<span style="display: none;">Loading...</span>