Added ban reason #41

Merged
bruncbrunc merged 7 commits from bna into master 2017-10-31 22:20:56 -04:00
2 changed files with 7 additions and 4 deletions
Showing only changes of commit 8dc051ea46 - Show all commits
+2
View File
1
@@ -30,6 +30,8 @@ class UsersController < ApplicationController
end
def show
user = User.find(params[:id])
@ban_json = JSON.parse(File.read("/etc/minecraft/redstoner/banned-players.json")).detect {|u| u["uuid"] == user.uuid}
end
# SIGNUP
+4 -3
View File
3
@@ -15,11 +15,12 @@
<h1><%= @user.name %></h1>
<div class="clear"></div>
<% if @user.banned? %>
<% if @ban_json %>
<span class="user-banned">This used is banned for "<%=@ban_json["reason"]%>"<%=" until #{@ban_json["expires"]}" unless @ban_json["expires"] == "forever"%></span>
<% elsif @user.banned? %>
<span class="user-banned">This user is banned!</span>
<% end %>
<br>
<% if !@user.confirmed? %>
<% if @user.is?(current_user) || mod? %>
<span class="user-unconfirmed">Please confirm your email <u><%= @user.email %></u> !</span>