|
|
|
@ -35,7 +35,9 @@
|
|
|
|
|
<%= call_hook(:view_my_account_contextual, :user => @user) %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<h3 style="padding-left: 10px;"><%= l(:label_my_account) %></h3>
|
|
|
|
|
<h3 style="padding-left: 10px;">
|
|
|
|
|
<%= l(:label_my_account) %>
|
|
|
|
|
</h3>
|
|
|
|
|
<%= error_messages_for 'user' %>
|
|
|
|
|
<fieldset class="box" style="margin:10px;">
|
|
|
|
|
<%= labelled_form_for :user, @user,
|
|
|
|
@ -68,17 +70,22 @@
|
|
|
|
|
<span id='name' style='display:none'>
|
|
|
|
|
<p style="width:530px;padding-left: 26px;">
|
|
|
|
|
<%= f.text_field :lastname, :required => true %>
|
|
|
|
|
<span class='font_lighter'><%= l(:field_lastname_eg) %></span>
|
|
|
|
|
<span class='font_lighter'>
|
|
|
|
|
<%= l(:field_lastname_eg) %>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
<p style="width:530px;padding-left: 26px;">
|
|
|
|
|
<%= f.text_field :firstname, :required => true %>
|
|
|
|
|
<span class='font_lighter'><%= l(:field_firstname_eg) %></span>
|
|
|
|
|
<span class='font_lighter'>
|
|
|
|
|
<%= l(:field_firstname_eg) %>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<span id='enterprise' style='display:none'>
|
|
|
|
|
<p style="width:400px;padding-left: 26px;">
|
|
|
|
|
<%= l(:label_company_name)%><%= text_field_tag :enterprise_name, @user.firstname %>
|
|
|
|
|
<%= l(:label_company_name)%>
|
|
|
|
|
<%= text_field_tag :enterprise_name, @user.firstname %>
|
|
|
|
|
</p>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
@ -171,6 +178,7 @@
|
|
|
|
|
<% city = User.current.user_extensions.location_city %>
|
|
|
|
|
<% identity = User.current.user_extensions.identity %>
|
|
|
|
|
<% title = User.current.user_extensions.technical_title %>
|
|
|
|
|
<% language = User.current.language %>
|
|
|
|
|
<script type="text/javascript" language="javascript">
|
|
|
|
|
$().ready(function () {
|
|
|
|
|
var province = "<%= "#{province}" %>"
|
|
|
|
@ -178,7 +186,8 @@
|
|
|
|
|
init_province_and_city(document.getElementById('userProvince'), province, document.getElementById('userCity'), city);
|
|
|
|
|
var identity = "<%= "#{identity}" %>"
|
|
|
|
|
var title = "<%= "#{title}" %>"
|
|
|
|
|
init_identity_and_title(document.getElementById('userIdentity'), identity, document.getElementById('userTechnical_title'), title);
|
|
|
|
|
var language = "<%= "#{language}" %>"
|
|
|
|
|
init_identity_and_title(document.getElementById('userIdentity'), identity, document.getElementById('userTechnical_title'), title, language);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
@ -230,11 +239,19 @@
|
|
|
|
|
<% unless @user.user_extensions.identity == 2 %>
|
|
|
|
|
<p style="width:400px;padding-left: 26px;">
|
|
|
|
|
<%= l(:label_identity) %>
|
|
|
|
|
<select onchange="showtechnical_title(this.value, document.getElementById('userTechnical_title'));" name="identity" id="userIdentity" class="location">
|
|
|
|
|
<option value=""><%= l(:label_account_identity_choose) %></option>
|
|
|
|
|
<option value="0"><%= l(:label_account_identity_teacher) %></option>
|
|
|
|
|
<option value="1"><%= l(:label_account_identity_student) %></option>
|
|
|
|
|
<option value="3"><%= l(:label_account_identity_developer) %></option>
|
|
|
|
|
<select onchange="showtechnical_title(this.value, $('#userTechnical_title'));" name="identity" id="userIdentity" class="location">
|
|
|
|
|
<option value="">
|
|
|
|
|
<%= l(:label_account_identity_choose) %>
|
|
|
|
|
</option>
|
|
|
|
|
<option value="0">
|
|
|
|
|
<%= l(:label_account_identity_teacher) %>
|
|
|
|
|
</option>
|
|
|
|
|
<option value="1">
|
|
|
|
|
<%= l(:label_account_identity_student) %>
|
|
|
|
|
</option>
|
|
|
|
|
<option value="3">
|
|
|
|
|
<%= l(:label_account_identity_developer) %>
|
|
|
|
|
</option>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
<span id='technical_title' style='display:none'>
|
|
|
|
@ -243,9 +260,9 @@
|
|
|
|
|
<span id='no' style='display:none'>
|
|
|
|
|
<!-- modified by fq -->
|
|
|
|
|
<% unless User.current.user_extensions.student_id.nil? %>
|
|
|
|
|
<%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => "请输入学号" %>
|
|
|
|
|
<%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => "请输入学号" %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= text_field_tag :no, nil, :placeholder => "请输入学号" %></span>
|
|
|
|
|
<%= text_field_tag :no, nil, :placeholder => "请输入学号" %></span>
|
|
|
|
|
<% end %>
|
|
|
|
|
<!-- end -->
|
|
|
|
|
</span>
|
|
|
|
@ -254,11 +271,21 @@
|
|
|
|
|
<p>
|
|
|
|
|
<span style="display:none">
|
|
|
|
|
<select onchange="showtechnical_title(this.value, document.getElementById('userTechnical_title'));" name="identity" id="userIdentity" class="location">
|
|
|
|
|
<option value=""><%= l(:label_account_identity_choose) %></option>
|
|
|
|
|
<option value="0"><%= l(:label_account_identity_teacher) %></option>
|
|
|
|
|
<option value="1"><%= l(:label_account_identity_student) %></option>
|
|
|
|
|
<option value="2"><%= l(:label_account_identity_enterprise) %></option>
|
|
|
|
|
<option value="3"><%= l(:label_account_identity_developer) %></option>
|
|
|
|
|
<option value="">
|
|
|
|
|
<%= l(:label_account_identity_choose) %>
|
|
|
|
|
</option>
|
|
|
|
|
<option value="0">
|
|
|
|
|
<%= l(:label_account_identity_teacher) %>
|
|
|
|
|
</option>
|
|
|
|
|
<option value="1">
|
|
|
|
|
<%= l(:label_account_identity_student) %>
|
|
|
|
|
</option>
|
|
|
|
|
<option value="2">
|
|
|
|
|
<%= l(:label_account_identity_enterprise) %>
|
|
|
|
|
</option>
|
|
|
|
|
<option value="3">
|
|
|
|
|
<%= l(:label_account_identity_developer) %>
|
|
|
|
|
</option>
|
|
|
|
|
</select>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
@ -267,7 +294,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<% if Setting.openid? %>
|
|
|
|
|
<p> <%= f.text_field :identity_url %> </p>
|
|
|
|
|
<p>
|
|
|
|
|
<%= f.text_field :identity_url %>
|
|
|
|
|
</p>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<% @user.custom_field_values.select(&:editable?).each do |value| %>
|
|
|
|
@ -499,15 +528,55 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function init_identity_and_title(pField, identity, cField, title) {
|
|
|
|
|
function init_identity_and_title(pField, identity, cField, title, language) {
|
|
|
|
|
for (var i = 0; i < pField.options.length; i++) {
|
|
|
|
|
if (pField.options[i].value == identity) {
|
|
|
|
|
pField.selectedIndex = i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
showtechnical_title(identity, cField);
|
|
|
|
|
|
|
|
|
|
if(language == 'zh') {
|
|
|
|
|
switch (title) {
|
|
|
|
|
case 'Professor' :
|
|
|
|
|
title1 = '教授';
|
|
|
|
|
break;
|
|
|
|
|
case 'Associate professor' :
|
|
|
|
|
title1 = '副教授';
|
|
|
|
|
break;
|
|
|
|
|
case 'Lecturer' :
|
|
|
|
|
title1 = '讲师';
|
|
|
|
|
break;
|
|
|
|
|
case 'Teaching assistant' :
|
|
|
|
|
title1 = '助教';
|
|
|
|
|
break;
|
|
|
|
|
default :
|
|
|
|
|
title1 = title;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
switch (title) {
|
|
|
|
|
case '教授' :
|
|
|
|
|
title1 = 'Professor';
|
|
|
|
|
break;
|
|
|
|
|
case '副教授' :
|
|
|
|
|
title1 = 'Associate professor';
|
|
|
|
|
break;
|
|
|
|
|
case '讲师' :
|
|
|
|
|
title1 = 'Lecturer';
|
|
|
|
|
break;
|
|
|
|
|
case '助教' :
|
|
|
|
|
title1 = 'Teaching assistant';
|
|
|
|
|
break;
|
|
|
|
|
default :
|
|
|
|
|
title1 = title;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < cField.options.length; i++) {
|
|
|
|
|
if (cField.options[i].value == title) {
|
|
|
|
|
if (cField.options[i].value == title1) {
|
|
|
|
|
cField.selectedIndex = i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|