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