add ban reason to profile
This commit is contained in:
@@ -5,6 +5,7 @@ class User < ActiveRecord::Base
|
||||
class PrivilegeError < Exception ; end
|
||||
|
||||
module Levels
|
||||
BLOCKED = 10
|
||||
MEMBER = 20
|
||||
PRIVILEGED = 30
|
||||
BUILDER = 32
|
||||
@@ -251,6 +252,9 @@ class User < ActiveRecord::Base
|
||||
|
||||
def level_string
|
||||
case level
|
||||
when Levels::BLOCKED
|
||||
"Banned"
|
||||
|
||||
when Levels::MEMBER
|
||||
"Member"
|
||||
|
||||
|
||||
@@ -12,6 +12,11 @@
|
||||
<dt>Level</dt>
|
||||
<dd><%= @presenter.level %></dd>
|
||||
|
||||
<% if @user.is_banned? %>
|
||||
<dt>Ban reason</dt>
|
||||
<dd><%= @presenter.ban_reason %></dd>
|
||||
<% end %>
|
||||
|
||||
<dt>Upload Limit</dt>
|
||||
<dd><%= @presenter.upload_limit %></dd>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user