去掉统计信息

This commit is contained in:
huang 2015-08-25 12:43:27 +08:00
parent bff139b9a7
commit 3ecdb2940b
2 changed files with 13 additions and 6 deletions

View File

@ -138,45 +138,58 @@ class UsersController < ApplicationController
# @user_feedback_messages_count = @user_feedback_messages.count # @user_feedback_messages_count = @user_feedback_messages.count
when 'homework' when 'homework'
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc") @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 #@user_course_messages_count = @user_course_messages.count
when 'course_message' when 'course_message'
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc") @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 #@user_course_messages_count = @user_course_messages.count
when 'forge_message' when 'forge_message'
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user).order("created_at desc") @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 #@user_forge_messages_count = @user_forge_messages.count
when 'course_news' when 'course_news'
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "News", @user).order("created_at desc") @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 #@user_course_messages_count = @user_course_messages.count
when 'forge_news' when 'forge_news'
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "News", @user).order("created_at desc") @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 #@user_forge_messages_count = @user_forge_messages.count
when 'course_news_reply' when 'course_news_reply'
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Comment", @user).order("created_at desc") @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Comment", @user).order("created_at desc")
#@user_course_messages_count = @user_course_messages.count #@user_course_messages_count = @user_course_messages.count
when 'forge_news_reply' when 'forge_news_reply'
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Comment", @user).order("created_at desc") @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 #@user_forge_messagess_count = @user_forge_messages.count
when 'poll' when 'poll'
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc") @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 #@user_course_messages_count = @user_course_messages.count
when 'works_reviewers' when 'works_reviewers'
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "StudentWorksScore", @user).order("created_at desc") @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 #@user_course_messages_count = @user_course_messages.count
when 'works_reply' when 'works_reply'
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc") @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 #@user_course_messages_count = @user_course_messages.count
when 'issue' when 'issue'
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Issue", @user).order("created_at desc") @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 #@user_forge_messages_count = @user_forge_messages.count
when 'issue_update' # 缺陷状态更新、留言 when 'issue_update' # 缺陷状态更新、留言
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Journal", @user).order("created_at desc") @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 #@user_forge_messages_count = @user_forge_messages.count
when 'forum' when 'forum'
@message_alls = MemoMessage.where("memo_type =? and user_id =?", "Memo", @user).order("created_at desc") @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 #@user_memo_messages_count = @user_memo_messages.count
when 'user_feedback' when 'user_feedback'
@message_alls = UserFeedbackMessage.where("journals_for_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc") @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 #@user_feedback_messages_count = @user_feedback_messages.count
else else
render_404 render_404

View File

@ -29,11 +29,6 @@
</li> </li>
</ul> </ul>
</div> </div>
<% if params[:type].nil? %>
<div class="newsReadSetting">
有&nbsp;<span class="c_red">8</span>&nbsp;封未读<a href="javascript:void(0);" class="ml15">全部设为已读</a>
</div>
<% end %>
<div> <div>
<% if @new_message_count >0 %> <% if @new_message_count >0 %>
<%# 课程消息 %> <%# 课程消息 %>
@ -175,7 +170,6 @@
:topic_id => ma.forge_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}", :topic_id => ma.forge_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.forge_message.subject.html_safe}" %></a></li> :title => "#{ma.forge_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul> </ul>
<% end %> <% end %>
<% if ma.forge_message_type == "News" %> <% if ma.forge_message_type == "News" %>