From 3ecdb2940ba9dd6e98790f81c50ae783295ab343 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 25 Aug 2015 12:43:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E7=BB=9F=E8=AE=A1=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 13 +++++++++++++ app/views/users/user_messages.html.erb | 6 ------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 22aab5435..8fd36ee7f 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -138,45 +138,58 @@ class UsersController < ApplicationController # @user_feedback_messages_count = @user_feedback_messages.count when 'homework' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc") + @message_alls_count = @message_alls.count #@user_course_messages_count = @user_course_messages.count when 'course_message' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc") + @message_alls_count = @message_alls.count #@user_course_messages_count = @user_course_messages.count when 'forge_message' @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user).order("created_at desc") + @message_alls_count = @message_alls.count #@user_forge_messages_count = @user_forge_messages.count when 'course_news' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "News", @user).order("created_at desc") + @message_alls_count = @message_alls.count #@user_course_messages_count = @user_course_messages.count when 'forge_news' @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "News", @user).order("created_at desc") + @message_alls_count = @message_alls.count #@user_forge_messages_count = @user_forge_messages.count when 'course_news_reply' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Comment", @user).order("created_at desc") #@user_course_messages_count = @user_course_messages.count when 'forge_news_reply' @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Comment", @user).order("created_at desc") + @message_alls_count = @message_alls.count #@user_forge_messagess_count = @user_forge_messages.count when 'poll' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc") + @message_alls_count = @message_alls.count #@user_course_messages_count = @user_course_messages.count when 'works_reviewers' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "StudentWorksScore", @user).order("created_at desc") + @message_alls_count = @message_alls.count #@user_course_messages_count = @user_course_messages.count when 'works_reply' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc") + @message_alls_count = @message_alls.count #@user_course_messages_count = @user_course_messages.count when 'issue' @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Issue", @user).order("created_at desc") + @message_alls_count = @message_alls.count #@user_forge_messages_count = @user_forge_messages.count when 'issue_update' # 缺陷状态更新、留言 @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Journal", @user).order("created_at desc") + @message_alls_count = @message_alls.count #@user_forge_messages_count = @user_forge_messages.count when 'forum' @message_alls = MemoMessage.where("memo_type =? and user_id =?", "Memo", @user).order("created_at desc") + @message_alls_count = @message_alls.count #@user_memo_messages_count = @user_memo_messages.count when 'user_feedback' @message_alls = UserFeedbackMessage.where("journals_for_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc") + @message_alls_count = @message_alls.count #@user_feedback_messages_count = @user_feedback_messages.count else render_404 diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 16a1bdf4b..3f5549273 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -29,11 +29,6 @@ - <% if params[:type].nil? %> -
- 有 8 封未读全部设为已读 -
- <% end %>
<% if @new_message_count >0 %> <%# 课程消息 %> @@ -175,7 +170,6 @@ :topic_id => ma.forge_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}", :title => "#{ma.forge_message.subject.html_safe}" %>
  • <%= time_tag(ma.forge_message.created_on).html_safe %>
  • - <% end %> <% if ma.forge_message_type == "News" %>