|
|
|
@ -15,14 +15,13 @@
|
|
|
|
|
<%= error_messages_for 'user',@user.user_extensions %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<ul class="setting_left">
|
|
|
|
|
<li>登录名 : <span style="color:red;">*</span></li>
|
|
|
|
|
<li>邮箱 : <span style="color:red;">*</span></li>
|
|
|
|
|
<li>身份 : <span style="color:red;">*</span></li>
|
|
|
|
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">姓(Last Name) : <span style="color:red;">*</span></li>
|
|
|
|
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">名(First Name) : <span style="color:red;">*</span></li>
|
|
|
|
|
<li><span style="color:red;">*</span> 登录名 : </li>
|
|
|
|
|
<li><span style="color:red;">*</span> 邮箱 : </li>
|
|
|
|
|
<li><span style="color:red;">*</span> 职业 : </li>
|
|
|
|
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><span style="color:red;">*</span> 姓名 : </li>
|
|
|
|
|
<li nhname="tag" nh_tag_2="true" style="display:none;">组织名 : <span style="color:red;">*</span></li>
|
|
|
|
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">性别 : </li>
|
|
|
|
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">工作单位 : </li>
|
|
|
|
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><span style="color:red;">*</span> 性别 : </li>
|
|
|
|
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;" ><span style="color:red;">*</span> 单位名称 : </li>
|
|
|
|
|
<li>地区 : </li>
|
|
|
|
|
<li>邮件通知 : </li>
|
|
|
|
|
<!--<li>个人签名 : </li>-->
|
|
|
|
@ -65,33 +64,49 @@
|
|
|
|
|
<span id="identity_hint" style="display: none"></span>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= f.text_field :lastname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>
|
|
|
|
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= f.text_field :firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>
|
|
|
|
|
<li nhname="tag" nh_tag_2="true" style="display:none;"><%= text_field_tag :enterprise_name,@user.firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>
|
|
|
|
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= text_field_tag :lastname,@user.lastname+@user.firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>
|
|
|
|
|
|
|
|
|
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
|
|
|
|
|
<select class="w70" style="height:28px;margin-left:2px;" id="gender" name="gender"><option value="0">男</option><option value="1">女</option></select>
|
|
|
|
|
<% if User.current.user_extensions && User.current.user_extensions.gender && User.current.user_extensions.gender == 1 %>
|
|
|
|
|
<input type="radio" id="sex" value="0" name="sex" class="fl "><label class="fl mr10">男</label> <input type="radio" id="sex" value="1" name="sex" checked="checked" class="fl "><label class="fl ">女</label>
|
|
|
|
|
<% else %>
|
|
|
|
|
<input type="radio" id="sex" value="0" name="sex" checked="checked" class="fl "><label class="fl mr10">男</label> <input type="radio" id="sex" value="1" name="sex" class="fl "><label class="fl ">女</label>
|
|
|
|
|
<% end %>
|
|
|
|
|
<select style = "display: none;" class="w70" style="height:28px;margin-left:2px;" id="gender" name="gender"><option value="0">男</option><option value="1">女</option></select>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
|
|
|
|
|
<% if User.current.user_extensions.nil? %>
|
|
|
|
|
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w210" type="text" >
|
|
|
|
|
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" />
|
|
|
|
|
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
|
|
|
|
|
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" placeholder=" --请选择您所属的单位--"/>
|
|
|
|
|
<p class="fl ml10">
|
|
|
|
|
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
|
|
|
|
|
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
|
|
|
|
</p>
|
|
|
|
|
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
|
|
|
|
<% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
|
|
|
|
|
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w210" type="text" >
|
|
|
|
|
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
|
|
|
|
|
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
|
|
|
|
|
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
|
|
|
|
|
<p class="fl ml10">
|
|
|
|
|
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
|
|
|
|
|
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
|
|
|
|
</p>
|
|
|
|
|
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
|
|
|
|
<% elsif User.current.user_extensions.school.nil? %>
|
|
|
|
|
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w210" type="text" >
|
|
|
|
|
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" />
|
|
|
|
|
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
|
|
|
|
|
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" placeholder=" --请选择您所属的单位--" />
|
|
|
|
|
<p class="fl ml10">
|
|
|
|
|
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
|
|
|
|
|
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
|
|
|
|
</p>
|
|
|
|
|
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
|
|
|
|
|
<% else %>
|
|
|
|
|
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" id="province" name="province" style="display: none;" class="w210" type="text" value="<%= User.current.user_extensions.school %>" />
|
|
|
|
|
<input nhname="tag" nh_tag_3="true" id="occupation" name="occupation" type="text" style="display: none;" class="w210" value="<%= User.current.user_extensions.school.id %>"/>
|
|
|
|
|
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" value="<%= User.current.user_extensions.school %>" />
|
|
|
|
|
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" type="text" style="display: none;" class="w210" value="<%= User.current.user_extensions.school.id %>"/>
|
|
|
|
|
<p class="fl ml10">
|
|
|
|
|
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span>
|
|
|
|
|
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
|
|
|
|
|
</p>
|
|
|
|
|
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" value="<%#= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>-->
|
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
|
|
|
@ -140,13 +155,13 @@
|
|
|
|
|
|
|
|
|
|
<li>
|
|
|
|
|
<%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %>
|
|
|
|
|
<label>不要发送对我自己提交的修改的通知<%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified],:style=>"height:14px;" %></label>
|
|
|
|
|
<label class="ml10"><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified],:style=>"height:14px;" %>不要发送对我自己提交的修改的通知</label>
|
|
|
|
|
</li>
|
|
|
|
|
<!--<li><input name="brief_introduction" class="w450" type="text" maxlength="255" value="<%#= (@user.user_extensions.nil?) ? '' : @user.user_extensions.brief_introduction %>"></li>-->
|
|
|
|
|
<li style="height:auto;"><textarea name="description" class="w450 h200" maxlength="255" style="resize:none;"><%= (@user.user_extensions.nil?) ? '' : @user.user_extensions.description %></textarea></li>
|
|
|
|
|
<li style="display:none;"><%= f.select :language, :Chinese => :zh, :English => :en %></li>
|
|
|
|
|
<li class="ml2">
|
|
|
|
|
<a href="javascript:void(0);" id="my_account_form_link" class="blue_btn fl">确认</a>
|
|
|
|
|
<a href="javascript:void(0);" id="my_account_form_link" class="blue_btn fl" style="background: #3b94d6; padding: 0 25px;">确定</a>
|
|
|
|
|
<input type="submit" id="my_account_form_btn" style="display:none;"/>
|
|
|
|
|
<!--<a href="javascript:void(0);" class="grey_btn ml10 fl">取消</a>-->
|
|
|
|
|
</li>
|
|
|
|
@ -429,6 +444,7 @@
|
|
|
|
|
$("*[nh_required='1']",$(this)).attr("required",true);
|
|
|
|
|
$(this).show()
|
|
|
|
|
});
|
|
|
|
|
$("#identity_hint").hide();
|
|
|
|
|
}
|
|
|
|
|
function init_identity_and_title(pField, identity, cField, title, language) {
|
|
|
|
|
for (var i = 0; i < pField.options.length; i++) {
|
|
|
|
@ -533,6 +549,14 @@
|
|
|
|
|
$("input[name='occupation']").val(data);
|
|
|
|
|
$("#search_school_result_list").hide();
|
|
|
|
|
$("#hint").hide();
|
|
|
|
|
$("#errortip").hide();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function apply_add_school(){
|
|
|
|
|
var htmlvalue = "<%= escape_javascript( render :partial => 'my/apply_add_school' )%>";
|
|
|
|
|
pop_up_box(htmlvalue,580,20,48);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function add_school(name){
|
|
|
|
|
$.ajax({
|
|
|
|
@ -619,16 +643,19 @@
|
|
|
|
|
$("#search_school_result_list").show();
|
|
|
|
|
if($(e.target).val().trim() != '') {
|
|
|
|
|
str = e.target.value.length > 8 ? e.target.value.substr(0, 6)+"..." : e.target.value;
|
|
|
|
|
$("#hint").html('找到了' + count + '个包含"' + str + '"的高校');
|
|
|
|
|
$("#hint").html('找到了' + count + '个包含"' + str + '"的高校(单位)');
|
|
|
|
|
$("#hint").show();
|
|
|
|
|
$("#errortip").hide();
|
|
|
|
|
}else{
|
|
|
|
|
$("#hint").hide();
|
|
|
|
|
$("#errortip").hide();
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
$("#search_school_result_list").html('');
|
|
|
|
|
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
|
|
|
|
|
$("#hint").html('没有找到包含"'+str+'"的高校,<a style="color:#64bdd9" onclick="add_school(\''+ e.target.value+'\');" href="javascript:void(0);">创建高校</a>');
|
|
|
|
|
$("#hint").html('您输入的名称尚不存在,<a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">申请添加</a>');
|
|
|
|
|
$("#hint").show();
|
|
|
|
|
$("#errortip").show();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -638,6 +665,7 @@
|
|
|
|
|
{
|
|
|
|
|
$("#search_school_result_list").hide();
|
|
|
|
|
$("#hint").hide();
|
|
|
|
|
$("#errortip").hide();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$("input[name='province']").on('focus', function (e) {
|
|
|
|
@ -665,16 +693,19 @@
|
|
|
|
|
$("#search_school_result_list").show();
|
|
|
|
|
if($(e.target).val().trim() != '') {
|
|
|
|
|
str = e.target.value.length > 8 ? e.target.value.substr(0, 6)+"..." : e.target.value;
|
|
|
|
|
$("#hint").html('找到了' + count + '个包含"' + str + '"的高校');
|
|
|
|
|
$("#hint").html('找到了' + count + '个包含"' + str + '"的高校(单位)');
|
|
|
|
|
$("#hint").show();
|
|
|
|
|
$("#errortip").hide();
|
|
|
|
|
}else{
|
|
|
|
|
$("#hint").hide();
|
|
|
|
|
$("#errortip").hide();
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
$("#search_school_result_list").html('');
|
|
|
|
|
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
|
|
|
|
|
$("#hint").html('没有找到包含"'+str+'"的高校,<a style="color:#64bdd9" onclick="add_school(\''+ e.target.value+'\');" href="javascript:void(0);">创建高校</a>');
|
|
|
|
|
$("#hint").html('您输入的名称尚不存在,<a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">申请添加</a>');
|
|
|
|
|
$("#hint").show();
|
|
|
|
|
$("#errortip").show();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -702,19 +733,41 @@
|
|
|
|
|
<% if( !@act.nil? && @act == 'password') %>
|
|
|
|
|
$("#users_tb_2").click();
|
|
|
|
|
<% end %>
|
|
|
|
|
$('#my_account_form_link').click(function(e){
|
|
|
|
|
|
|
|
|
|
$('#my_account_form_link').on("click",(function(e){
|
|
|
|
|
//$('#my_account_form_link').click(function(e){
|
|
|
|
|
if($("#userIdentity").val() == -1 ) {
|
|
|
|
|
$("#identity_hint").html('<span style="color:red">请选择身份</span>').show();
|
|
|
|
|
e.stopImmediatePropagation();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话
|
|
|
|
|
$("#hint").html('<span style="color:red">学校必须是从下拉列表中选择的,不能手动修改</span>').show();
|
|
|
|
|
$("#hint").html('<span style="color:red">单位名称必须是从下拉列表中选择的,不能手动修改</span>').show();
|
|
|
|
|
e.stopImmediatePropagation();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//姓名不能为空
|
|
|
|
|
if( $("#lastname").val() == '' ){
|
|
|
|
|
$("#lastname").focus();
|
|
|
|
|
e.stopImmediatePropagation();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( $("input[name='province']").val().trim() == '' ){ //学校名字必须填写
|
|
|
|
|
$("#hint").html('<span style="color:red">高校(单位)名称不能为空</span>').show();
|
|
|
|
|
e.stopImmediatePropagation();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($("#no").is(":visible") == true && $("#no").val() == ""){
|
|
|
|
|
$("#no").focus();
|
|
|
|
|
e.stopImmediatePropagation();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$('#my_account_form_btn').click();
|
|
|
|
|
});
|
|
|
|
|
}));
|
|
|
|
|
$('#my_password_form_link').click(function(){
|
|
|
|
|
$('#my_password_form_btn').click();
|
|
|
|
|
});
|
|
|
|
|