From 8fb82bbdc41966e6d04fae8d7ed6d78d3bca4e61 Mon Sep 17 00:00:00 2001 From: yanxd Date: Wed, 4 Jun 2014 14:20:26 +0800 Subject: [PATCH] register Mod --- app/models/user.rb | 1 + app/views/account/register.html.erb | 756 +++++++++++++++------------- 2 files changed, 398 insertions(+), 359 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index aef29f18e..d79cf11e1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -137,6 +137,7 @@ class User < Principal has_one :user_extensions,:dependent => :destroy ## end + #default_scope -> { includes(:user_extensions, :user_score) } scope :teacher, -> { joins(:user_extensions).where('user_extensions.identity = ?', UserExtensions::TEACHER) } diff --git a/app/views/account/register.html.erb b/app/views/account/register.html.erb index cc7a26ad8..fac05e6de 100644 --- a/app/views/account/register.html.erb +++ b/app/views/account/register.html.erb @@ -1,409 +1,447 @@ -

<%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %>

+

<%= l(:label_register) %> <%= link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %>

<%= labelled_form_for @user, :url => register_path do |f| %> -<%= error_messages_for 'user' %> + <%= error_messages_for 'user' %> -
-

- - + +
<%= l(:label_identity) %> * - -
+

+ <% if @user.auth_source_id.nil? %> +

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

-<% if @user.auth_source_id.nil? %> -

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

-

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

+

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

-

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

-<% end %> -
+

+ + + + + + +
+ <%= l(:label_location) %> * + + + + +
+

+ + -

<%= submit_tag l(:button_submit) %>

+

+ + + + +
<%= submit_tag l(:button_submit) %>
+

<% end %> <% if Setting.openid? %> -

<%= f.text_field :identity_url %>

+

<%= f.text_field :identity_url %>

<% end %> -<% @user.custom_field_values.select {|v| v.editable? || v.required?}.each do |value| %> -

<%= custom_field_tag_with_label :user, value %>

+<% @user.custom_field_values.select { |v| v.editable? || v.required? }.each do |value| %> +

<%= custom_field_tag_with_label :user, value %>

<% end %> \ No newline at end of file