add permissions to profile page #2417
This commit is contained in:
@@ -25,6 +25,16 @@ class UserPresenter
|
||||
end
|
||||
end
|
||||
|
||||
def permissions
|
||||
permissions = []
|
||||
|
||||
if user.can_approve_posts?
|
||||
permissions << "approve posts"
|
||||
end
|
||||
|
||||
permissions.join(", ")
|
||||
end
|
||||
|
||||
def posts_for_subscription(subscription)
|
||||
arel = Post.where("id in (?)", subscription.post_id_array.map(&:to_i)).order("id desc").limit(6)
|
||||
|
||||
|
||||
@@ -17,6 +17,11 @@
|
||||
<td><%= presenter.level %></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Permissions</th>
|
||||
<td><%= presenter.permissions %></td>
|
||||
</tr>
|
||||
|
||||
<% if user.is_banned? && user.recent_ban %>
|
||||
<tr>
|
||||
<th>Ban reason</th>
|
||||
|
||||
Reference in New Issue
Block a user