去掉消息界面“未读”和已读
This commit is contained in:
parent
02ace5693f
commit
bf2e63b7be
|
@ -106,18 +106,18 @@ class UsersController < ApplicationController
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
# 当前用户查看消息,则设置消息为已读
|
# 当前用户查看消息,则设置消息为已读
|
||||||
if params[:viewed] == "all"
|
#if params[:viewed] == "all"
|
||||||
course_querys = @user.course_messages
|
# course_querys = @user.course_messages
|
||||||
forge_querys = @user.forge_messages
|
# forge_querys = @user.forge_messages
|
||||||
user_querys = @user.user_feedback_messages
|
# user_querys = @user.user_feedback_messages
|
||||||
forum_querys = @user.memo_messages
|
# forum_querys = @user.memo_messages
|
||||||
if User.current.id == @user.id
|
# if User.current.id == @user.id
|
||||||
course_querys.update_all(:viewed => true)
|
# course_querys.update_all(:viewed => true)
|
||||||
forge_querys.update_all(:viewed => true)
|
# forge_querys.update_all(:viewed => true)
|
||||||
user_querys.update_all(:viewed => true)
|
# user_querys.update_all(:viewed => true)
|
||||||
forum_querys.update_all(:viewed => true)
|
# forum_querys.update_all(:viewed => true)
|
||||||
end
|
# end
|
||||||
end
|
#end
|
||||||
# @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count
|
# @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count
|
||||||
case params[:type]
|
case params[:type]
|
||||||
when nil
|
when nil
|
||||||
|
|
|
@ -29,11 +29,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="resources mt10" id="users_setting">
|
<div class="resources mt10" id="users_setting">
|
||||||
<div>
|
<div>
|
||||||
<% if params[:type].nil? %>
|
|
||||||
<div class="newsReadSetting">
|
|
||||||
有 <span class="c_red"><%= User.current.count_new_message %></span> 条未读<a href="javascript:void(0);" class="ml15"><%= link_to "全部设为已读", user_message_path(User.current, :viewed => 'all') %></a>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<% if @message_alls.count >0 %>
|
<% if @message_alls.count >0 %>
|
||||||
<%# 课程消息 %>
|
<%# 课程消息 %>
|
||||||
<% unless @message_alls.nil? %>
|
<% unless @message_alls.nil? %>
|
||||||
|
|
Loading…
Reference in New Issue