Merge branch 'dev_hjq' of http://repository.trustie.net/xianbo/trustie2 into dev_hjq

This commit is contained in:
ouyangxuhua 2015-09-17 14:38:17 +08:00
commit d4e1c62989
4 changed files with 21 additions and 22 deletions

View File

@ -419,7 +419,8 @@ class ProjectsController < ApplicationController
# 发送邮件邀请新用户页面对应方法 # 发送邮件邀请新用户页面对应方法
def invite_members_by_mail def invite_members_by_mail
if User.current.member_of?(@project) || User.current.admin? if User.current.member_of?(@project) || User.current.admin?
@inviter_lists = InviteList.where(project_id:@project.id) @inviter_lists = InviteList.where(project_id:@project.id).order("created_at desc")
# @inviters = [] # @inviters = []
# @waiters = [] # @waiters = []
# unless @inviter_lists.blank? # unless @inviter_lists.blank?

View File

@ -107,17 +107,18 @@ class UsersController < ApplicationController
end end
# 记录当前点击按钮的时间 # 记录当前点击按钮的时间
# 考虑到用户未退出刷新消息页面 # 考虑到用户未退出刷新消息页面
if OnclickTime.where("user_id =?", User.current).first.nil? message_time = OnclickTime.where("user_id =?", User.current).first
if message_time.nil?
message_new_time = OnclickTime.new message_new_time = OnclickTime.new
message_new_time.user_id = User.current.id message_new_time.user_id = User.current.id
message_new_time.onclick_time = Time.now message_new_time.onclick_time = Time.now
message_new_time.save message_new_time.save
else else
message_new_time = OnclickTime.where("user_id =?", User.current).first # 24小时内显示
message_last_time = message_new_time.onclick_time contrast_time = Time.now - 86400
message_new_time.update_attributes(:onclick_time => Time.now) message_time.update_attributes(:onclick_time => Time.now)
end end
@user_system_messages = SystemMessage.where("created_at >?", message_last_time).order("created_at desc") @user_system_messages = SystemMessage.where("created_at >?", contrast_time).order("created_at desc")
# 当前用户查看消息,则设置消息为已读 # 当前用户查看消息,则设置消息为已读
if params[:viewed] == "all" if params[:viewed] == "all"
course_querys = @user.course_messages course_querys = @user.course_messages

View File

@ -32,7 +32,7 @@
</div> </div>
<div class="resources mt10" id="users_setting"> <div class="resources mt10" id="users_setting">
<div> <div>
<% if @message_alls.count >0 %> <% if @message_alls.count >0 || @user_system_messages.count >0 %>
<% if params[:type].nil? || params[:type] == "unviewed" %> <% if params[:type].nil? || params[:type] == "unviewed" %>
<div class="newsReadSetting"> <div class="newsReadSetting">
有&nbsp;<span class="c_red"><%= unviewed_message(@user) %></span>&nbsp;条未读 有&nbsp;<span class="c_red"><%= unviewed_message(@user) %></span>&nbsp;条未读
@ -46,21 +46,18 @@
<% @user_system_messages.each do |usm| %> <% @user_system_messages.each do |usm| %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"> <a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/logo.png", width: "30px", height: "30px", class: "mt3") %></div></a>
<div class="navHomepageLogo fl">
<%= image_tag("/images/logo.png", width: "30px", height: "30px", class: "mt3") %>
</div>
</a>
</li> </li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">Trustie平台</span><span class="homepageNewsType fl">发布新消息:</span> <span class="newsBlue homepageNewsPublisher">Trustie平台</span><span class="homepageNewsType fl">发布新消息:</span>
</li> </li>
<li class="homepageNewsContent fl"> <li class="homepageNewsContent fl">
<%= link_to usm.content.nil? ? usm.description.html_safe : usm.content.html_safe, user_message_path(User.current, :type => "system_messages"), <span style="color: red;float: left">【系统消息】</span><li class="homepageSystenMessageContent fl" id="content_<%= usm.id %>">
:class => "newsRed", <%= link_to usm.content.nil? ? usm.description.html_safe : usm.content.html_safe, user_message_path(User.current, :type => "system_messages"),
:onmouseover => "message_titile_show($(this),event);", :id => "content_link_#{usm.id}",
:onmouseout => "message_titile_hide($(this));" :onmouseover =>"message_titile_show($(this),event);",
%> :onmouseout => "message_titile_hide($(this));"
%>
</li> </li>
<div style="display:none;" class="message_title_red system_message_style"> <div style="display:none;" class="message_title_red system_message_style">
<%= usm.content.nil? ? usm.description.html_safe : usm.content.html_safe %> <%= usm.content.nil? ? usm.description.html_safe : usm.content.html_safe %>
@ -380,9 +377,8 @@
</a> </a>
</li> </li>
<li class="homepageNewsPubType fl"><span class="newsBlue homepageNewsPublisher" >Trustie平台</span><span class="homepageNewsType fl">发布新消息:</span></li> <li class="homepageNewsPubType fl"><span class="newsBlue homepageNewsPublisher" >Trustie平台</span><span class="homepageNewsType fl">发布新消息:</span></li>
<li class="homepageNewsContent fl" id="content_<%= ma.id %>"> <span style="color: red;float: left">【系统消息】</span><li class="homepageSystenMessageContent fl" id="content_<%= ma.id %>">
<%= link_to ma.content.nil? ? ma.description.html_safe : ma.content.html_safe, user_message_path(User.current, :type => "system_messages"), <%= link_to ma.content.nil? ? ma.description.html_safe : ma.content.html_safe, user_message_path(User.current, :type => "system_messages"),
:class => "#{params[:type]=="unviewed" ? "newsBlack" : "newsRed"}",
:id => "content_link_#{ma.id}", :id => "content_link_#{ma.id}",
:onmouseover =>"message_titile_show($(this),event);", :onmouseover =>"message_titile_show($(this),event);",
:onmouseout => "message_titile_hide($(this));" :onmouseout => "message_titile_hide($(this));"

View File

@ -515,6 +515,7 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
.homepageNewsType {width:110px; padding-left: 5px; font-size:12px; color:#888888; display:block;} .homepageNewsType {width:110px; padding-left: 5px; font-size:12px; color:#888888; display:block;}
.homepageNewsPubType {width:220px; font-size:12px; color:#888888; display: block;} .homepageNewsPubType {width:220px; font-size:12px; color:#888888; display: block;}
.homepageNewsContent {width:365px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } .homepageNewsContent {width:365px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
.homepageSystenMessageContent {width:291px; max-width:291px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
.homepageHomeworkContentWarn {width:110px; max-width:365px; margin-right:10px; font-size:12px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } .homepageHomeworkContentWarn {width:110px; max-width:365px; margin-right:10px; font-size:12px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
.homepageHomeworkContent {width:245px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } .homepageHomeworkContent {width:245px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
@ -983,8 +984,8 @@ img.ui-datepicker-trigger {
text-overflow: ellipsis; text-overflow: ellipsis;
margin-bottom: 3px; margin-bottom: 3px;
} }
.message_title{border: 1px solid #D4D4D4;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #E8E8E8; max-width:400px;word-wrap:break-word; word-break:break-all;} .message_title{border: 1px solid #9C9C9C;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff; max-width:400px;word-wrap:break-word; word-break:break-all;}
.message_title_red{border: 1px solid #D4D4D4;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #E8E8E8;color: red} .message_title_red{border: 1px solid #484848;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff;background-image: -moz-linear-gradient(top, #fff, #E0E0E0);}
.description{display: none !important;} .description{display: none !important;}
.ispublic-label{display: none !important;} .ispublic-label{display: none !important;}