aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/user.rb7
-rw-r--r--app/views/user/show.rhtml8
2 files changed, 15 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index f9f1a99cf..d648fef3f 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -116,6 +116,9 @@ class User < ActiveRecord::Base
if not name.nil?
name.strip!
end
+ if self.public_banned?
+ name = name + " (Banned)"
+ end
name
end
@@ -251,6 +254,10 @@ class User < ActiveRecord::Base
def admin_page_links?
self.admin_level == 'super'
end
+ # Is it public that they are banned?
+ def public_banned?
+ !self.ban_text.empty?
+ end
# Various ways the user can be banned, and text to describe it if failed
def can_file_requests?
self.ban_text.empty?
diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml
index 54d864698..6a341af6c 100644
--- a/app/views/user/show.rhtml
+++ b/app/views/user/show.rhtml
@@ -72,6 +72,14 @@
<% end %>
</p>
+ <% if @display_user.public_banned? %>
+ <p id="user_public_banned">
+ <strong>
+ This user has been banned from WhatDoTheyKnow.com
+ </strong>
+ </p>
+ <% end %>
+
<% if !@display_user.get_about_me_for_html_display.empty? || @is_you %>
<div class="user_about_me">
<img class="comment_quote" src="/images/quote.png" alt="">