add ban reason to profile

This commit is contained in:
albert
2013-02-19 22:32:01 -05:00
parent 57e57ca384
commit cc6aa6f288
2 changed files with 9 additions and 0 deletions

View File

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

View File

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