登陆注册按钮改为页面跳转

This commit is contained in:
lizanle 2015-08-25 16:08:52 +08:00
parent b1195139f8
commit f2e406a416
4 changed files with 28 additions and 18 deletions

View File

@ -25,6 +25,7 @@ class AccountController < ApplicationController
# Login request and validation
def login
if request.get?
@login = params[:login]
if User.current.logged?
redirect_to home_url
else

View File

@ -1,18 +1,18 @@
<%= stylesheet_link_tag 'new_public'%>
<%= stylesheet_link_tag 'new_user'%>
<%= stylesheet_link_tag 'leftside'%>
<script>
$(document).ready(function(){
$("#loginSignButton").click(function(){
$("#signUpBox").css({display:"block"});
$("#loginInBox").css({display:"none"});
});
$("#loginInButton").click(function(){
$("#signUpBox").css({display:"none"});
$("#loginInBox").css({display:"block"});
});
});
// $(document).ready(function(){
// $("#loginSignButton").click(function(){
// $("#signUpBox").css({display:"block"});
// $("#loginInBox").css({display:"none"});
// });
// $("#loginInButton").click(function(){
// $("#signUpBox").css({display:"none"});
// $("#loginInBox").css({display:"block"});
// });
// });
$(document).ready(function(){
$(".homepageSearchIcon").click(function(){
@ -24,10 +24,10 @@
$("#navSearchAlert").css({display:"none"});
}
});
$("#loginInButton").click(function(){
$("#signUpBox").css({display:"none"});
$("#loginInBox").css({display:"block"});
});
// $("#loginInButton").click(function(){
// $("#signUpBox").css({display:"none"});
// $("#loginInBox").css({display:"block"});
// });
});
$(document).ready(function(){
@ -38,6 +38,15 @@
$(".navSearchTypeBox").css({display:"none"});
});
})
$(document).ready(function(){
if(<%= @login%>){
$("#signUpBox").css({display:"none"});
$("#loginInBox").css({display:"block"});
}else{
$("#signUpBox").css({display:"block"});
$("#loginInBox").css({display:"none"});
}
});
function clearInfo(id, content) {
var text = $('#' + id);
if (text.val() == content) {

View File

@ -55,7 +55,7 @@
<ul class="topnav_login_list">
<li><a href="javascript:void(0);" class="menuGrey">修改资料</a> </li>
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
<li><a href="javascript:void(0);" class="menuGrey">退出</a></li>
<li><a href="<%= signout_path %>" class="menuGrey" >退出</a></li>
</ul>
</li>
</ul>

View File

@ -39,9 +39,9 @@
</div>
</div>
<div id="loginInButton" class="fr ml20">
<a href="javascript:void(0);" class="c_white db">登录</a>
<a href="<%= signin_path(:login=>true) %>" class="c_white db">登录</a>
</div>
<div id="loginSignButton" class="fr">
<a href="javascript:void(0);" class="c_white db">注册</a>
<a href="<%= signin_path(:login=>false) %>" class="c_white db">注册</a>
</div>
</div>