消息排序(公共表)

This commit is contained in:
huang 2015-08-25 11:10:08 +08:00
parent 5306d7e2a4
commit 0da75afc88
4 changed files with 487 additions and 446 deletions

View File

@ -122,57 +122,62 @@ class UsersController < ApplicationController
@new_message_count = @user.forge_messages.count + @user.memo_messages.count + @user.course_messages.count + @user.user_feedback_messages.count
case params[:type]
when nil
@all_message = MessageAll.where("user_id =?",@user).order("created_at desc")
@user_course_messages = CourseMessage.where("user_id =?",@user).order("created_at desc")
@user_forge_messages = ForgeMessage.where("user_id =?",@user).order("created_at desc")
@user_memo_messages = MemoMessage.where("user_id =?",@user).order("created_at desc")
@user_feedback_messages = UserFeedbackMessage.where("user_id =?",@user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@user_forge_messages_count = @user_forge_messages.count
@user_memo_messages_count = @user_memo_messages.count
@user_feedback_messages_count = @user_feedback_messages.count
@message_alls = []
messages = MessageAll.where("user_id =?",@user).order("created_at desc")
messages.each do |message_all|
@message_alls << message_all.message
end
# @user_course_messages = MessageAll.where("user_id =? and message_type=?",@user,"CourseMessage").order("created_at desc")
# @user_forge_messages = MessageAll.where("user_id =? and message_type=?",@user,"ForgeMessage").order("created_at desc")
# @user_memo_messages = MessageAll.where("user_id =? and message_type=?",@user,"MemoMessage").order("created_at desc")
# @user_feedback_messages = MessageAll.where("user_id =? and message_type=?",@user,"UserFeedbackMessage").order("created_at desc")
# @user_course_messages_count = @user_course_messages.count
# @user_forge_messages_count = @user_forge_messages.count
# @user_memo_messages_count = @user_memo_messages.count
# @user_feedback_messages_count = @user_feedback_messages.count
when 'homework'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc")
#@user_course_messages_count = @user_course_messages.count
when 'course_message'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc")
#@user_course_messages_count = @user_course_messages.count
when 'forge_message'
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user).order("created_at desc")
@user_forge_messages_count = @user_forge_messages.count
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user).order("created_at desc")
#@user_forge_messages_count = @user_forge_messages.count
when 'course_news'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "News", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "News", @user).order("created_at desc")
#@user_course_messages_count = @user_course_messages.count
when 'forge_news'
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "News", @user).order("created_at desc")
@user_forge_messages_count = @user_forge_messages.count
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "News", @user).order("created_at desc")
#@user_forge_messages_count = @user_forge_messages.count
when 'course_news_reply'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "Comment", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@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'
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "Comment", @user).order("created_at desc")
@user_forge_messagess_count = @user_forge_messages.count
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Comment", @user).order("created_at desc")
#@user_forge_messagess_count = @user_forge_messages.count
when 'poll'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc")
#@user_course_messages_count = @user_course_messages.count
when 'works_reviewers'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "StudentWorksScore", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "StudentWorksScore", @user).order("created_at desc")
#@user_course_messages_count = @user_course_messages.count
when 'works_reply'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc")
#@user_course_messages_count = @user_course_messages.count
when 'issue'
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "Issue", @user).order("created_at desc")
@user_forge_messages_count = @user_forge_messages.count
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Issue", @user).order("created_at desc")
#@user_forge_messages_count = @user_forge_messages.count
when 'issue_update' # 缺陷状态更新、留言
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "Journal", @user).order("created_at desc")
@user_forge_messages_count = @user_forge_messages.count
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Journal", @user).order("created_at desc")
#@user_forge_messages_count = @user_forge_messages.count
when 'forum'
@user_memo_messages = MemoMessage.where("memo_type =? and user_id =?", "Memo", @user).order("created_at desc")
@user_memo_messages_count = @user_memo_messages.count
@message_alls = MemoMessage.where("memo_type =? and user_id =?", "Memo", @user).order("created_at desc")
#@user_memo_messages_count = @user_memo_messages.count
when 'user_feedback'
@user_feedback_messages = UserFeedbackMessage.where("journals_for_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc")
@user_feedback_messages_count = @user_feedback_messages.count
@message_alls = UserFeedbackMessage.where("journals_for_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc")
#@user_feedback_messages_count = @user_feedback_messages.count
else
render_404
return
@ -201,50 +206,62 @@ class UsersController < ApplicationController
@new_message_count = @user.forge_messages.count + @user.memo_messages.count + @user.course_messages.count + @user.user_feedback_messages.count
case params[:type]
when nil
@user_message_all = MessageAll.where("user_id =?", @user).order("created_at desc")
@user_message_all_count = @user_message_all.count
@message_alls = []
messages = MessageAll.where("user_id =?",@user).order("created_at desc")
messages.each do |message_all|
@message_alls << message_all.message
end
# @user_course_messages = MessageAll.where("user_id =? and message_type=?",@user,"CourseMessage").order("created_at desc")
# @user_forge_messages = MessageAll.where("user_id =? and message_type=?",@user,"ForgeMessage").order("created_at desc")
# @user_memo_messages = MessageAll.where("user_id =? and message_type=?",@user,"MemoMessage").order("created_at desc")
# @user_feedback_messages = MessageAll.where("user_id =? and message_type=?",@user,"UserFeedbackMessage").order("created_at desc")
# @user_course_messages_count = @user_course_messages.count
# @user_forge_messages_count = @user_forge_messages.count
# @user_memo_messages_count = @user_memo_messages.count
# @user_feedback_messages_count = @user_feedback_messages.count
when 'homework'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc")
#@user_course_messages_count = @user_course_messages.count
when 'course_message'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc")
#@user_course_messages_count = @user_course_messages.count
when 'forge_message'
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user).order("created_at desc")
@user_forge_messages_count = @user_forge_messages.count
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user).order("created_at desc")
#@user_forge_messages_count = @user_forge_messages.count
when 'course_news'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "News", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "News", @user).order("created_at desc")
#@user_course_messages_count = @user_course_messages.count
when 'forge_news'
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "News", @user).order("created_at desc")
@user_forge_messages_count = @user_forge_messages.count
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "News", @user).order("created_at desc")
#@user_forge_messages_count = @user_forge_messages.count
when 'course_news_reply'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "Comment", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@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'
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "Comment", @user).order("created_at desc")
@user_forge_messagess_count = @user_forge_messages.count
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Comment", @user).order("created_at desc")
#@user_forge_messagess_count = @user_forge_messages.count
when 'poll'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc")
#@user_course_messages_count = @user_course_messages.count
when 'works_reviewers'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "StudentWorksScore", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "StudentWorksScore", @user).order("created_at desc")
#@user_course_messages_count = @user_course_messages.count
when 'works_reply'
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc")
@user_course_messages_count = @user_course_messages.count
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc")
#@user_course_messages_count = @user_course_messages.count
when 'issue'
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "Issue", @user).order("created_at desc")
@user_forge_messages_count = @user_forge_messages.count
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Issue", @user).order("created_at desc")
#@user_forge_messages_count = @user_forge_messages.count
when 'issue_update' # 缺陷状态更新、留言
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "Journal", @user).order("created_at desc")
@user_forge_messages_count = @user_forge_messages.count
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Journal", @user).order("created_at desc")
#@user_forge_messages_count = @user_forge_messages.count
when 'forum'
@user_memo_messages = MemoMessage.where("memo_type =? and user_id =?", "Memo", @user).order("created_at desc")
@user_memo_messages_count = @user_memo_messages.count
@message_alls = MemoMessage.where("memo_type =? and user_id =?", "Memo", @user).order("created_at desc")
#@user_memo_messages_count = @user_memo_messages.count
when 'user_feedback'
@user_feedback_messages = UserFeedbackMessage.where("journals_for_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc")
@user_feedback_messages_count = @user_feedback_messages.count
@message_alls = UserFeedbackMessage.where("journals_for_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc")
#@user_feedback_messages_count = @user_feedback_messages.count
else
render_404
return

