users: rename recent_ban to active_ban.

This commit is contained in:
evazion
2021-05-15 03:14:39 -05:00
parent 2537145b02
commit 8ca757244a
6 changed files with 9 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
<div class="notice notice-error notice-large" id="ban-notice">
<h2>Your account has been temporarily banned</h2>
<div>Reason: <span class="prose"><%= format_text CurrentUser.user.recent_ban.reason, inline: true %></span></div>
<div>Your ban will expire in <%= time_ago_in_words(CurrentUser.user.recent_ban.expires_at) %></div>
<div>Reason: <span class="prose"><%= format_text CurrentUser.user.active_ban.reason, inline: true %></span></div>
<div>Your ban will expire in <%= time_ago_in_words(CurrentUser.user.active_ban.expires_at) %></div>
</div>

View File

@@ -28,8 +28,8 @@
<% end %>
<% if policy(Ban.new(user: @user)).create? %>
<% if @user.is_banned? && @user.recent_ban.present? %>
<%= subnav_link_to "Unban", ban_path(@user.recent_ban) %>
<% if @user.is_banned? && @user.active_ban.present? %>
<%= subnav_link_to "Unban", ban_path(@user.active_ban) %>
<% else %>
<%= subnav_link_to "Ban", new_ban_path(:ban => {:user_id => @user.id}) %>
<% end %>

View File

@@ -89,7 +89,7 @@
<td><%= presenter.permissions %></td>
</tr>
<% if user.is_banned? && user.recent_ban %>
<% if user.is_banned? %>
<tr>
<th>Ban reason</th>
<td>