posts: bring back uploader names.

This commit is contained in:
evazion
2020-07-13 18:19:20 -05:00
parent 45bbb71eba
commit 0b52b1622f
4 changed files with 9 additions and 19 deletions

View File

@@ -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

View File

@@ -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 %>

View File

@@ -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>

View File

@@ -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>