diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb index fcfbe8422..4c29bc673 100644 --- a/app/views/account/login.html.erb +++ b/app/views/account/login.html.erb @@ -2,32 +2,6 @@ <%= stylesheet_link_tag 'leftside'%> -
+ +
+
+<%# 注册 %> +
+
+ + @@ -234,62 +206,9 @@
-
-
- -
  欢迎加入Trustie创新实践社区!在这里,您的创新意识和创新潜力将得到充分发挥!目前已有超过200所高校和科研机构在平台中开展在线协同开发、协同学习和协同研究。

  Trustie社区的理想是:让创新过程变的更美好!
-
-
-
-
-
    -
  • 登录
  • -
  • -
-
-
<%= flash.empty? || flash[:error].nil? ? "" : flash[:error].html_safe %>
-
-
- - <%= form_tag(signin_path,:id=>'main_login_form',:method=>'post') do %> - <%= back_url_hidden_field_tag %> -
- <%= text_field_tag 'username', params[:username], :tabindex => '1' , - :class=>'loginSignBox',:placeholder=>'请输入邮箱地址或登录名', :onkeypress => "user_name_keypress(event);"%> - -
- <% if Setting.openid? %> -
- <%= text_field_tag "openid_url", nil, :tabindex => '3',:placeholder=>'请输入OpenId URL' %> -
- <% end %> -
- - <%= password_field_tag 'password', nil, :tabindex => '2',:class=>'loginSignBox' ,:placeholder=>'请输密码', :onkeypress => "user_name_keypress(event);"%> -
-
- <% if Setting.autologin? %> -
- <%= check_box_tag 'autologin', 1, true, :tabindex => 4 %> -
- <%= l(:label_stay_logged_in) %> - <% end %> - - <% if Setting.lost_password? %> - 忘记密码? - <% end %> -
- <% end %> -
- 登录 -
- -
- -
    diff --git a/app/views/layouts/login.html.erb b/app/views/layouts/login.html.erb index 2c14ee0ad..18fbcfcd5 100644 --- a/app/views/layouts/login.html.erb +++ b/app/views/layouts/login.html.erb @@ -9,11 +9,12 @@ <%= favicon %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_user', 'user_leftside', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> + <%= javascript_heads %> + <%= javascript_include_tag "bootstrap","avatars","new_user"%> <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> - + <%= yield %>
    -<%= javascript_heads %> -<%= javascript_include_tag "bootstrap","avatars","new_user"%> <%= render :partial => 'layouts/footer' %>
    <%= call_hook :view_layouts_base_body_bottom %> diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index b6301afad..f5f0d78f0 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -627,4 +627,52 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { addEvent(elem2, 'input', change); addEvent(elem2, 'focus', change); change(); -}; \ No newline at end of file +}; + +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'); + } +} + +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(); + } +} \ No newline at end of file