Merge branch 'hjq_login' into develop

This commit is contained in:
huang 2016-06-16 10:36:30 +08:00
commit 41bb68d0e1
9 changed files with 296 additions and 204 deletions

View File

@ -2,32 +2,6 @@
<%= stylesheet_link_tag 'leftside'%>
<script type="text/javascript">
// $(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"});
// });
// });
// $(function(){
// $("#username").keypress(function(e){
// alert(11);
// if (e.keyCode == '13') {
// $('#main_login_form').submit();
// }
// });
//
// $("#password").keypress(function(e){
// if (e.keyCode == '13') {
// $('#main_login_form').submit();
// }
// });
// });
$(document).ready(function(){
$(".homepageSearchIcon").click(function(){
var val=$('input:radio[name="search_type"]:checked').val();
@ -38,10 +12,6 @@
$("#navSearchAlert").css({display:"none"});
}
});
// $("#loginInButton").click(function(){
// $("#signUpBox").css({display:"none"});
// $("#loginInBox").css({display:"block"});
// });
});
$(document).ready(function(){
@ -62,42 +32,6 @@
}
});
// $('#regist_btn').bind('keyup', function(event) {
// if (event.keyCode == "13" && $("#signUpBox").css('display') == 'block')) {
// register();
// }
//});
function clearInfo(id, content) {
var text = $('#' + id);
if (text.val() == content) {
$('#' + id).val('');
}
}
function showInfo(id, content) {
var text = $('#' + id);
if (text.val() == '') {
$('#' + id).val(content);
}
}
function login(){
$('#main_login_form').submit(); //表单提交没有任何反应的原因js冲突
}
function register(){
if($("#loginUpButton").hasClass('loginUpDisableButton')){
return;
}
if($login_correct && $mail_correct && $passwd_correct && $passwd_comfirm_correct && $("#read_and_confirm").attr("checked") == 'checked'){
$("#main_reg_form").submit();
}else{
$('#user_login').blur();
$('#user_mail').blur();
$('#user_password').blur();
$('#user_password_confirmation').blur();
}
}
var $login_correct = false;
var $mail_correct = false;
var $passwd_correct = false;
@ -118,7 +52,7 @@
$('#login_req').html('<span style="color: green">'+data.message+'</span>');
$login_correct = true;
} else {
$('#login_req').html( '<span style="color: red">'+data.message+'</span>');
$('#login_req').html( '<span style="color: #c00202">'+data.message+'</span>');
$login_correct = false;
}
$('#login_req').css('display','block');
@ -129,7 +63,7 @@
$mail.blur(function (event) {
if (/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(this.value) == false){
$('#mail_req').html( '<span style="color: red">邮件格式不对</span>').show();
$('#mail_req').html( '<span style="color: #c00202">邮件格式不对</span>').show();
$mail_correct = false;
return ;
}
@ -142,7 +76,7 @@
$('#mail_req').html( '<span style="color: green">'+data.message+'</span>' );
$mail_correct = true;
} else {
$('#mail_req').html( '<span style="color: red">'+data.message+'</span>' );
$('#mail_req').html( '<span style="color: #c00202">'+data.message+'</span>' );
$mail_correct = false;
}
$('#mail_req').css('display','block');
@ -158,7 +92,7 @@
$passwd_correct = true;
}
else {
$('#passwd_req').html( '<span style="color: red">'+'<%= l(:setting_password_min_length_limit, :count => Setting.password_min_length.to_i) %>'+'</span>');
$('#passwd_req').html( '<span style="color: #c00202">'+'<%= l(:setting_password_min_length_limit, :count => Setting.password_min_length.to_i) %>'+'</span>');
$passwd_correct = false;
}
$('#passwd_req').css('display','block');
@ -174,7 +108,7 @@
$passwd_comfirm_correct = true;
}
else {
$('#confirm_req').html('<span style="color: red">'+'<%= l(:setting_password_error) %>'+'</span>');
$('#confirm_req').html('<span style="color: #c00202">'+'<%= l(:setting_password_error) %>'+'</span>');
$passwd_comfirm_correct = false;
}
@ -184,121 +118,89 @@
});
});
function user_name_keypress(e){
if (e.keyCode == '13') {
$('#main_login_form').submit();
}
}
function changeRegisterBtn(checkbox){
if(checkbox.checked == true){
$("#loginUpButton").removeClass('loginUpDisableButton');
$("#loginUpButton").addClass('loginUpButton');
}else{
$("#loginUpButton").removeClass('loginUpButton')
$("#loginUpButton").addClass('loginUpDisableButton');
}
}
</script>
<div class="loginContentContainer">
<div class="loginContent">
<div class="loginLeft">
<div class="loginLogo"><img src="images/trustie_big_log.png" width="100" height="88" alt="Trustie Logo" /></div>
<div class="loginInro">&nbsp;&nbsp;欢迎加入Trustie创新实践社区在这里您的创新意识和创新潜力将得到充分发挥目前已有超过200所高校和科研机构在平台中开展在线协同开发、协同学习和协同研究。<br/><br/>&nbsp;&nbsp;Trustie社区的理想是让创新过程变的更美好</div>
<div class="new_login" id = "loginInBox">
<div class="new_login_con">
<div class="new_login_txt fl">
<h3> 欢迎加入Trustie创新实践社区</h3>
<p>在这里您的创新意识和创新潜力将得到充分发挥目前已有超过200所高校和科研机构在平台中开展在线协同开发、协同学习和协同研究。</p>
</div>
<div class="loginRight">
<div id="loginInBox">
<div class="loginChooseBox">
<div class="mb5">
<ul class="loginChooseList">
<li class="loginChoose fl"><span class="loginChooseTab">登录</span></li>
<li class="loginChooseBorder fl"></li>
</ul>
</div>
<div class="loginSignAlert" style="color: red"><%= flash.empty? || flash[:error].nil? ? "" : flash[:error].html_safe %></div>
</div>
<div class="loginIn">
<%= form_tag(signin_path,:id=>'main_login_form',:method=>'post') do %>
<%= back_url_hidden_field_tag %>
<div class="mb20">
<%= text_field_tag 'username', params[:username], :tabindex => '1' ,
:class=>'loginSignBox',:placeholder=>'请输入邮箱地址或登录名', :onkeypress => "user_name_keypress(event);"%>
<!--<input type="text" placeholder="请输入邮箱地址或昵称" class="loginSignBox" />-->
</div>
<% if Setting.openid? %>
<div class="mb20">
<%= text_field_tag "openid_url", nil, :tabindex => '3',:placeholder=>'请输入OpenId URL' %>
</div>
<% end %>
<div>
<!--<input type="text" placeholder="请输密码" class="loginSignBox" />-->
<%= password_field_tag 'password', nil, :tabindex => '2',:class=>'loginSignBox' ,:placeholder=>'请输密码', :onkeypress => "user_name_keypress(event);"%>
</div>
<div class="loginSignOption">
<% if Setting.autologin? %>
<div class="fl mt3 mr5">
<%= check_box_tag 'autologin', 1, true, :tabindex => 4 %>
</div>
<%= l(:label_stay_logged_in) %>
<% end %>
<a href="<%= lost_password_path %>" class="newsBlue mr40 fr">
<% if Setting.lost_password? %>
<u>忘记密码?</u>
<% end %>
</a></div>
<div class="new_login_box fr mr45 mt100">
<h2 class="new_login_h2">登录
<a href="<%= register_url_without_domain %>" class="fr mt5">立即注册</a><div class="cl"></div>
</h2>
<div class="new_login_form">
<%= form_tag(signin_path,:id=>'main_login_form',:method=>'post') do %>
<%= back_url_hidden_field_tag %>
<ul>
<li>
<%= text_field_tag 'username', params[:username], :tabindex => '1', :class=>'new_loggin_input new_login_users',:placeholder=>'请输入邮箱地址或登录名', :onkeypress => "user_name_keypress(event);"%>
</li>
<li>
<%= password_field_tag 'password', nil, :tabindex => '2', :class => 'new_loggin_input new_login_lock' , :placeholder => '请输入登录密码', :onkeypress => "user_name_keypress(event);"%>
<p class="new_login_error"><%= flash.empty? || flash[:error].nil? ? "" : flash[:error].html_safe %></p>
</li>
<li>
<% if Setting.autologin? %>
<label><%= check_box_tag 'autologin', 1, true, :tabindex => 4, :class => "new_login_check" %><%= l(:label_stay_logged_in) %></label>
<% end %>
<a href="<%= lost_password_path %>" class="fr">
<% if Setting.lost_password? %>忘记密码<% end %>
</a>
<div class="cl"></div>
</li>
<li><button type="submit" class="new_login_submit"><a href="javascript:void(0);" id="login_btn" onclick="$('#main_login_form').submit();">登录</a></button></li>
</ul>
<% end %>
<div class="loginInButton" >
<a href="javascript:void(0);" id="login_btn" class="c_white db" onclick="$('#main_login_form').submit();">登录</a>
</div>
</div>
</div>
<div id="signUpBox">
<div class="loginChooseBox">
<ul class="loginChooseList">
<li class="loginChoose fl"><span class="loginChooseTab">注册<%= link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></a></span>
<li class="loginChooseBorder fl"></li>
</ul>
</div>
<div class="loginIn">
<%= form_for :user, :url => register_path,:method=>'post',:html=>{:id=>'main_reg_form'} do |f| %>
<%= error_messages_for 'user' %>
<div class="loginSignRow">
<!--<input type="text" placeholder="请输入邮箱地址" class="loginSignBox" />-->
<%= f.text_field :mail,:size => 25, :class=>'loginSignBox' ,:placeholder=>"请输入邮箱地址"%>
<div class="loginSignAlert" id="mail_req" style="display: none" >请输入有效邮箱地址</div>
</div>
<div class="loginSignRow">
<!--<input type="text" placeholder="请输入密码" class="loginSignBox" />-->
<%= f.password_field :password, :size => 25,:placeholder=>"请输入密码",:class=>'loginSignBox' %>
<div class="loginSignAlert" id="passwd_req" style="display: none">至少需要 6 个字符</div>
</div>
<div class="loginSignRow">
<!--<input type="text" placeholder="请再次输入密码" class="loginSignBox" />-->
<%= f.password_field :password_confirmation, :size => 25,:placeholder=>"请再次输入密码",:class=>'loginSignBox' %>
<div class="loginSignAlert" id="confirm_req" style="display: none">密码不一致</div>
</div>
<div class="loginSignRow">
<!--<input type="text" placeholder="请输入用户昵称" class="loginSignBox" />-->
<%= f.text_field :login, :size => 25,:placeholder=>"请输入用户登录名",:class=>'loginSignBox'%>
<div class="loginSignAlert" id="login_req" style="display: none">用户登录名为2-18个中英文数字或下划线</div>
</div>
<div class="loginSignOption">
<div class="fl mt3 mr5">
<input type="checkbox" id="read_and_confirm" onchange="changeRegisterBtn(this);"/>
</div>
我已阅读并接受<a href="<%= agreement_path %>" class="newsBlue"><u>Trustie服务协议</u></a>条款</div>
<div class="loginUpDisableButton" id="loginUpButton">
<a href="javascript:void(0);" class="c_white db" id="regist_btn" onclick="register();" >注册</a>
</div>
<% end %>
</div>
</div>
</div>
<div class="cl"></div>
</div>
</div>
<%# 注册 %>
<div class="new_register" id = "signUpBox">
<div class="new_register_con">
<div class="new_login_txt fl new_register_left">
<h3> 欢迎加入Trustie创新实践社区</h3>
<p>在这里您的创新意识和创新潜力将得到充分发挥目前已有超过200所高校和科研机构在平台中开展在线协同开发、协同学习和协同研究。</p>
</div>
<div class="new_login_box fr mr45 mt50">
<h2 class="new_login_h2">登录<a href="<%= signin_url_without_domain %>" class="fr mt5">已有账号 请登录</a><div class="cl"></div></h2>
<div class="new_login_form">
<%= form_for :user, :url => register_path,:method=>'post', :html => {:id=>'main_reg_form'} do |f| %>
<%= error_messages_for 'user' %>
<ul>
<li>
<%= f.text_field :mail, :size => 25, :class => 'new_loggin_input' , :placeholder => "请输入邮箱地址"%>
<p class="new_login_error" id="mail_req" style="display: none" >请输入正确的邮箱</p>
</li>
<li>
<%= f.password_field :password, :size => 25, :placeholder => "请输入密码", :class => 'new_loggin_input' %>
<p class="new_login_error" id="passwd_req" style="display: none">请输入6-16位密码区分大小写不能使用空格</p>
</li>
<li>
<%= f.password_field :password_confirmation, :size => 25, :placeholder => "请再次输入密码", :class=> 'new_loggin_input' %>
<p class="new_login_error" id="confirm_req" style="display: none">两次密码不一致!</p>
</li>
<li>
<%= f.text_field :login, :size => 25, :placeholder => "请输入用户登录名", :class => 'new_loggin_input'%>
<p class="new_login_error" id="login_req" style="display: none">用户登录名为2-18个中英文数字或下划线</p>
</li>
<li>
<label><input type="checkbox" id="read_and_confirm" onchange="changeRegisterBtn(this);" class=" new_login_check">我已阅读并接受<a href="<%= agreement_path %>" >Trustie服务协议条款</a></label>
</li>
<li>
<div class="new_login_submit_disable" id="loginUpButton">
<a href="javascript:void(0);" id="regist_btn" onclick="register();" class ="db" class="new_login_submit_disable" style="text-decoration: none;">注册</a>
</div>
</ul>
<% end %>
</div>
</div>
<div class="cl"></div>
</div>
</div>

