From b2ce8c78bded95c1fde65034fc6bff9eaf58dba3 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Wed, 19 Nov 2014 17:25:10 +0800 Subject: [PATCH] =?UTF-8?q?<=E4=BF=AE=E6=94=B9=E8=B5=84=E6=96=99>=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2<=E8=AF=BE=E7=A8=8B=E6=88=90=E5=91=98>?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E5=90=8E=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E4=BF=AE=E6=94=B9=20Signed-off-by:=20alan=20?= =?UTF-8?q?<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 2 +- app/views/account/register.html.erb | 9 +- app/views/courses/settings/_members.html.erb | 4 +- app/views/my/account.html.erb | 113 ++++++++++++++----- app/views/settings/_general.html.erb | 28 ++--- app/views/settings/_notifications.html.erb | 2 +- app/views/stores/search.html.erb | 2 +- app/views/versions/_form.html.erb | 4 +- config/locales/zh.yml | 14 ++- public/stylesheets/application.css | 9 +- 10 files changed, 128 insertions(+), 59 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 4b5a8c064..2c4929019 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -136,7 +136,7 @@ class AccountController < ApplicationController session[:auth_source_registration] = nil self.logged_user = @user flash[:notice] = l(:notice_account_activated) - render :action => 'email_valid' + redirect_to my_account_path end else @user.login = params[:user][:login] diff --git a/app/views/account/register.html.erb b/app/views/account/register.html.erb index a18c15068..32940d111 100644 --- a/app/views/account/register.html.erb +++ b/app/views/account/register.html.erb @@ -17,10 +17,10 @@ <% if @user.auth_source_id.nil? %>

<%= f.text_field :login, :size => 25, :required => true %> - <%= l(:label_max_number) %> + <%= l(:label_max_number) %>

<%= f.password_field :password, :size => 25, :required => true %> - <%= l(:text_caracters_minimum, :count => Setting.password_min_length) %> + <%= l(:text_caracters_minimum, :count => Setting.password_min_length) %>

<%= f.password_field :password_confirmation, :size => 25, :required => true %>

<% end %> @@ -30,7 +30,10 @@

- <%= "#{l(:label_mail_attention)} " %> + +

<%= "#{l(:label_mail_attention)} " %>

+

<%= "#{l(:label_mail_attention1)} " %>

+

diff --git a/app/views/courses/settings/_members.html.erb b/app/views/courses/settings/_members.html.erb index ab0f20257..e73e9cf7b 100644 --- a/app/views/courses/settings/_members.html.erb +++ b/app/views/courses/settings/_members.html.erb @@ -20,8 +20,8 @@ <% members.each do |member| %> <% next if member.new_record? %> - <%= link_to_user member.principal %> - + <%= link_to_user member.principal %> + <%= h member.roles.sort.collect(&:to_s).join(', ') %> diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 4ffcc63fc..04793a02e 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -9,6 +9,47 @@ function () { $("#province").attr("href", "#WOpenWindow") $("#province").leanModal({top: 100, closeButton: ".modal_close"}); + var $lastname = $('#user_lastname') + var $firstname = $('#user_firstname') + var $enterprise = $('#enterprise_name') + $lastname.blur(function () { + var pas1 = document.getElementById("user_lastname").value; + + if (pas1 == "") { + $('#valid_lastname').html('' + "<%= l(:lastname_empty) %>"+ ""); + $('#lastname_limit').hide(); + } + else { + $('#valid_lastname').html('' + ""); + $('#lastname_limit').show(); + } + + }); + $firstname.blur(function () { + var pas1 = document.getElementById("user_firstname").value; + + if (pas1 == "") { + $('#valid_firstname').html('' + "<%= l(:firstname_empty) %>"+ ""); + $('#firstname_limit').hide(); + } + else { + $('#valid_firstname').html('' + ""); + $('#firstname_limit').show(); + } + }); + $enterprise.blur(function () { + var pas1 = document.getElementById("enterprise_name").value; + + if (pas1 == "") { + $('#valid_companyname').html('' + "<%= l(:enterprise_empty) %>"+ ""); + + } + else { + $('#valid_lastname').html('' + ""); + + } + + }); } ); @@ -61,16 +102,19 @@ <%= l(:label_information_plural) %> + +

- <%= f.text_field :login, :required => true, :size => 25, :name => "login"%> + <%= f.text_field :login, :required => true, :size => 25, :name => "login", :readonly => true %> <%= l(:label_max_number) %>

-

- <%= l(:label_identity) %> * - @@ -93,34 +137,38 @@ <% end %> +

-
@@ -152,11 +200,16 @@ -
@@ -213,7 +266,7 @@ -

+

<%= f.text_field :mail, :required => true %>

@@ -222,14 +275,22 @@

- - <% province = User.current.user_extensions.location %> - <% city = User.current.user_extensions.location_city %> - <% identity = User.current.user_extensions.identity %> - <% occupation1 = User.current.user_extensions.occupation %> - <% occupation = User.current.user_extensions.occupation %> - <% title = User.current.user_extensions.technical_title %> - <% language = User.current.language %> + <% if !User.current.user_extensions.nil? %> + <% province = User.current.user_extensions.location %> + <% city = User.current.user_extensions.location_city %> + <% identity = User.current.user_extensions.identity %> + <% occupation1 = User.current.user_extensions.occupation %> + <% occupation = User.current.user_extensions.occupation %> + <% title = User.current.user_extensions.technical_title %> + <% language = User.current.language %> + <% else %> + <% province = "湖南省" %> + <% city = "长沙"%> + <% identity = ""%> + <% occupation1 = ""%> + <% title = "" %> + <% language = ""%> + <% end %> -

<%= l(:label_location) %> +