This commit is contained in:
r888888888
2013-04-21 11:36:43 -07:00
parent 53c8babe3e
commit e2a38ebc17
11 changed files with 46 additions and 6 deletions

View File

@@ -1,11 +1,15 @@
<div class="bans">
<div class="show">
<h1>Show Ban</h1>
<ul>
<ul style="margin-bottom: 1em;">
<li><strong>User</strong>: <%= link_to_user(@ban.user) %></li>
<li><strong>Expires</strong>: <%= compact_time @ban.expires_at %></li>
<li><strong>Reason</strong>: <%= @ban.reason %></li>
</ul>
<%= form_tag(ban_path(@ban), :method => :delete) do %>
<%= submit_tag "Unban" %>
<% end %>
</div>
</div>

View File

@@ -44,6 +44,10 @@
<%= render "users/upgrade_notice" %>
<% end %>
<% if CurrentUser.user.is_banned? %>
<%= render "users/ban_notice" %>
<% end %>
<% if cookies["accepted_tos"].blank? && !CurrentUser.is_privileged? %>
<%= render "users/tos" %>
<% end %>

View File

@@ -0,0 +1,5 @@
<div class="ui-corner-all ui-state-error" id="ban-notice">
<h1>Your account has been temporarily banned</h1>
<p>Reason: <%= CurrentUser.user.ban.reason %></p>
<p>Your ban will expire in <%= time_ago_in_words(CurrentUser.user.ban.expires_at) %></p>
</div>

View File

@@ -27,6 +27,11 @@
<% if CurrentUser.is_moderator? %>
<li><%= link_to "Promote", edit_admin_user_path(@user) %></li>
<% if @user.is_banned? %>
<li><%= link_to "Unban", ban_path(@user.ban) %></li>
<% else %>
<li><%= link_to "Ban", new_ban_path(:ban => {:user_id => @user.id}) %></li>
<% end %>
<% end %>
<li>|</li>