posts: bring back uploader names.
This commit is contained in:
@@ -47,10 +47,6 @@ class PostPolicy < ApplicationPolicy
|
||||
record.visible?(user)
|
||||
end
|
||||
|
||||
def can_view_uploader?
|
||||
user.is_approver?
|
||||
end
|
||||
|
||||
def can_lock_rating?
|
||||
user.is_builder?
|
||||
end
|
||||
|
||||
@@ -4,12 +4,10 @@
|
||||
<strong>Date</strong>
|
||||
<%= compact_time(post.created_at) %>
|
||||
</span>
|
||||
<% if policy(post).can_view_uploader? %>
|
||||
<span class="info">
|
||||
<strong>User</strong>
|
||||
<%= link_to_user(post.uploader) %>
|
||||
</span>
|
||||
<% end %>
|
||||
<span class="info">
|
||||
<strong>Uploader</strong>
|
||||
<%= link_to_user(post.uploader) %>
|
||||
</span>
|
||||
<span class="info">
|
||||
<strong>Rating</strong>
|
||||
<%= post.pretty_rating %>
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<ul>
|
||||
<li id="post-info-id">ID: <%= post.id %></li>
|
||||
<% if policy(post).can_view_uploader? %>
|
||||
<li id="post-info-uploader">
|
||||
Uploader: <%= link_to_user(post.uploader) %>
|
||||
<%= link_to "»", posts_path(tags: "user:#{post.uploader.name}") %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li id="post-info-uploader">
|
||||
Uploader: <%= link_to_user(post.uploader) %>
|
||||
<%= link_to "»", posts_path(tags: "user:#{post.uploader.name}") %>
|
||||
</li>
|
||||
<li id="post-info-date">
|
||||
Date: <%= link_to time_ago_in_words_tagged(post.created_at), posts_path(tags: "date:#{post.created_at.to_date}") %>
|
||||
</li>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<div class="post-tooltip-header">
|
||||
<span class="post-tooltip-header-left">
|
||||
<% if policy(@post).can_view_uploader? %>
|
||||
<%= link_to_user @post.uploader %>
|
||||
<% end %>
|
||||
<%= link_to_user @post.uploader %>
|
||||
|
||||
<span class="post-tooltip-favorites post-tooltip-info">
|
||||
<span><%= @post.fav_count %></span>
|
||||
|
||||
Reference in New Issue
Block a user