<% if User.current.logged?%>
-
<%= image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_user_tx')%>
+
<%= image_tag(url_to_avatar(@user), width:"74", height: "74", :id=>'nh_user_tx')%>
<% else %>

<% end %>
@@ -112,7 +112,7 @@
<% end %>
-
<%=@user.show_name %>
+
<%= @user.show_name %>
<% if @user.user_extensions && @user.user_extensions.identity %>
<%= get_user_roll @user %>
<% end%>
@@ -123,7 +123,7 @@
<%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %>
-
+
-
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb
index e58beb8d6..0591c4e6f 100644
--- a/app/views/my/account.html.erb
+++ b/app/views/my/account.html.erb
@@ -70,15 +70,15 @@
<% if !User.current.user_extensions.nil? && !User.current.user_extensions.student_id.nil? %>
- <%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => l(:label_account_identity_studentID),:style=>"width:127px;" %>
+ <%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => l(:label_account_identity_studentID),:style => "width:127px;" %>
<% else %>
- <%= text_field_tag :no, nil, :placeholder => l(:label_account_identity_studentID),:style=>"60px" %>
+ <%= text_field_tag :no, nil, :placeholder => l(:label_account_identity_studentID), :style => "60px" %>
<% end %>
- - <%= text_field_tag :lastname,@user.lastname+@user.firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>姓名不能为空
+
- <%= text_field_tag :lastname, @user.lastname+@user.firstname, :no_label => true, :required => true, :nh_required => "1",:class => "w210" %>姓名不能为空
-
<% if User.current.user_extensions && User.current.user_extensions.gender && User.current.user_extensions.gender == 1 %>
@@ -90,6 +90,7 @@
-
+
<% if User.current.user_extensions.nil? %>
@@ -98,13 +99,14 @@
+
<% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
<% if User.current.user_extensions.school_id.nil? %>
<% else %>
-
+
<% end %>
@@ -605,12 +607,15 @@
});
});
+// 基本资料页面提交表单时,判断身份与单位是否合法
function my_account_form_submit(){
if($("#userIdentity").val() == -1 ) {
$("#identity_hint").html('请选择身份').show();
- e.stopImmediatePropagation();
+ e.stopImmediatePropagation(); // 阻止事件冒泡
return;
}
+
+ // 单位或高校必须从下拉列表中选择
if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话
$("#hint").html('单位名称必须是从下拉列表中选择的,不能手动修改').show();
e.stopImmediatePropagation();