View File

@ -14,19 +14,8 @@
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
<!-- MathJax的配置 -->
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- 配置 在生成的公式图片上去掉Math定义的右键菜单$$ $$ \( \) \[ \] 中的公式给予显示-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showMathMenu: false,
showMathMenuMSIE: false,
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
</head>
<body style="background-color: #fff">
<div class="navContainer">
<% is_current_user = User.current.logged? && User.current == @user%>
<% if User.current.logged? %>

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -627,4 +627,52 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) {
addEvent(elem2, 'input', change);
addEvent(elem2, 'focus', change);
change();
};
};
function user_name_keypress(e){
if (e.keyCode == '13') {
$('#main_login_form').submit();
}
}
function changeRegisterBtn(checkbox){
if(checkbox.checked == true){
$("#loginUpButton").removeClass('new_login_submit_disable');
$("#loginUpButton").addClass('new_login_submit');
}else{
$("#loginUpButton").removeClass('new_login_submit')
$("#loginUpButton").addClass('new_login_submit_disable');
}
}
function clearInfo(id, content) {
var text = $('#' + id);
if (text.val() == content) {
$('#' + id).val('');
}
}
function showInfo(id, content) {
var text = $('#' + id);
if (text.val() == '') {
$('#' + id).val(content);
}
}
function login(){
$('#main_login_form').submit(); //表单提交没有任何反应的原因js冲突
}
function register(){
if($("#loginUpButton").hasClass('new_login_submit_disable')){
return;
}
if($login_correct && $mail_correct && $passwd_correct && $passwd_comfirm_correct && $("#read_and_confirm").attr("checked") == 'checked'){
$("#main_reg_form").submit();
}else{
$('#user_login').blur();
$('#user_mail').blur();
$('#user_password').blur();
$('#user_password_confirmation').blur();
}
}

