|
|
|
@ -3,6 +3,7 @@
|
|
|
|
|
@nav_dispaly_main_project_label = 1
|
|
|
|
|
@nav_dispaly_main_contest_label = 1 %>
|
|
|
|
|
<% @nav_dispaly_forum_label = 1%>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(document).ready(
|
|
|
|
|
function () {
|
|
|
|
@ -43,6 +44,7 @@
|
|
|
|
|
<%= labelled_form_for :user, @user,
|
|
|
|
|
:url => {:action => "account"},
|
|
|
|
|
:html => {:id => 'my_account_form',
|
|
|
|
|
|
|
|
|
|
:method => :post} do |f| %>
|
|
|
|
|
<fieldset class="collapsible collapsed" style="width:800px;margin-left: 10px;">
|
|
|
|
|
<legend onclick="toggleFieldset(this);">
|
|
|
|
@ -60,7 +62,7 @@
|
|
|
|
|
</legend>
|
|
|
|
|
|
|
|
|
|
<!-- 昵称 -->
|
|
|
|
|
<p style="width:630px;padding-left: 26px;">
|
|
|
|
|
<p style="width:630px;padding-left: 54px;">
|
|
|
|
|
<%= f.text_field :login, :required => true, :size => 25, :name => "login"%>
|
|
|
|
|
<span class='font_lighter'><%= l(:label_max_number) %></span>
|
|
|
|
|
<br/>
|
|
|
|
@ -68,13 +70,13 @@
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<span id='name' style='display:none'>
|
|
|
|
|
<p style="width:530px;padding-left: 26px;">
|
|
|
|
|
<p style="width:530px;padding-left: 54px;">
|
|
|
|
|
<%= f.text_field :lastname, :size => 25, :required => true %>
|
|
|
|
|
<span class='font_lighter'>
|
|
|
|
|
<%= l(:field_lastname_eg) %>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
<p style="width:530px;padding-left: 26px;">
|
|
|
|
|
<p style="width:530px;padding-left: 54px;">
|
|
|
|
|
<%= f.text_field :firstname, :size => 25, :required => true %>
|
|
|
|
|
<span class='font_lighter'>
|
|
|
|
|
<%= l(:field_firstname_eg) %>
|
|
|
|
@ -83,7 +85,7 @@
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<span id='enterprise' style='display:none'>
|
|
|
|
|
<p style="width:400px;padding-left: 26px;">
|
|
|
|
|
<p style="width:400px;padding-left: 54px;">
|
|
|
|
|
<%= l(:label_company_name)%>
|
|
|
|
|
<%= text_field_tag :enterprise_name, @user.firstname %>
|
|
|
|
|
</p>
|
|
|
|
@ -92,18 +94,18 @@
|
|
|
|
|
<!-- added by bai 增加账户里的性别-->
|
|
|
|
|
<span id='gender' style='display:none'>
|
|
|
|
|
<% if @user.user_extensions.nil? %>
|
|
|
|
|
<p style="width:400px;padding-left: 26px;">
|
|
|
|
|
<p style="width:400px;padding-left: 54px;">
|
|
|
|
|
<%= l(:label_gender) %>
|
|
|
|
|
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
|
|
|
|
|
</p>
|
|
|
|
|
<% else %>
|
|
|
|
|
<% if @user.user_extensions.gender == 0 %><!-- label_gender_male -->
|
|
|
|
|
<p style="width:400px;padding-left: 26px;">
|
|
|
|
|
<p style="width:400px;padding-left: 54px;">
|
|
|
|
|
<%= l(:label_gender) %>
|
|
|
|
|
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
|
|
|
|
|
</p>
|
|
|
|
|
<% else %>
|
|
|
|
|
<p style="width:400px;padding-left: 26px;">
|
|
|
|
|
<p style="width:400px;padding-left: 54px;">
|
|
|
|
|
<%= l(:label_gender) %>
|
|
|
|
|
<%= select_tag 'gender', "<option value = '0'>#{l(:label_gender_male)}</option><option value = '1' selected='selected'>#{l(:label_gender_female)}</option>".html_safe, :class => 'gender' %>
|
|
|
|
|
</p>
|
|
|
|
@ -112,17 +114,24 @@
|
|
|
|
|
</span>
|
|
|
|
|
<!-- added by Wen -->
|
|
|
|
|
<p style="padding-left: 26px;">
|
|
|
|
|
<% if User.current.user_extensions.school.nil? %>
|
|
|
|
|
<%= l(:field_occupation) %>
|
|
|
|
|
<span class="required">*</span>
|
|
|
|
|
<input id="province" name="province" type="text" value="请单击选择省份及学校" readonly>
|
|
|
|
|
<input id="occupation" name="occupation" type="hidden"/>
|
|
|
|
|
<input id="occupation_name" type="text" readonly/>
|
|
|
|
|
<% unless @user.user_extensions.identity == 2 %>
|
|
|
|
|
<%= l(:field_occupation) %>
|
|
|
|
|
<span class="required">*</span>
|
|
|
|
|
<% if User.current.user_extensions.identity == 3 %>
|
|
|
|
|
<input id="province" name="province" style="display: none" type="text" value="请单击选择省份及学校" readonly>
|
|
|
|
|
<input id="occupation" name="occupation" style="display: none" type="text" value="<%= @user.user_extensions.occupation %>" />
|
|
|
|
|
<input id="occupation_name" type="text" style="display: none" readonly/>
|
|
|
|
|
<% elsif User.current.user_extensions.school.nil? %>
|
|
|
|
|
|
|
|
|
|
<input id="province" name="province" style="display: none" type="text" value="请单击选择省份及学校" readonly>
|
|
|
|
|
<input id="occupation" name="occupation" style="display: none" type="text" />
|
|
|
|
|
<input id="occupation_name" type="text" style="display: none" readonly/>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= l(:field_occupation) %> <span class="required">*</span>
|
|
|
|
|
<input id="province" name="province" type="text" value="<%= User.current.user_extensions.school.province %>" readonly/>
|
|
|
|
|
<input id="occupation" name="occupation" type="hidden" value="<%= User.current.user_extensions.school.id %>"/>
|
|
|
|
|
<input id="occupation_name" type="text" value="<%= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>
|
|
|
|
|
|
|
|
|
|
<input id="province" name="province" style="display: none" type="text" value="<%= User.current.user_extensions.school.province %>" readonly/>
|
|
|
|
|
<input id="occupation" name="occupation" type="text" style="display: none" value="<%= User.current.user_extensions.school.id %>"/>
|
|
|
|
|
<input id="occupation_name" type="text" style="display: none" value="<%= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
@ -168,17 +177,19 @@
|
|
|
|
|
<%= f.text_field :mail, :required => true %>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p style="width:426px;padding-left:26px;">
|
|
|
|
|
<p style="width:426px;padding-left:54px;">
|
|
|
|
|
<%= f.select :language, :Chinese => :zh, :English => :en %>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<% province = User.current.user_extensions.location %>
|
|
|
|
|
<% city = User.current.user_extensions.location_city %>
|
|
|
|
|
<% identity = User.current.user_extensions.identity %>
|
|
|
|
|
<% title = User.current.user_extensions.technical_title %>
|
|
|
|
|
<% language = User.current.language %>
|
|
|
|
|
<% 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 %>
|
|
|
|
|
<script type="text/javascript" language="javascript">
|
|
|
|
|
$().ready(function () {
|
|
|
|
|
var province = "<%= "#{province}" %>"
|
|
|
|
@ -187,12 +198,14 @@
|
|
|
|
|
var identity = "<%= "#{identity}" %>"
|
|
|
|
|
var title = "<%= "#{title}" %>"
|
|
|
|
|
var language = "<%= "#{language}" %>"
|
|
|
|
|
var occupation1 = "<%= "#{occupation}" %>"
|
|
|
|
|
|
|
|
|
|
init_identity_and_title(document.getElementById('userIdentity'), identity, document.getElementById('userTechnical_title'), title, language);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<p style="width:400px;padding-left: 26px;"><%= l(:label_location) %>
|
|
|
|
|
<p style="width:400px;padding-left: 58px;"><%= l(:label_location) %>
|
|
|
|
|
<select onchange="showcity(this.value, document.getElementById('userCity'));" name="province" id="userProvince" class="location">
|
|
|
|
|
<option value="">--请选择省份--</option>
|
|
|
|
|
<option value="北京">北京</option>
|
|
|
|
@ -237,7 +250,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<% unless @user.user_extensions.identity == 2 %>
|
|
|
|
|
<p style="width:400px;padding-left: 26px;">
|
|
|
|
|
<p style="width:400px;padding-left: 54px;">
|
|
|
|
|
<%= l(:label_identity) %>
|
|
|
|
|
<select onchange="showtechnical_title(this.value, $('#userTechnical_title'));" name="identity" id="userIdentity" class="location">
|
|
|
|
|
<option value="">
|
|
|
|
@ -528,6 +541,7 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
@ -590,6 +604,9 @@
|
|
|
|
|
$('#name').show()
|
|
|
|
|
$('#enterprise').hide()
|
|
|
|
|
$('#gender').show()
|
|
|
|
|
$('input#province').show()
|
|
|
|
|
$('input#occupation_name').show()
|
|
|
|
|
$('input#occupation').hide()
|
|
|
|
|
var technical_titleOptions = new Array(
|
|
|
|
|
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
|
|
|
|
|
break;
|
|
|
|
@ -600,7 +617,12 @@
|
|
|
|
|
$('#name').show()
|
|
|
|
|
$('#enterprise').hide()
|
|
|
|
|
$('#gender').show()
|
|
|
|
|
var titleOptions = new Array("");
|
|
|
|
|
$('input#province').show()
|
|
|
|
|
$('input#occupation_name').show()
|
|
|
|
|
$('input#occupation').hide()
|
|
|
|
|
var technical_titleOptions = new Array(
|
|
|
|
|
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case '2' :
|
|
|
|
@ -609,7 +631,26 @@
|
|
|
|
|
$('#name').hide()
|
|
|
|
|
$('#enterprise').show()
|
|
|
|
|
$('#gender').hide()
|
|
|
|
|
var titleOptions = new Array("");
|
|
|
|
|
$('input#province').show()
|
|
|
|
|
$('input#occupation_name').show()
|
|
|
|
|
$('input#occupation').hide()
|
|
|
|
|
var technical_titleOptions = new Array(
|
|
|
|
|
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case '3':
|
|
|
|
|
$('#technical_title').hide()
|
|
|
|
|
$('#no').hide()
|
|
|
|
|
$('#name').show()
|
|
|
|
|
$('#enterprise').hide()
|
|
|
|
|
$('#gender').show()
|
|
|
|
|
$('input#province').hide()
|
|
|
|
|
$('input#occupation_name').hide()
|
|
|
|
|
$('input#occupation').show()
|
|
|
|
|
// document.getElementById("occupation").value = "";
|
|
|
|
|
var technical_titleOptions = new Array(
|
|
|
|
|
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
$('#technical_title').hide()
|
|
|
|
@ -617,7 +658,9 @@
|
|
|
|
|
$('#name').show()
|
|
|
|
|
$('#enterprise').hide()
|
|
|
|
|
$('#gender').show()
|
|
|
|
|
var titleOptions = new Array("");
|
|
|
|
|
var technical_titleOptions = new Array(
|
|
|
|
|
"<%= l(:label_technicl_title_professor) %>", "<%= l(:label_technicl_title_associate_professor) %>", "<%= l(:label_technicl_title_lecturer) %>", "<%= l(:label_technicl_title_teaching_assistant) %>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|