pundit: convert posts to pundit.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<ul>
|
||||
<li id="post-info-id">ID: <%= post.id %></li>
|
||||
<% if CurrentUser.is_moderator? %>
|
||||
<% if policy(post).can_view_uploader? %>
|
||||
<li id="post-info-uploader">Uploader: <%= link_to_user(post.uploader) %></li>
|
||||
<% end %>
|
||||
<li id="post-info-date">
|
||||
@@ -11,7 +11,7 @@
|
||||
<li id="post-info-approver">Approver: <%= link_to_user(post.approver) %></li>
|
||||
<% end %>
|
||||
<li id="post-info-size">
|
||||
Size: <%= link_to_if post.visible?, number_to_human_size(post.file_size), post.tagged_file_url %>
|
||||
Size: <%= link_to_if policy(post).visible?, number_to_human_size(post.file_size), post.tagged_file_url %>
|
||||
<% if post.has_dimensions? %>
|
||||
(<span itemprop="width"><%= post.image_width %></span>x<span itemprop="height"><%= post.image_height %></span>)
|
||||
<% end %>
|
||||
@@ -31,7 +31,7 @@
|
||||
<% end %>
|
||||
</li>
|
||||
<li id="post-info-favorites">Favorites: <span id="favcount-for-post-<%= post.id %>"><%= post.fav_count %></span>
|
||||
<% if CurrentUser.is_gold? %>
|
||||
<% if policy(post).can_view_favlist? %>
|
||||
<%= link_to "Show »", "#", id: "show-favlist-link", style: ("display: none;" if post.fav_count == 0) %>
|
||||
<%= link_to "« Hide", "#", id: "hide-favlist-link", style: "display: none;" %>
|
||||
<div id="favlist" style="display: none;"><%= post_favlist(post) %></div>
|
||||
|
||||
Reference in New Issue
Block a user