View File

@ -537,13 +537,13 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat;
/*新个人主页框架css*/
.navContainer {width:100%; margin:0 auto; background-color:#3b94d6;}
.navContainer {width:100%; margin:0 auto; background-color:#1065bd;}
.homepageContentContainer {width:100%; margin:0 auto; background-color:#eaebed;}
.homepageContent {width:1000px; background-color:#eaebed; margin:0 auto;}
.navHomepage {width:1000px; height:54px; background-color:#3b94d6; margin:0 auto;}
.navHomepage {width:1000px; height:54px; background-color:#1065bd; margin:0 auto;}
.navHomepageLogo {width:60px; height:54px; line-height:54px; vertical-align:middle; margin-left:2px; margin-right:30px;}
.navHomepageMenu {margin-right:20px;display:inline-block;height:54px; line-height:54px; vertical-align:middle;}
.navHomepageMenu:hover {background-color:#297fb8;}
.navHomepageMenu:hover {background-color:#05488e;}
/*.navHomepageMenu:hover {background-color:#0ea6b7;}*/
.navHomepageSearchBoxcontainer {margin-top:11px; }
.navHomepageSearchBox {width:380px; border:none; outline:none; height:32px; margin-top:11px; background-color:#ffffff;}
@ -747,12 +747,12 @@ a:hover .gz_btn{color:#ff5722;}
.homepageCoursesType {width:75px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:5px 10px; left:-65px; font-size:12px; color:#4b4b4b; line-height:2; z-index:9999; display:none;}
/*注册登陆页面*/
#loginInBox {display:block; margin-top:143px;}
#signUpBox {display:none; margin-top:79px;}
#loginInBox {display:block;}
#signUpBox {display:none;}
#loginSignButton {height:54px; padding-left:10px; padding-right:10px; text-align:center; line-height:54px; vertical-align:middle; color:#ffffff; font-size:16px;}
#loginInButton {height:54px; padding-left:10px; padding-right:10px; text-align:center; line-height:54px; vertical-align:middle; color:#ffffff; font-size:16px;}
#loginSignButton:hover {background-color:#297fb8;}
#loginInButton:hover {background-color:#297fb8;}
#loginSignButton:hover {background-color:#05488e;}
#loginInButton:hover {background-color:#05488e;}
.loginContentContainer {width:100%; background-color:#269ac9; margin-top:1px; height:580px;}
.loginContent {width:1000px; margin:0px auto;}
.loginLeft {width:595px; float:left;}
@ -1628,3 +1628,156 @@ ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
span.shadowbox_news_user{ color:#3b94d6;}
a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px; color:#3b94d6; text-align:center;border-top:1px solid #eee;}
/* 新版登录注册 */
.mr45{ margin-right:45px;}
.mt100{ margin-top:100px;}
.mt50{ margin-top:50px;}
.new_login{
width:100%;
height:524px;
background-color:#1065bd;
}
.new_login_con{
width:1000px;
height:524px;
margin:0 auto;
background:url(../images/login/bg_login.jpg) 0 0 no-repeat;
}
.new_login_box{
background:#FFF;
width:265px;
padding:20px 15px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
-o-border-radius:5px;
border-radius:5px;
background-color: rgba(255,255,255,0.3);
}
.new_login_h2{
font-size:18px;
color:#fff;
border-bottom:1px solid #fff;
font-weight:normal;
padding-bottom:5px;
margin-bottom:30px;
}
.new_login_h2 a{
font-size:12px;
color:#fff;
background:url(../images/login/icons_login.png) 0 -69px no-repeat;
padding-left:10px;
}
input.new_loggin_input{
width:250px;
height:45px;
background:#fff;
-webkit-border-radius:5px;
-moz-border-radius:5px;
-o-border-radius:5px;
border-radius:5px;
border:none;
padding-left:15px;
margin-bottom:2px;
}
input.new_login_users{
background:#fff url(../images/login/icons_login.png) 8px 9px no-repeat;
width:215px;
height:45px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
-o-border-radius:5px;
border-radius:5px;
border:none;
padding-left:50px;
margin-bottom:2px;
}
input.new_login_lock{
background:#fff url(../images/login/icons_login.png) 8px -28px no-repeat;
width:215px;
height:45px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
-o-border-radius:5px;
border-radius:5px;
border:none;
padding-left:50px;
margin-bottom:2px;
}
.new_login_form ul li{
margin-bottom:15px;
}
.new_login_error{
color:#c00202;
}
.new_login_submit_disable{
width:265px;
height:40px;
line-height: 40px;
background:#ccc;
color:#fff;
font-size:14px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
-o-border-radius:5px;
border-radius:5px;
border:none;
text-align:center;
cursor:pointer;
vertical-align: middle;
}
.new_login_submit{
width:265px;
height:40px;
line-height: 40px;
background:#f27d0d;
color:#fff;
font-size:14px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
-o-border-radius:5px;
border-radius:5px;
border:none;
text-align:center;
cursor:pointer;
vertical-align: middle;
}
.new_login_check{
width:15px;
height:15px;
border:1px solid #fff;
border-style:none;
margin-right:5px;
vertical-align: -2px;
}
.new_login_form label{ color:#fff;}
.new_login_form a{ color:#fff; text-decoration:underline;}
.new_register{
width:100%;
height:580px;
background-color:#1065bd;
}
.new_register_con{
width:1000px;
height:580px;
margin:0 auto;
background:url(../images/login/bg_register.jpg) 0 0 no-repeat;
}
.new_login_txt{
width:282px;
height:140px;
padding:30px 12px 0;
color:#fff;
margin:235px 0 0 165px;
}
.new_login_txt h3{
font-size:18px;
text-align:center;
margin-bottom:20px;
}
.new_login_txt p{
line-height:2.0;
}
.new_register_left{
margin-top:250px;
}

View File

@ -1,6 +1,6 @@
/* 门户首页 */
#por_header{ width:100%; }
.por_header_top{ width:100%; height:70px; background:#3b94d6; }
.por_header_top{ width:100%; height:70px; background:#1065bd; }
.por_header_con{ width:1000px; margin:0 auto; height:70px; }
.por_logo{ margin-top:5px;}
.por_login li{ float:left;}

View File

@ -515,13 +515,13 @@ a.uploadIcon {background:url(../images/resource_icon_list.png) 8px -60px no-repe
/*新个人主页框架css*/
.navContainer {width:100%; margin:0 auto; background-color:#3b94d6;}
.navContainer {width:100%; margin:0 auto; background-color:#1065bd;}
.homepageContentContainer {width:100%; margin:0 auto; background-color:#eaebed;}
.homepageContent {width:1000px; background-color:#eaebed; margin:0 auto;}
.navHomepage {width:1000px; height:54px; background-color:#3b94d6; margin:0 auto;}
.navHomepage {width:1000px; height:54px; background-color:#1065bd; margin:0 auto;}
.navHomepageLogo {width:60px; height:54px; line-height:54px; vertical-align:middle; margin-left:2px; margin-right:30px;}
.navHomepageMenu {margin-right:20px; display:inline-block;height:54px; line-height:54px; vertical-align:middle;}
.navHomepageMenu:hover {background-color:#297fb8;}
.navHomepageMenu:hover {background-color:#05488e;}
.navHomepageSearchBoxcontainer {margin-top:11px; }
.navHomepageSearchBox {width:380px; border:none; outline:none; height:32px; background-color:#ffffff;}
.navHomepageSearchInput {width:345px; height:32px; outline:none; border:none; float:left; padding-left:5px;; margin:0;}