diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 7726ab3da..ea4dd404a 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -43,6 +43,14 @@ class StudentWorkController < ApplicationController end def index + # 消息状态更新 + @homework.course_messages.each do |homework_message| + if User.current.id == homework_message.user_id + homework_message.update_attributes(:viewed => true) + end + end + + # 消息end #设置作业对应的forge_messages表的viewed字段 query_student_work = @homework.course_messages query_student_work.each do |query| diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 281924f55..1fac6737b 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -106,16 +106,16 @@ class UsersController < ApplicationController return end # 当前用户查看消息,则设置消息为已读 - course_querys = @user.course_messages - forge_querys = @user.forge_messages - user_querys = @user.user_feedback_messages - forum_querys = @user.memo_messages - if User.current.id == @user.id - course_querys.update_all(:viewed => true) - forge_querys.update_all(:viewed => true) - user_querys.update_all(:viewed => true) - forum_querys.update_all(:viewed => true) - end + # course_querys = @user.course_messages + # forge_querys = @user.forge_messages + # user_querys = @user.user_feedback_messages + # forum_querys = @user.memo_messages + # if User.current.id == @user.id + # course_querys.update_all(:viewed => true) + # forge_querys.update_all(:viewed => true) + # user_querys.update_all(:viewed => true) + # forum_querys.update_all(:viewed => true) + # end # @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count case params[:type] when nil diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 0a6ed8d79..3167d96ca 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -525,7 +525,7 @@ a.replyGrey1 {color:#888888;} a.replyGrey1:hover {color:#4b4b4b;} a.newsBlue {color:#269ac9;} a.newsBlue:hover {color:#297fb8;} -a.newsBlack {color:#000000; font-size:13px; font-weight:bold} +a.newsBlack {color:#4b4b4b; font-size:13px; font-weight:bold} a.menuGrey {color:#808080;} a.menuGrey:hover {color:#fe7d68;} .navSearchTypeBox {width:368px; height:35px; position:absolute; border:1px solid #e1e1e1; background-color:#ffffff; padding-left:10px; display:none; color:#3e3e3e; font-size:14px;}