From 596c512d0afc6800226c9343e2b326d73d1ac91c Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 10 Sep 2015 11:39:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 ++ app/views/users/user_messages.html.erb | 29 ++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 23106c954..220781ed9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -148,6 +148,8 @@ class UsersController < ApplicationController @message_alls << message_all.message end end + when 'system_message' + @message_alls = SystemMessage.order("created_at desc").all when 'apply' @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?" , "AppliedProject", @user).order("created_at desc") when 'homework' diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index e36fd4f32..b5473edee 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -6,6 +6,8 @@
  • <%= 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" %>
  • @@ -42,8 +44,14 @@ <%# 系统消息 %> <% @user_system_messages.each do |usm| %> <% end %> <% end %> + <% if ma.class == SystemMessage %> + + <% end %> <% end %>