View File

@ -37,217 +37,213 @@
<div>
<% if @new_message_count >0 %>
<%# 课程消息 %>
<% unless @user_course_messages.nil? %>
<% @user_course_messages.each do |ucm| %>
<% if ucm.course_message_type == "News" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ucm.course_message.author, user_path(ucm.course_message.author), :class => "newsBlue" %></li>
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布通知</li>
<li class="homepageNewsContent fl">
<%= link_to ucm.course_message.title, {:controller => 'news', :action => 'show', :id => ucm.course_message.id },
:class =>"#{ucm.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{ucm.course_message.title}" %></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ucm.course_message_type == "Comment" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ucm.course_message.author, user_path(ucm.course_message.author), :class => "newsBlue" %></li>
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复了通知</li>
<li class="homepageNewsContent fl">
<%= link_to ucm.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ucm.course_message.commented.id },
:class =>"#{ucm.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{ucm.course_message.comments.html_safe}" %></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ucm.course_message_type == "HomeworkCommon" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ucm.course_message.user, user_path(ucm.course_message.user), :class => "newsBlue" %></a></li>
<li class="homepageNewsType fl">发布作业</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ucm.course_message.name, student_work_index_path(:homework => ucm.course_message.id),:class => "newsGrey", :title => "#{ucm.course_message.name}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ucm.course_message_type == "Poll" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ucm.course_message.user, user_path(ucm.course_message.user), :class => "newsBlue" %></a></li>
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布问卷</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to format_activity_title(" #{ucm.course_message.polls_name.nil? ? "未命名问卷" : ucm.course_message.polls_name}"), poll_index_path(:polls_type => "Course", :polls_group_id => ucm.course_id),
:class=>"#{ucm.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ucm.course_message.polls_name}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ucm.course_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ucm.course_message.author, user_path(ucm.course_message.author), :class => "newsBlue" %></li>
<% if ucm.course_message.parent_id.nil? %>
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布帖子</li>
<% unless @message_alls.nil? %>
<% @message_alls.each do |ma| %>
<% if ma.class == CourseMessage %>
<% if ma.course_message_type == "News" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布通知</li>
<li class="homepageNewsContent fl">
<%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id },
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{ma.course_message.title}" %></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "Comment" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复了通知</li>
<li class="homepageNewsContent fl">
<%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{ma.course_message.comments.html_safe}" %></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "HomeworkCommon" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></a></li>
<li class="homepageNewsType fl">发布作业</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ucm.course_message.subject.html_safe, course_boards_path(ucm.course_message.course,:parent_id => ucm.course_message.parent_id ? ucm.course_message.parent_id : ucm.course_message.id,
:topic_id => ucm.course_message.id),:class=>"#{ucm.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ucm.course_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li>
<% else %>
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复帖子</li>
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),:class => "newsGrey", :title => "#{ma.course_message.name}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "Poll" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></a></li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布问卷</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ucm.course_message.subject.html_safe, course_boards_path(ucm.course_message.course,:parent_id => ucm.course_message.parent_id ? ucm.course_message.parent_id : ucm.course_message.id,
:topic_id => ucm.course_message.id),:class=>"#{ucm.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ucm.course_message.subject.html_safe}" %> </a></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li>
<% end %>
</ul>
<% end %>
<% if ucm.course_message_type == "StudentWorksScore" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ucm.course_message.user, user_path(ucm.course_message.user), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">评阅了作品</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to "#{ucm.course_message.comment.nil? ? "分数:"+ucm.course_message.score.to_s : "分数:"+ucm.course_message.score.to_s + "----" + "评语:" + ucm.course_message.comment}", student_work_index_path(:homework => ucm.course_message.student_work.homework_common_id),:class=>"newsGrey",:title => "#{ucm.course_message.comment}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ucm.course_message_type == "JournalsForMessage" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ucm.course_message.user, user_path(ucm.course_message.user), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">回复了作品</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ucm.course_message.notes, student_work_index_path(:homework => ucm.course_message.jour.student_work.homework_common_id),:class=>"newsGrey",:title => "#{ucm.course_message.notes}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li>
</ul>
<%= link_to format_activity_title(" #{ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name}"), poll_index_path(:polls_type => "Course", :polls_group_id => ma.course_id),
:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.course_message.polls_name}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
<% if ma.course_message.parent_id.nil? %>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布帖子</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ma.course_message.subject.html_safe, course_boards_path(ma.course_message.course,:parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id,
:topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.course_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
<% else %>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复帖子</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ma.course_message.subject.html_safe, course_boards_path(ma.course_message.course,:parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id,
:topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.course_message.subject.html_safe}" %> </a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
<% end %>
</ul>
<% end %>
<% if ma.course_message_type == "StudentWorksScore" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">评阅了作品</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to "#{ma.course_message.comment.nil? ? "分数:"+ma.course_message.score.to_s : "分数:"+ma.course_message.score.to_s + "----" + "评语:" + ma.course_message.comment}", student_work_index_path(:homework => ma.course_message.student_work.homework_common_id),:class=>"newsGrey",:title => "#{ma.course_message.comment}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "JournalsForMessage" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">回复了作品</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.course_message.notes, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id),:class=>"newsGrey",:title => "#{ma.course_message.notes}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% end %>
<!--项目消息-->
<% if ma.class == ForgeMessage %>
<% if ma.forge_message_type == "Issue" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %>
</li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">指派问题给我</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.forge_message.subject.html_safe, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ma.forge_message.subject.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "Journal" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue" %>
</li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
更新了问题
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to get_issue_des_update(ma.forge_message),
issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{get_issue_des_update(ma.forge_message)}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %></li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.forge_message.parent_id.nil? ? "发布帖子" : "回复帖子" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ma.forge_message.subject.html_safe, project_boards_path(ma.forge_message.project,
:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
:topic_id => ma.forge_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.forge_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "News" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %>
</li>
<li class="homepageNewsType fl">发布新闻</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ("#{ma.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ma.forge_message.id}, :class => "newsGrey", :title => "#{ma.forge_message.title.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "Comment" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">回复了新闻</li>
<li class="homepageNewsContent fl">
<%= link_to "#{ma.forge_message.comments.html_safe}",
{:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.forge_message.comments.html_safe}"%></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% end %>
<!--公共贴吧-->
<% if ma.class == MemoMessage %>
<% if ma.memo_type == "Memo" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.memo.author), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.memo.author, user_path(ma.memo.author), :class => "newsBlue" %>
</li>
<li class="homepageNewsType fl" ><%= ma.memo.parent_id.nil? ? "新建贴吧帖子" : "回复贴吧帖子" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.memo.content.html_safe, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id),:class => "newsGrey" , :title => "#{ma.memo.content.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.memo.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>
<!--用户留言-->
<% if ma.class == UserFeedbackMessage %>
<% if ma.journals_for_message_type == "JournalsForMessage" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.journals_for_message.user), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue" %>
</li>
<li class="homepageNewsType fl"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了" : "回复了你的留言" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.journals_for_message.notes.html_safe, feedback_path(ma.journals_for_message.jour_id), :class => "newsGrey", :title => "#{ma.journals_for_message.notes}".html_safe %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% end %>
<% end %>
<% end %>
<!--项目消息-->
<% unless @user_forge_messages.nil? %>
<% @user_forge_messages.each do |ufm| %>
<% if ufm.forge_message_type == "Issue" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ufm.forge_message.author), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ufm.forge_message.author, user_path(ufm.forge_message.author), :class => "newsBlue" %>
</li>
<li class="<%= ufm.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">指派问题给我</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ufm.forge_message.subject.html_safe, issue_path(:id => ufm.forge_message.id), :class => "#{ufm.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ufm.forge_message.subject.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ufm.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ufm.forge_message_type == "Journal" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ufm.forge_message.user), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ufm.forge_message.user, user_path(ufm.forge_message.user), :class => "newsBlue" %>
</li>
<li class="<%= ufm.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
更新了问题
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to get_issue_des_update(ufm.forge_message),
issue_path(:id => ufm.forge_message.journalized_id), :class => "#{ufm.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{get_issue_des_update(ufm.forge_message)}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ufm.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ufm.forge_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ufm.forge_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ufm.forge_message.author, user_path(ufm.forge_message.author), :class => "newsBlue" %></li>
<li class="<%= ufm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ufm.forge_message.parent_id.nil? ? "发布帖子" : "回复帖子" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ufm.forge_message.subject.html_safe, project_boards_path(ufm.forge_message.project,
:parent_id => ufm.forge_message.parent_id ? ufm.forge_message.parent_id : ufm.forge_message.id,
:topic_id => ufm.forge_message.id),:class=>"#{ufm.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ufm.forge_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ufm.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ufm.forge_message_type == "News" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ufm.forge_message.author), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ufm.forge_message.author, user_path(ufm.forge_message.author), :class => "newsBlue" %>
</li>
<li class="homepageNewsType fl">发布新闻</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ("#{ufm.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ufm.forge_message.id}, :class => "newsGrey", :title => "#{ufm.forge_message.title.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ufm.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ufm.forge_message_type == "Comment" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ufm.forge_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ufm.forge_message.author, user_path(ufm.forge_message.author), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">回复了新闻</li>
<li class="homepageNewsContent fl">
<%= link_to "#{ufm.forge_message.comments.html_safe}",
{:controller => 'news', :action => 'show', :id => ufm.forge_message.commented.id },:class =>"#{ufm.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ufm.forge_message.comments.html_safe}"%></li>
<li class="homepageNewsTime fl"><%= time_tag(ufm.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% end %>
<% end %>
<%# 公共贴吧 %>
<% unless @user_memo_messages.nil? %>
<% @user_memo_messages.each do |urm| %>
<% if urm.memo_type == "Memo" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(urm.memo.author), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to urm.memo.author, user_path(urm.memo.author), :class => "newsBlue" %>
</li>
<li class="homepageNewsType fl" ><%= urm.memo.parent_id.nil? ? "新建贴吧帖子" : "回复贴吧帖子" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to urm.memo.content.html_safe, forum_memo_path(urm.memo.forum_id, urm.memo.parent_id ? urm.memo.parent_id: urm.memo.id),:class => "newsGrey" , :title => "#{urm.memo.content.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(urm.memo.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>
<% end %>
<%# 用户留言消息 %>
<% unless @user_feedback_messages.nil? %>
<% @user_feedback_messages.each do |ufm| %>
<% if ufm.journals_for_message_type == "JournalsForMessage" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ufm.journals_for_message.user), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ufm.journals_for_message.user, user_path(ufm.journals_for_message.user), :class => "newsBlue" %>
</li>
<li class="homepageNewsType fl"><%= ufm.journals_for_message.reply_id == 0 ? "给你留言了" : "回复了你的留言" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ufm.journals_for_message.notes.html_safe, feedback_path(ufm.journals_for_message.jour_id), :class => "newsGrey", :title => "#{ufm.journals_for_message.notes}".html_safe %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ufm.journals_for_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% end %>
<% end %>
<% else %>
<div class="flash notice">暂无消息!</div>
<% end %>

View File

@ -37,180 +37,214 @@
<div>
<% if @new_message_count >0 %>
<%# 课程消息 %>
<% unless @user_message_all.nil? %>
<% @user_message_all.each do |uma| %>
<% if uma.message.course_message_type == "News" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.course_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.author, user_path(uma.message.course_message.author), :class => "newsBlue" %></li>
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布通知</li>
<li class="homepageNewsContent fl">
<%= link_to uma.message.course_message.title, {:controller => 'news', :action => 'show', :id => uma.message.course_message.id },
:class =>"#{uma.message.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{uma.message.course_message.title}" %></li>
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if uma.message.course_message_type == "Comment" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.course_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.author, user_path(uma.message.course_message.author), :class => "newsBlue" %></li>
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复了通知</li>
<li class="homepageNewsContent fl">
<%= link_to uma.message.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => uma.message.course_message.commented.id },
:class =>"#{uma.message.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{uma.message.course_message.comments.html_safe}" %></li>
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if uma.message.course_message_type == "HomeworkCommon" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.user, user_path(uma.message.course_message.user), :class => "newsBlue" %></a></li>
<li class="homepageNewsType fl">发布作业</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to uma.message.course_message.name, student_work_index_path(:homework => uma.message.course_message.id),:class => "newsGrey", :title => "#{uma.message.course_message.name}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if uma.message.course_message_type == "Poll" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.user, user_path(uma.message.course_message.user), :class => "newsBlue" %></a></li>
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布问卷</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to format_activity_title(" #{uma.message.course_message.polls_name.nil? ? "未命名问卷" : uma.message.course_message.polls_name}"), poll_index_path(:polls_type => "Course", :polls_group_id => uma.message.course_id),
:class=>"#{uma.message.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{uma.message.course_message.polls_name}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if uma.message.course_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.course_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.author, user_path(uma.message.course_message.author), :class => "newsBlue" %></li>
<% if uma.message.course_message.parent_id.nil? %>
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布帖子</li>
<% unless @message_alls.nil? %>
<% @message_alls.each do |ma| %>
<% if ma.class == CourseMessage %>
<% if ma.course_message_type == "News" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布通知</li>
<li class="homepageNewsContent fl">
<%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id },
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{ma.course_message.title}" %></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "Comment" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复了通知</li>
<li class="homepageNewsContent fl">
<%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{ma.course_message.comments.html_safe}" %></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "HomeworkCommon" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></a></li>
<li class="homepageNewsType fl">发布作业</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to uma.message.course_message.subject.html_safe, course_boards_path(uma.message.course_message.course,:parent_id => uma.message.course_message.parent_id ? uma.message.course_message.parent_id : uma.message.course_message.id,
:topic_id => uma.message.course_message.id),:class=>"#{uma.message.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{uma.message.course_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
<% else %>
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复帖子</li>
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),:class => "newsGrey", :title => "#{ma.course_message.name}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "Poll" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></a></li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布问卷</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to uma.message.course_message.subject.html_safe, course_boards_path(uma.message.course_message.course,:parent_id => uma.message.course_message.parent_id ? uma.message.course_message.parent_id : uma.message.course_message.id,
:topic_id => uma.message.course_message.id),:class=>"#{uma.message.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{uma.message.course_message.subject.html_safe}" %> </a></li>
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
<% end %>
</ul>
<% end %>
<% if uma.message.course_message_type == "StudentWorksScore" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.user, user_path(uma.message.course_message.user), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">评阅了作品</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to "#{uma.message.course_message.comment.nil? ? "分数:"+uma.message.course_message.score.to_s : "分数:"+uma.message.course_message.score.to_s + "----" + "评语:" + uma.message.course_message.comment}", student_work_index_path(:homework => uma.message.course_message.student_work.homework_common_id),:class=>"newsGrey",:title => "#{uma.message.course_message.comment}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if uma.message.course_message_type == "JournalsForMessage" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.user, user_path(uma.message.course_message.user), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">回复了作品</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to uma.message.course_message.notes, student_work_index_path(:homework => uma.message.course_message.jour.student_work.homework_common_id),:class=>"newsGrey",:title => "#{uma.message.course_message.notes}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
</ul>
<%= link_to format_activity_title(" #{ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name}"), poll_index_path(:polls_type => "Course", :polls_group_id => ma.course_id),
:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.course_message.polls_name}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
<% if ma.course_message.parent_id.nil? %>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布帖子</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ma.course_message.subject.html_safe, course_boards_path(ma.course_message.course,:parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id,
:topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.course_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
<% else %>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复帖子</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ma.course_message.subject.html_safe, course_boards_path(ma.course_message.course,:parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id,
:topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.course_message.subject.html_safe}" %> </a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
<% end %>
</ul>
<% end %>
<% if ma.course_message_type == "StudentWorksScore" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">评阅了作品</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to "#{ma.course_message.comment.nil? ? "分数:"+ma.course_message.score.to_s : "分数:"+ma.course_message.score.to_s + "----" + "评语:" + ma.course_message.comment}", student_work_index_path(:homework => ma.course_message.student_work.homework_common_id),:class=>"newsGrey",:title => "#{ma.course_message.comment}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "JournalsForMessage" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">回复了作品</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.course_message.notes, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id),:class=>"newsGrey",:title => "#{ma.course_message.notes}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% end %>
<!--项目消息-->
<% if ma.class == ForgeMessage %>
<% if ma.forge_message_type == "Issue" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %>
</li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">指派问题给我</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.forge_message.subject.html_safe, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ma.forge_message.subject.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "Journal" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue" %>
</li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
更新了问题
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to get_issue_des_update(ma.forge_message),
issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{get_issue_des_update(ma.forge_message)}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %></li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.forge_message.parent_id.nil? ? "发布帖子" : "回复帖子" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ma.forge_message.subject.html_safe, project_boards_path(ma.forge_message.project,
:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
:topic_id => ma.forge_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.forge_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
<% if uma.message.forge_message_type == "Issue" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.forge_message.author), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to uma.message.forge_message.author, user_path(uma.message.forge_message.author), :class => "newsBlue" %>
</li>
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">指派问题给我</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to uma.message.forge_message.subject.html_safe, issue_path(:id => uma.message.forge_message.id), :class => "#{uma.message.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{uma.message.forge_message.subject.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(uma.message.forge_message.created_on).html_safe %> </li>
</ul>
</ul>
<% end %>
<% if ma.forge_message_type == "News" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %>
</li>
<li class="homepageNewsType fl">发布新闻</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ("#{ma.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ma.forge_message.id}, :class => "newsGrey", :title => "#{ma.forge_message.title.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "Comment" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">回复了新闻</li>
<li class="homepageNewsContent fl">
<%= link_to "#{ma.forge_message.comments.html_safe}",
{:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.forge_message.comments.html_safe}"%></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% end %>
<% if uma.message.forge_message_type == "Journal" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.forge_message.user), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to uma.message.forge_message.user, user_path(uma.message.forge_message.user), :class => "newsBlue" %>
</li>
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
更新了问题
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to get_issue_des_update(uma.message.forge_message),
issue_path(:id => uma.message.forge_message.journalized_id), :class => "#{uma.message.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{get_issue_des_update(uma.message.forge_message)}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(uma.message.forge_message.created_on).html_safe %> </li>
</ul>
<!--公共贴吧-->
<% if ma.class == MemoMessage %>
<% if ma.memo_type == "Memo" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.memo.author), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.memo.author, user_path(ma.memo.author), :class => "newsBlue" %>
</li>
<li class="homepageNewsType fl" ><%= ma.memo.parent_id.nil? ? "新建贴吧帖子" : "回复贴吧帖子" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.memo.content.html_safe, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id),:class => "newsGrey" , :title => "#{ma.memo.content.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.memo.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>
<% if uma.message.forge_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.forge_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to uma.message.forge_message.author, user_path(uma.message.forge_message.author), :class => "newsBlue" %></li>
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= uma.message.forge_message.parent_id.nil? ? "发布帖子" : "回复帖子" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to uma.message.forge_message.subject.html_safe, project_boards_path(uma.message.forge_message.project,
:parent_id => uma.message.forge_message.parent_id ? uma.message.forge_message.parent_id : uma.message.forge_message.id,
:topic_id => uma.message.forge_message.id),:class=>"#{uma.message.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{uma.message.forge_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(uma.message.forge_message.created_on).html_safe %> </li>
</ul>
<!--用户留言-->
<% if ma.class == UserFeedbackMessage %>
<% if ma.journals_for_message_type == "JournalsForMessage" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.journals_for_message.user), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue" %>
</li>
<li class="homepageNewsType fl"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了" : "回复了你的留言" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.journals_for_message.notes.html_safe, feedback_path(ma.journals_for_message.jour_id), :class => "newsGrey", :title => "#{ma.journals_for_message.notes}".html_safe %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% end %>
<% if uma.message.forge_message_type == "News" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.forge_message.author), :width => "30", :height => "30") %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to uma.message.forge_message.author, user_path(uma.message.forge_message.author), :class => "newsBlue" %>
</li>
<li class="homepageNewsType fl">发布新闻</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ("#{uma.message.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => uma.message.forge_message.id}, :class => "newsGrey", :title => "#{uma.message.forge_message.title.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(uma.message.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if uma.message.forge_message_type == "Comment" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.forge_message.author), :width => "30", :height => "30") %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to uma.message.forge_message.author, user_path(uma.message.forge_message.author), :class => "newsBlue" %></li>
<li class="homepageNewsType fl">回复了新闻</li>
<li class="homepageNewsContent fl">
<%= link_to "#{uma.message.forge_message.comments.html_safe}",
{:controller => 'news', :action => 'show', :id => uma.message.forge_message.commented.id },:class =>"#{uma.message.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{uma.message.forge_message.comments.html_safe}"%></li>
<li class="homepageNewsTime fl"><%= time_tag(uma.message.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% end %>
<% end %>
<!--项目消息-->
<%# 公共贴吧 %>
<%# 用户留言消息 %>
<% else %>
<div class="flash notice">暂无消息!</div>

View File

@ -14,11 +14,12 @@
ActiveRecord::Schema.define(:version => 20150824133916) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
t.string "act_type", :null => false
t.integer "user_id", :null => false
t.integer "activity_container_id"
t.string "activity_container_type", :default => ""
t.integer "act_id", :null => false
t.string "act_type", :null => false
t.integer "user_id", :null => false
t.integer "activity_container_id"
t.string "activity_container_type", :default => ""
t.datetime "created_at"
end
add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type"
@ -881,14 +882,6 @@ ActiveRecord::Schema.define(:version => 20150824133916) do
t.datetime "updated_at", :null => false
end
create_table "message_publics", :force => true do |t|
t.integer "message_id"
t.string "massage_type"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "messages", :force => true do |t|
t.integer "board_id", :null => false
t.integer "parent_id"
@ -1539,6 +1532,7 @@ ActiveRecord::Schema.define(:version => 20150824133916) do
t.string "identity_url"
t.string "mail_notification", :default => "", :null => false
t.string "salt", :limit => 64
t.integer "gid"
end
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"