From c0437ae99236af1b140b4c93e6a4d1805d9c5137 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 11 Sep 2015 14:41:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=88=AA=E6=AD=A2=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=8F=90=E9=86=92=E7=95=8C=E9=9D=A2=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 3 ++- app/views/users/user_messages.html.erb | 21 +++++++++++++++++++-- public/stylesheets/new_user.css | 3 +++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 8b5951687..63811cd58 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -269,7 +269,8 @@ class User < Principal forge_count = ForgeMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count user_memo_count = MemoMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count - messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count = SystemMessage.where("created_at >?", User.current.onclick_time.onclick_time).count + messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count end # 查询指派给我的缺陷记录 diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index ec2e4b748..b70eabd5c 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -6,8 +6,6 @@
  • <%= link_to "全部",user_message_path(User.current), :class => "resourcesGrey" %>
  • <%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "resourcesGrey" %>
  • <%= link_to "用户申请", user_message_path(User.current, :type => 'apply'), :class => "resourcesGrey" %>
  • - <%# 系统消息 %> -
  • <%= link_to "系统消息", user_message_path(User.current, :type => 'system_message'), :class => "resourcesGrey" %>
  • <%# 课程相关消息 %>
  • <%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "resourcesGrey" %>
  • <%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "resourcesGrey" %>
  • @@ -26,6 +24,8 @@
  • <%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "resourcesGrey" %>
  • <%# 系统贴吧 %>
  • <%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "resourcesGrey" %>
  • + <%# 系统消息 %> +
  • <%= link_to "系统消息", user_message_path(User.current, :type => 'system_message'), :class => "resourcesGrey" %>
  • @@ -104,6 +104,23 @@
  • <%= time_tag(ma.created_at).html_safe %>
  • <% end %> + <% if ma.course_message_type == "HomeworkCommon" && ma.status == 1 %> + + <% end %> <% if ma.course_message_type == "Poll" %>