From 58a34fb3a81b5b1c98ab634ee7f913cbd8bbb8f5 Mon Sep 17 00:00:00 2001 From: magnolia-fan Date: Wed, 13 Apr 2011 08:53:22 +0400 Subject: [PATCH] Hide player on login pages --- app/controllers/user_controller.rb | 5 +++-- app/views/layouts/application.html.erb | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 6d7b5bb..b28b18c 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -1,5 +1,6 @@ class UserController < ApplicationController def login + @hide_player = 1 unless params[:email].nil? or params[:password].nil? user_data = User.collection.find({email: params[:email], password: Digest::SHA256.hexdigest(params[:password])}).first unless user_data.nil? @@ -9,12 +10,11 @@ class UserController < ApplicationController else redirect_to '/login' end - else - redirect_to '/login' end end def register + @hide_player = 1 data = Invite.where(:email => params[:email], :code => params[:code]).first unless data.nil? @code = data.code @@ -25,6 +25,7 @@ class UserController < ApplicationController end def complete + @hide_player = 1 data = Invite.where(:email => params[:invite_email], :code => params[:invite_code]).first unless data.nil? if params[:email].match(/\A[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}\z/).nil? or diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 8c1b892..1457fec 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -9,10 +9,9 @@ <%= csrf_meta_tag %> -



- <%= @params %>
+ <% if @hide_player.nil? -%>
@@ -39,6 +38,7 @@
    + <%- end %> <%= yield %>