Merge branch 'develop' into 'develop'

本周上限任务



See merge request !95
This commit is contained in:
黄井泉 2016-12-30 17:33:30 +08:00
commit 74b37947f1
7 changed files with 584 additions and 558 deletions

View File

@ -227,6 +227,16 @@ module ApplicationHelper
xls_report.string
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
def get_occupation_from_user user

View File

@ -80,12 +80,12 @@ class User < Principal
#每日一报、一事一报、不报
MAIL_NOTIFICATION_OPTIONS = [
# MAIL_NOTIFICATION_OPTIONS = [
#['week', :label_user_mail_option_week],
# ['day', :label_user_mail_option_day],
['all', :label_user_mail_option_all],
['none', :label_user_mail_option_none]
]
# ['all', :label_user_mail_option_all],
# ['none', :label_user_mail_option_none]
# ]
has_many :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_length_of :mail, :maximum => MAIL_LENGTH_LIMIT, :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
# validates_email_realness_of :mail
before_create :set_mail_notification

View File

@ -101,10 +101,10 @@
<div class="cl"></div>
<div class="homepageContent">
<div class="homepageLeft mt10" id="LSide">
<div class="user_leftinfo mb10">
<div class="user_leftdata_background mb10">
<% if User.current.logged? && User.current == @user%>
<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 %>
<div class="homepageEditProfile undis">
<%=link_to '', my_clear_user_avatar_temp_path, :class => 'homepageEditProfileIcon', :remote => true, :title => '点击编辑Logo' %>

View File

@ -1,4 +1,4 @@
<% if @force %>
<% if @force %>
<% message = AppliedMessage.where(:status => 3, :user_id => User.current.id, :viewed => 0).first %>
<% unless message.nil? %>
<div class="homepageRightBanner">
@ -9,17 +9,17 @@
<div class="homepageRightBanner" style="border-bottom:2px solid #ddd;">
<div class="polls_head" style="color:red; font-size:17px;">&nbsp;&nbsp;提示:&nbsp;&nbsp;您尚未完善您的基本资料,完善后可使用更多功能</div>
</div>
<% end %>
<div id="RSide" style="margin-left:0px; margin-bottom:0px; width:728px;">
<div id="users_tb_" class="users_tb_">
<% end %>
<div id="RSide" style="margin-left:0px; margin-bottom:0px; width:728px;">
<div id="users_tb_" class="users_tb_">
<ul>
<li id="users_tb_1" class="users_hovertab" onclick="x:HoverLi(1);">基本资料</li>
<li id="users_tb_2" class="users_normaltab" onclick="i:HoverLi(2);">密码管理</li>
</ul>
</div><!--tb_ end-->
<div class="cl"></div>
<div class="users_ctt">
<%= labelled_form_for :user, @user, :url => {:action => "account"}, :html => {:id => 'my_account_form', :method => :post} do |f| %>
</div><!--tb_ end-->
<div class="cl"></div>
<div class="users_ctt">
<%= labelled_form_for :user, @user, :url => {:action => "account"}, :html => {:id => 'my_account_form', :method => :post} do |f| %>
<div class="users_dis" id="users_tbc_01">
<% if( @act.nil? || @act != 'password') %>
<%= render_flash_messages %>
@ -34,7 +34,7 @@
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" ><span style="color:red;">*</span>&nbsp;&nbsp;性别&nbsp;:&nbsp;</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" ><span style="color:red;">*</span>&nbsp;&nbsp;单位名称&nbsp;:&nbsp;</li>
<li>地区&nbsp;:&nbsp;</li>
<li>邮件通知&nbsp;:&nbsp;</li>
<!--<li>邮件通知&nbsp;:&nbsp;</li>-->
<!--<li>个人签名&nbsp;:&nbsp;</li>-->
<li>个人主页&nbsp;:&nbsp;</li>
<li>&nbsp;&nbsp;</li>
@ -174,10 +174,10 @@
<select name="city" id="userCity" class="location" style="height:28px;"></select>
</li>
<li>
<%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %>
<label class="ml10"><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified], :style => "height:14px;" %>不要发送对我自己提交的修改的通知</label>
</li>
<!-- <li>
<%#= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %>
<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;">
<% if @user.homepage && !@user.homepage.article_homepages.empty? %>
@ -187,7 +187,16 @@
<%=link_to '查看', user_homepages_path(:user_id => @user.id),:target => '_blank', :class => 'linkBlue' %>
<% end %>
<% else %>
<p class="nodata" style="height: 22px; font-size: 14px; text-align: left; line-height: 20px;">您还没有创建属于自己的个人主页。<%=link_to '新建', new_user_homepage_article_homepage_path(:user_id=> @user.id, :homepage_id => @user.homepage.id),:onclick=>"my_account_form_submit();", :target => "_blank", :class => 'linkBlue' %></p>
<p class="nodata" style="height: 22px; font-size: 14px; text-align: left; line-height: 20px;">您还没有创建属于自己的个人主页。
<% if user_data_complete @user %>
<%= link_to '新建', new_user_homepage_article_homepage_path(:user_id => @user.id,
:homepage_id => @user.homepage.id),
:onclick=>"my_account_form_submit();",
:target => "_blank",
:class => 'linkBlue' %>
<% end %>
</p>
<% end %>
<!--<textarea name="description" class="w450 h200" maxlength="255" style="resize:none;"><%#= (@user.user_extensions.nil?) ? '' : @user.user_extensions.description %></textarea>-->
</li>
@ -200,9 +209,9 @@
</ul>
<div class="cl"></div>
</div><!--tbc_01 end-->
<% end %>
<% end %>
<%= form_tag({:action => "password"},:id => 'my_password_form') do %>
<%= form_tag({:action => "password"},:id => 'my_password_form') do %>
<div class="users_undis" id="users_tbc_02">
<% if( !@act.nil? && @act == 'password') %>
<%= render_flash_messages %>
@ -227,8 +236,8 @@
<div class="cl"></div>
</div><!--tbc_02 end-->
<div class="cl"></div>
<% end %>
</div><!--ctt end-->
<% end %>
</div><!--ctt end-->
<!--users_setting end-->
@ -619,8 +628,8 @@
});
});
// 基本资料页面提交表单时,判断身份与单位是否合法
function my_account_form_submit(){
// 基本资料页面提交表单时,判断身份与单位是否合法
function my_account_form_submit(){
if($("#userIdentity").val() == -1 ) {
$("#identity_hint").html('<span style="color:red">请选择身份</span>').show();
e.stopImmediatePropagation(); // 阻止事件冒泡
@ -655,7 +664,13 @@ function my_account_form_submit(){
}
$('#my_account_form').submit();
}
}
$("#province").blur(function(){
if($(this).val() == ""){
$(this).attr("placeholder","--请搜索您所在的高校(单位)--");
}
})
</script>
<script type="text/javascript">
function g(o){return document.getElementById(o);}

View File

@ -42,13 +42,13 @@
</div>
</fieldset>
<fieldset class="box">
<legend><%=l(:field_mail_notification)%></legend>
<%= render :partial => 'users/mail_notifications' %>
</fieldset>
<!-- <fieldset class="box">
<legend><%#= l(:field_mail_notification)%></legend>
<%#= render :partial => 'users/mail_notifications' %>
</fieldset> -->
<fieldset class="box tabular">
<legend><%=l(:label_preferences)%></legend>
<legend><%= l(:label_preferences) %></legend>
<%= render :partial => 'users/preferences' %>
</fieldset>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -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_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;}
.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;}