2014-09-28 17:14:09 +08:00
|
|
|
<% @nav_dispaly_home_path_label = 1
|
|
|
|
@nav_dispaly_main_course_label = 1
|
|
|
|
@nav_dispaly_main_project_label = 1
|
|
|
|
@nav_dispaly_main_contest_label = 1 %>
|
|
|
|
<% @nav_dispaly_forum_label = 1%>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- end -->
|
|
|
|
|
|
|
|
<h3><%= l(:label_register) %> <%= link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h3>
|
|
|
|
|
|
|
|
<%= labelled_form_for @user, :url => register_path do |f| %>
|
|
|
|
<%= error_messages_for 'user' %>
|
|
|
|
<div class="box tabular">
|
2014-11-10 16:08:41 +08:00
|
|
|
|
2014-09-28 17:14:09 +08:00
|
|
|
<% if @user.auth_source_id.nil? %>
|
|
|
|
<p><%= f.text_field :login, :size => 25, :required => true %><span id="valid_user_login"></span>
|
2014-11-19 17:25:10 +08:00
|
|
|
<em class="info" style="color: #acaeb1"><%= l(:label_max_number) %></em>
|
2014-09-28 17:14:09 +08:00
|
|
|
</p>
|
2014-11-21 16:27:20 +08:00
|
|
|
<p><%= f.password_field :password, :size => 25, :required => true %><span id="valid_user_password"></span>
|
2014-11-19 17:25:10 +08:00
|
|
|
<em class="info" style="color: #acaeb1"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em>
|
2014-09-28 17:14:09 +08:00
|
|
|
</p>
|
2014-11-20 17:08:10 +08:00
|
|
|
<p><%= f.password_field :password_confirmation, :size => 25, :required => true %><span id="valid_password" style="padding-left: 10px;"></span></p>
|
2014-09-28 17:14:09 +08:00
|
|
|
<% end %>
|
2014-11-10 16:08:41 +08:00
|
|
|
|
2014-09-28 17:14:09 +08:00
|
|
|
<p>
|
2014-11-13 09:14:40 +08:00
|
|
|
<%= f.text_field :mail,:size => 25, :required => true %>
|
2014-11-20 17:08:10 +08:00
|
|
|
<span id="valid_user_mail" ></span>
|
2014-09-28 17:14:09 +08:00
|
|
|
</p>
|
|
|
|
<p>
|
2014-11-19 17:25:10 +08:00
|
|
|
<em class="info" style="color: #acaeb1">
|
|
|
|
<p><%= "#{l(:label_mail_attention)} " %></p>
|
|
|
|
<p><%= "#{l(:label_mail_attention1)} " %></p>
|
|
|
|
</em>
|
2014-09-28 17:14:09 +08:00
|
|
|
</p>
|
|
|
|
|
2014-11-10 16:08:41 +08:00
|
|
|
|
|
|
|
|
2014-09-28 17:14:09 +08:00
|
|
|
<!-- end -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td><%= submit_tag l(:button_submit) %></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</p>
|
|
|
|
<% end %>
|
|
|
|
<% if Setting.openid? %>
|
|
|
|
<p><%= f.text_field :identity_url %></p>
|
|
|
|
<% end %>
|
|
|
|
<% @user.custom_field_values.select { |v| v.editable? || v.required? }.each do |value| %>
|
|
|
|
<p><%= custom_field_tag_with_label :user, value %></p>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2014-11-21 16:27:20 +08:00
|
|
|
<% password_min_length = Setting.password_min_length %>
|
2014-09-28 17:14:09 +08:00
|
|
|
<script type="text/javascript">
|
|
|
|
jQuery(document).ready(function () {
|
|
|
|
var $login = $('#user_login')
|
|
|
|
var $mail = $('#user_mail')
|
2014-11-21 16:27:20 +08:00
|
|
|
var $password = $('#user_password')
|
2014-11-10 16:08:41 +08:00
|
|
|
var $password_confirmation = $('#user_password_confirmation')
|
2014-09-28 17:14:09 +08:00
|
|
|
$login.blur(function (event) {
|
|
|
|
if ($(this).is('#user_login')) {
|
|
|
|
$.get(
|
|
|
|
'<%=account_valid_ajax_path%>',
|
|
|
|
{ valid: "login",
|
|
|
|
value: this.value },
|
|
|
|
function (data) {
|
|
|
|
if (data.valid) {
|
|
|
|
$('#valid_user_login').html('<span class="green">' + data.message + "</span>");
|
|
|
|
} else {
|
|
|
|
$('#valid_user_login').html('<span class="red">' + data.message + "</span>");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
;
|
|
|
|
});
|
|
|
|
|
|
|
|
$mail.blur(function (event) {
|
|
|
|
if ($(this).is('#user_mail')) {
|
|
|
|
$.get('<%=account_valid_ajax_path%>',
|
|
|
|
{ valid: "mail",
|
|
|
|
value: this.value },
|
|
|
|
function (data) {
|
|
|
|
if (data.valid) {
|
|
|
|
$('#valid_user_mail').html('<span class="green">' + data.message + "</span>");
|
|
|
|
} else {
|
|
|
|
$('#valid_user_mail').html('<span class="red">' + data.message + "</span>");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
;
|
2014-11-21 16:27:20 +08:00
|
|
|
});
|
|
|
|
$password.blur(function () {
|
|
|
|
var pas1 = document.getElementById("user_password").value;
|
|
|
|
var password_min_length = <%= password_min_length %>
|
|
|
|
if (pas1.length >= password_min_length) {
|
|
|
|
|
|
|
|
$('#valid_user_password').html('<span class="green">'+ "</span>");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('#valid_user_password').html('<span class="red">' + "<%= l(:setting_password_min_length_limit, :count => password_min_length) %>" + "</span>");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-10 16:08:41 +08:00
|
|
|
});
|
|
|
|
$password_confirmation.blur(function () {
|
2014-11-21 16:27:20 +08:00
|
|
|
var password_min_length = <%= password_min_length %>
|
2014-11-10 16:08:41 +08:00
|
|
|
var pas1 = document.getElementById("user_password").value;
|
|
|
|
var pas2 = document.getElementById("user_password_confirmation").value;
|
2014-11-21 16:27:20 +08:00
|
|
|
if (pas1.length >= password_min_length && pas1 == pas2 ) {
|
2014-11-10 16:08:41 +08:00
|
|
|
$('#valid_password').html('<span class="green">' + "<%= l(:setting_password_success) %>"+ "</span>");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('#valid_password').html('<span class="red">' + "<%= l(:setting_password_error) %>" + "</span>");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-28 17:14:09 +08:00
|
|
|
});
|
|
|
|
});
|
2014-05-10 09:22:45 +08:00
|
|
|
</script>
|