1
0
Fork 0

Hide player on login pages

This commit is contained in:
magnolia-fan 2011-04-13 08:53:22 +04:00
parent 957a883ccf
commit 58a34fb3a8
2 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -9,10 +9,9 @@
<%= csrf_meta_tag %>
</head>
<body>
<br/><br/><br/><br/>
<%= @params %>
<div id="contents">
<div class="inner-1">
<% if @hide_player.nil? -%>
<div id="player">
<audio autoplay preload></audio>
<div class="prev" title="Play Previous Track"><img src="/images/player/prev.svg" alt="prv" /></div>
@ -39,6 +38,7 @@
<div id="playlist">
<ul class="list"></ul>
</div>
<%- end %>
<%= yield %>
</div>
</div>