修改《修改资料》中英文不对称的bug,见缺陷http://forge.trustie.net/issues/1846_Trustie-Forge(1328-1418)

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2014-10-27 17:30:20 +08:00
parent 72ed73fb05
commit cc81695bc3
1 changed files with 45 additions and 3 deletions

View File

@ -171,6 +171,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 +179,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>
@ -499,15 +501,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;
}
}