commit
74b37947f1
|
@ -227,6 +227,16 @@ module ApplicationHelper
|
||||||
xls_report.string
|
xls_report.string
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 用户资料是否完善
|
||||||
|
def user_data_complete user
|
||||||
|
user_extension = UserExtensions.where(:user_id => user.id).first
|
||||||
|
data = true
|
||||||
|
if user_extension.gender.nil? || user_extension.school_id.nil? || user.lastname.blank? || (user_extension.identity == 3 && user_extension.school_id.nil?)
|
||||||
|
data = false
|
||||||
|
end
|
||||||
|
return data
|
||||||
|
end
|
||||||
|
|
||||||
# 获取用户单位
|
# 获取用户单位
|
||||||
# 优先获取高校信息,如果改信息不存在则获取occupation
|
# 优先获取高校信息,如果改信息不存在则获取occupation
|
||||||
def get_occupation_from_user user
|
def get_occupation_from_user user
|
||||||
|
|
|
@ -80,12 +80,12 @@ class User < Principal
|
||||||
|
|
||||||
|
|
||||||
#每日一报、一事一报、不报
|
#每日一报、一事一报、不报
|
||||||
MAIL_NOTIFICATION_OPTIONS = [
|
# MAIL_NOTIFICATION_OPTIONS = [
|
||||||
#['week', :label_user_mail_option_week],
|
#['week', :label_user_mail_option_week],
|
||||||
# ['day', :label_user_mail_option_day],
|
# ['day', :label_user_mail_option_day],
|
||||||
['all', :label_user_mail_option_all],
|
# ['all', :label_user_mail_option_all],
|
||||||
['none', :label_user_mail_option_none]
|
# ['none', :label_user_mail_option_none]
|
||||||
]
|
# ]
|
||||||
|
|
||||||
has_many :homework_users
|
has_many :homework_users
|
||||||
has_many :homework_attaches, :through => :homework_users
|
has_many :homework_attaches, :through => :homework_users
|
||||||
|
@ -244,7 +244,7 @@ class User < Principal
|
||||||
validates_format_of :mail, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, :allow_blank => true
|
validates_format_of :mail, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, :allow_blank => true
|
||||||
validates_length_of :mail, :maximum => MAIL_LENGTH_LIMIT, :allow_nil => true
|
validates_length_of :mail, :maximum => MAIL_LENGTH_LIMIT, :allow_nil => true
|
||||||
validates_confirmation_of :password, :allow_nil => true
|
validates_confirmation_of :password, :allow_nil => true
|
||||||
validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true
|
# validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true
|
||||||
validate :validate_password_length
|
validate :validate_password_length
|
||||||
# validates_email_realness_of :mail
|
# validates_email_realness_of :mail
|
||||||
before_create :set_mail_notification
|
before_create :set_mail_notification
|
||||||
|
|
|
@ -101,10 +101,10 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="homepageContent">
|
<div class="homepageContent">
|
||||||
<div class="homepageLeft mt10" id="LSide">
|
<div class="homepageLeft mt10" id="LSide">
|
||||||
<div class="user_leftinfo mb10">
|
<div class="user_leftdata_background mb10">
|
||||||
<% if User.current.logged? && User.current == @user%>
|
<% if User.current.logged? && User.current == @user%>
|
||||||
<div class="pr" style="width: 80px; margin:0 auto;">
|
<div class="pr" style="width: 80px; margin:0 auto;">
|
||||||
<%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id => 'nh_source_tx'),
|
<%= link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id => 'nh_source_tx'),
|
||||||
my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true %>
|
my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true %>
|
||||||
<div class="homepageEditProfile undis">
|
<div class="homepageEditProfile undis">
|
||||||
<%=link_to '', my_clear_user_avatar_temp_path, :class => 'homepageEditProfileIcon', :remote => true, :title => '点击编辑Logo' %>
|
<%=link_to '', my_clear_user_avatar_temp_path, :class => 'homepageEditProfileIcon', :remote => true, :title => '点击编辑Logo' %>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -42,13 +42,13 @@
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset class="box">
|
<!-- <fieldset class="box">
|
||||||
<legend><%=l(:field_mail_notification)%></legend>
|
<legend><%#= l(:field_mail_notification)%></legend>
|
||||||
<%= render :partial => 'users/mail_notifications' %>
|
<%#= render :partial => 'users/mail_notifications' %>
|
||||||
</fieldset>
|
</fieldset> -->
|
||||||
|
|
||||||
<fieldset class="box tabular">
|
<fieldset class="box tabular">
|
||||||
<legend><%=l(:label_preferences)%></legend>
|
<legend><%= l(:label_preferences) %></legend>
|
||||||
<%= render :partial => 'users/preferences' %>
|
<%= render :partial => 'users/preferences' %>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
|
@ -88,6 +88,7 @@ a:hover.pro_new_topbtn_left{background-image: linear-gradient(#ededed, #dddddd);
|
||||||
|
|
||||||
/* 个人主页左侧信息 */
|
/* 个人主页左侧信息 */
|
||||||
.user_leftinfo{ width:238px;border:1px solid #e5e5e5; background:#fff url(/images/user/user_bg_info.jpg) 0 0 no-repeat; position:relative; }
|
.user_leftinfo{ width:238px;border:1px solid #e5e5e5; background:#fff url(/images/user/user_bg_info.jpg) 0 0 no-repeat; position:relative; }
|
||||||
|
.user_leftdata_background{ width:238px;border:1px solid #e5e5e5; background:#fff url(/images/user/user_bg_info2.jpg) 0 0 no-repeat; position:relative; }
|
||||||
a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;}
|
a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;}
|
||||||
.user_leftinfo_img img{ width:74px; height:74px;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px; border:3px solid #dcdcdc; }
|
.user_leftinfo_img img{ width:74px; height:74px;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px; border:3px solid #dcdcdc; }
|
||||||
.user_leftinfo_female{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) 5px -378px no-repeat; position:absolute; top:80px; left:160px;}
|
.user_leftinfo_female{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) 5px -378px no-repeat; position:absolute; top:80px; left:160px;}
|
||||||
|
|
Loading…
Reference in New Issue