消息排序(公共表)
This commit is contained in:
parent
5306d7e2a4
commit
0da75afc88
|
@ -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
|
@new_message_count = @user.forge_messages.count + @user.memo_messages.count + @user.course_messages.count + @user.user_feedback_messages.count
|
||||||
case params[:type]
|
case params[:type]
|
||||||
when nil
|
when nil
|
||||||
@all_message = MessageAll.where("user_id =?",@user).order("created_at desc")
|
@message_alls = []
|
||||||
@user_course_messages = CourseMessage.where("user_id =?",@user).order("created_at desc")
|
messages = MessageAll.where("user_id =?",@user).order("created_at desc")
|
||||||
@user_forge_messages = ForgeMessage.where("user_id =?",@user).order("created_at desc")
|
messages.each do |message_all|
|
||||||
@user_memo_messages = MemoMessage.where("user_id =?",@user).order("created_at desc")
|
@message_alls << message_all.message
|
||||||
@user_feedback_messages = UserFeedbackMessage.where("user_id =?",@user).order("created_at desc")
|
end
|
||||||
@user_course_messages_count = @user_course_messages.count
|
|
||||||
@user_forge_messages_count = @user_forge_messages.count
|
# @user_course_messages = MessageAll.where("user_id =? and message_type=?",@user,"CourseMessage").order("created_at desc")
|
||||||
@user_memo_messages_count = @user_memo_messages.count
|
# @user_forge_messages = MessageAll.where("user_id =? and message_type=?",@user,"ForgeMessage").order("created_at desc")
|
||||||
@user_feedback_messages_count = @user_feedback_messages.count
|
# @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'
|
when 'homework'
|
||||||
@user_course_messages = 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")
|
||||||
@user_course_messages_count = @user_course_messages.count
|
#@user_course_messages_count = @user_course_messages.count
|
||||||
when 'course_message'
|
when 'course_message'
|
||||||
@user_course_messages = 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")
|
||||||
@user_course_messages_count = @user_course_messages.count
|
#@user_course_messages_count = @user_course_messages.count
|
||||||
when 'forge_message'
|
when 'forge_message'
|
||||||
@user_forge_messages = 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")
|
||||||
@user_forge_messages_count = @user_forge_messages.count
|
#@user_forge_messages_count = @user_forge_messages.count
|
||||||
when 'course_news'
|
when 'course_news'
|
||||||
@user_course_messages = 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")
|
||||||
@user_course_messages_count = @user_course_messages.count
|
#@user_course_messages_count = @user_course_messages.count
|
||||||
when 'forge_news'
|
when 'forge_news'
|
||||||
@user_forge_messages = 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")
|
||||||
@user_forge_messages_count = @user_forge_messages.count
|
#@user_forge_messages_count = @user_forge_messages.count
|
||||||
when 'course_news_reply'
|
when 'course_news_reply'
|
||||||
@user_course_messages = 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'
|
||||||
@user_forge_messages = 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")
|
||||||
@user_forge_messagess_count = @user_forge_messages.count
|
#@user_forge_messagess_count = @user_forge_messages.count
|
||||||
when 'poll'
|
when 'poll'
|
||||||
@user_course_messages = 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")
|
||||||
@user_course_messages_count = @user_course_messages.count
|
#@user_course_messages_count = @user_course_messages.count
|
||||||
when 'works_reviewers'
|
when 'works_reviewers'
|
||||||
@user_course_messages = 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")
|
||||||
@user_course_messages_count = @user_course_messages.count
|
#@user_course_messages_count = @user_course_messages.count
|
||||||
when 'works_reply'
|
when 'works_reply'
|
||||||
@user_course_messages = 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")
|
||||||
@user_course_messages_count = @user_course_messages.count
|
#@user_course_messages_count = @user_course_messages.count
|
||||||
when 'issue'
|
when 'issue'
|
||||||
@user_forge_messages = 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")
|
||||||
@user_forge_messages_count = @user_forge_messages.count
|
#@user_forge_messages_count = @user_forge_messages.count
|
||||||
when 'issue_update' # 缺陷状态更新、留言
|
when 'issue_update' # 缺陷状态更新、留言
|
||||||
@user_forge_messages = 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")
|
||||||
@user_forge_messages_count = @user_forge_messages.count
|
#@user_forge_messages_count = @user_forge_messages.count
|
||||||
when 'forum'
|
when 'forum'
|
||||||
@user_memo_messages = 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")
|
||||||
@user_memo_messages_count = @user_memo_messages.count
|
#@user_memo_messages_count = @user_memo_messages.count
|
||||||
when 'user_feedback'
|
when 'user_feedback'
|
||||||
@user_feedback_messages = 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")
|
||||||
@user_feedback_messages_count = @user_feedback_messages.count
|
#@user_feedback_messages_count = @user_feedback_messages.count
|
||||||
else
|
else
|
||||||
render_404
|
render_404
|
||||||
return
|
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
|
@new_message_count = @user.forge_messages.count + @user.memo_messages.count + @user.course_messages.count + @user.user_feedback_messages.count
|
||||||
case params[:type]
|
case params[:type]
|
||||||
when nil
|
when nil
|
||||||
@user_message_all = MessageAll.where("user_id =?", @user).order("created_at desc")
|
@message_alls = []
|
||||||
@user_message_all_count = @user_message_all.count
|
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'
|
when 'homework'
|
||||||
@user_course_messages = 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")
|
||||||
@user_course_messages_count = @user_course_messages.count
|
#@user_course_messages_count = @user_course_messages.count
|
||||||
when 'course_message'
|
when 'course_message'
|
||||||
@user_course_messages = 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")
|
||||||
@user_course_messages_count = @user_course_messages.count
|
#@user_course_messages_count = @user_course_messages.count
|
||||||
when 'forge_message'
|
when 'forge_message'
|
||||||
@user_forge_messages = 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")
|
||||||
@user_forge_messages_count = @user_forge_messages.count
|
#@user_forge_messages_count = @user_forge_messages.count
|
||||||
when 'course_news'
|
when 'course_news'
|
||||||
@user_course_messages = 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")
|
||||||
@user_course_messages_count = @user_course_messages.count
|
#@user_course_messages_count = @user_course_messages.count
|
||||||
when 'forge_news'
|
when 'forge_news'
|
||||||
@user_forge_messages = 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")
|
||||||
@user_forge_messages_count = @user_forge_messages.count
|
#@user_forge_messages_count = @user_forge_messages.count
|
||||||
when 'course_news_reply'
|
when 'course_news_reply'
|
||||||
@user_course_messages = 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'
|
||||||
@user_forge_messages = 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")
|
||||||
@user_forge_messagess_count = @user_forge_messages.count
|
#@user_forge_messagess_count = @user_forge_messages.count
|
||||||
when 'poll'
|
when 'poll'
|
||||||
@user_course_messages = 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")
|
||||||
@user_course_messages_count = @user_course_messages.count
|
#@user_course_messages_count = @user_course_messages.count
|
||||||
when 'works_reviewers'
|
when 'works_reviewers'
|
||||||
@user_course_messages = 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")
|
||||||
@user_course_messages_count = @user_course_messages.count
|
#@user_course_messages_count = @user_course_messages.count
|
||||||
when 'works_reply'
|
when 'works_reply'
|
||||||
@user_course_messages = 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")
|
||||||
@user_course_messages_count = @user_course_messages.count
|
#@user_course_messages_count = @user_course_messages.count
|
||||||
when 'issue'
|
when 'issue'
|
||||||
@user_forge_messages = 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")
|
||||||
@user_forge_messages_count = @user_forge_messages.count
|
#@user_forge_messages_count = @user_forge_messages.count
|
||||||
when 'issue_update' # 缺陷状态更新、留言
|
when 'issue_update' # 缺陷状态更新、留言
|
||||||
@user_forge_messages = 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")
|
||||||
@user_forge_messages_count = @user_forge_messages.count
|
#@user_forge_messages_count = @user_forge_messages.count
|
||||||
when 'forum'
|
when 'forum'
|
||||||
@user_memo_messages = 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")
|
||||||
@user_memo_messages_count = @user_memo_messages.count
|
#@user_memo_messages_count = @user_memo_messages.count
|
||||||
when 'user_feedback'
|
when 'user_feedback'
|
||||||
@user_feedback_messages = 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")
|
||||||
@user_feedback_messages_count = @user_feedback_messages.count
|
#@user_feedback_messages_count = @user_feedback_messages.count
|
||||||
else
|
else
|
||||||
render_404
|
render_404
|
||||||
return
|
return
|
||||||
|
|
|
@ -37,217 +37,213 @@
|
||||||
<div>
|
<div>
|
||||||
<% if @new_message_count >0 %>
|
<% if @new_message_count >0 %>
|
||||||
<%# 课程消息 %>
|
<%# 课程消息 %>
|
||||||
<% unless @user_course_messages.nil? %>
|
<% unless @message_alls.nil? %>
|
||||||
<% @user_course_messages.each do |ucm| %>
|
<% @message_alls.each do |ma| %>
|
||||||
<% if ucm.course_message_type == "News" %>
|
<% if ma.class == CourseMessage %>
|
||||||
<ul class="homepageNewsList fl">
|
<% if ma.course_message_type == "News" %>
|
||||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.author), :width => "30", :height => "30") %></a></li>
|
<ul class="homepageNewsList fl">
|
||||||
<li class="homepageNewsPublisher fl"><%=link_to ucm.course_message.author, user_path(ucm.course_message.author), :class => "newsBlue" %></li>
|
<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="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布通知</li>
|
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
|
||||||
<li class="homepageNewsContent fl">
|
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布通知</li>
|
||||||
<%= link_to ucm.course_message.title, {:controller => 'news', :action => 'show', :id => ucm.course_message.id },
|
<li class="homepageNewsContent fl">
|
||||||
:class =>"#{ucm.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
<%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id },
|
||||||
:title => "#{ucm.course_message.title}" %></li>
|
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li>
|
:title => "#{ma.course_message.title}" %></li>
|
||||||
</ul>
|
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
|
||||||
<% end %>
|
</ul>
|
||||||
<% if ucm.course_message_type == "Comment" %>
|
<% end %>
|
||||||
<ul class="homepageNewsList fl">
|
<% if ma.course_message_type == "Comment" %>
|
||||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.author), :width => "30", :height => "30") %></a></li>
|
<ul class="homepageNewsList fl">
|
||||||
<li class="homepageNewsPublisher fl"><%=link_to ucm.course_message.author, user_path(ucm.course_message.author), :class => "newsBlue" %></li>
|
<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="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复了通知</li>
|
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
|
||||||
<li class="homepageNewsContent fl">
|
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复了通知</li>
|
||||||
<%= link_to ucm.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ucm.course_message.commented.id },
|
<li class="homepageNewsContent fl">
|
||||||
:class =>"#{ucm.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
<%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
|
||||||
:title => "#{ucm.course_message.comments.html_safe}" %></li>
|
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li>
|
:title => "#{ma.course_message.comments.html_safe}" %></li>
|
||||||
</ul>
|
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
|
||||||
<% end %>
|
</ul>
|
||||||
<% if ucm.course_message_type == "HomeworkCommon" %>
|
<% end %>
|
||||||
<ul class="homepageNewsList fl">
|
<% if ma.course_message_type == "HomeworkCommon" %>
|
||||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.user), :width => "30", :height => "30") %></a></li>
|
<ul class="homepageNewsList fl">
|
||||||
<li class="homepageNewsPublisher fl"><%=link_to ucm.course_message.user, user_path(ucm.course_message.user), :class => "newsBlue" %></a></li>
|
<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="homepageNewsType fl">发布作业</li>
|
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></a></li>
|
||||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
<li class="homepageNewsType fl">发布作业</li>
|
||||||
<%= 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>
|
|
||||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
<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,
|
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),:class => "newsGrey", :title => "#{ma.course_message.name}" %></a></li>
|
||||||
:topic_id => ucm.course_message.id),:class=>"#{ucm.viewed==0?"newsBlack":"newsGrey"}",
|
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
|
||||||
:title => "#{ucm.course_message.subject.html_safe}" %></a></li>
|
</ul>
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li>
|
<% end %>
|
||||||
<% else %>
|
<% if ma.course_message_type == "Poll" %>
|
||||||
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复帖子</li>
|
<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">
|
<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,
|
<%= 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),
|
||||||
:topic_id => ucm.course_message.id),:class=>"#{ucm.viewed==0?"newsBlack":"newsGrey"}",
|
:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
|
||||||
:title => "#{ucm.course_message.subject.html_safe}" %> </a></li>
|
:title => "#{ma.course_message.polls_name}" %></a></li>
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li>
|
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
|
||||||
<% end %>
|
</ul>
|
||||||
</ul>
|
<% end %>
|
||||||
<% end %>
|
<% if ma.course_message_type == "Message" %>
|
||||||
<% if ucm.course_message_type == "StudentWorksScore" %>
|
<ul class="homepageNewsList fl">
|
||||||
<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="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 ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
|
||||||
<li class="homepageNewsPublisher fl"><%=link_to ucm.course_message.user, user_path(ucm.course_message.user), :class => "newsBlue" %></li>
|
<% if ma.course_message.parent_id.nil? %>
|
||||||
<li class="homepageNewsType fl">评阅了作品</li>
|
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布帖子</li>
|
||||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
<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>
|
<%=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,
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_at).html_safe %> </li>
|
:topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
|
||||||
</ul>
|
:title => "#{ma.course_message.subject.html_safe}" %></a></li>
|
||||||
<% end %>
|
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
|
||||||
<% if ucm.course_message_type == "JournalsForMessage" %>
|
<% else %>
|
||||||
<ul class="homepageNewsList fl">
|
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复帖子</li>
|
||||||
<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="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||||
<li class="homepageNewsPublisher fl"><%=link_to ucm.course_message.user, user_path(ucm.course_message.user), :class => "newsBlue" %></li>
|
<%=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,
|
||||||
<li class="homepageNewsType fl">回复了作品</li>
|
:topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
|
||||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
:title => "#{ma.course_message.subject.html_safe}" %> </a></li>
|
||||||
<%= 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(ma.course_message.created_on).html_safe %> </li>
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li>
|
<% end %>
|
||||||
</ul>
|
</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 %>
|
<% 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 %>
|
||||||
<% 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 %>
|
<% else %>
|
||||||
<div class="flash notice">暂无消息!</div>
|
<div class="flash notice">暂无消息!</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -37,180 +37,214 @@
|
||||||
<div>
|
<div>
|
||||||
<% if @new_message_count >0 %>
|
<% if @new_message_count >0 %>
|
||||||
<%# 课程消息 %>
|
<%# 课程消息 %>
|
||||||
<% unless @user_message_all.nil? %>
|
<% unless @message_alls.nil? %>
|
||||||
<% @user_message_all.each do |uma| %>
|
<% @message_alls.each do |ma| %>
|
||||||
<% if uma.message.course_message_type == "News" %>
|
<% if ma.class == CourseMessage %>
|
||||||
<ul class="homepageNewsList fl">
|
<% if ma.course_message_type == "News" %>
|
||||||
<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>
|
<ul class="homepageNewsList fl">
|
||||||
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.author, user_path(uma.message.course_message.author), :class => "newsBlue" %></li>
|
<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="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布通知</li>
|
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
|
||||||
<li class="homepageNewsContent fl">
|
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布通知</li>
|
||||||
<%= link_to uma.message.course_message.title, {:controller => 'news', :action => 'show', :id => uma.message.course_message.id },
|
<li class="homepageNewsContent fl">
|
||||||
:class =>"#{uma.message.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
<%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id },
|
||||||
:title => "#{uma.message.course_message.title}" %></li>
|
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
|
:title => "#{ma.course_message.title}" %></li>
|
||||||
</ul>
|
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
|
||||||
<% end %>
|
</ul>
|
||||||
<% if uma.message.course_message_type == "Comment" %>
|
<% end %>
|
||||||
<ul class="homepageNewsList fl">
|
<% if ma.course_message_type == "Comment" %>
|
||||||
<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>
|
<ul class="homepageNewsList fl">
|
||||||
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.author, user_path(uma.message.course_message.author), :class => "newsBlue" %></li>
|
<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="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复了通知</li>
|
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
|
||||||
<li class="homepageNewsContent fl">
|
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复了通知</li>
|
||||||
<%= link_to uma.message.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => uma.message.course_message.commented.id },
|
<li class="homepageNewsContent fl">
|
||||||
:class =>"#{uma.message.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
<%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
|
||||||
:title => "#{uma.message.course_message.comments.html_safe}" %></li>
|
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
|
:title => "#{ma.course_message.comments.html_safe}" %></li>
|
||||||
</ul>
|
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
|
||||||
<% end %>
|
</ul>
|
||||||
<% if uma.message.course_message_type == "HomeworkCommon" %>
|
<% end %>
|
||||||
<ul class="homepageNewsList fl">
|
<% if ma.course_message_type == "HomeworkCommon" %>
|
||||||
<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>
|
<ul class="homepageNewsList fl">
|
||||||
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.user, user_path(uma.message.course_message.user), :class => "newsBlue" %></a></li>
|
<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="homepageNewsType fl">发布作业</li>
|
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></a></li>
|
||||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
<li class="homepageNewsType fl">发布作业</li>
|
||||||
<%= 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>
|
|
||||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
<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,
|
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),:class => "newsGrey", :title => "#{ma.course_message.name}" %></a></li>
|
||||||
:topic_id => uma.message.course_message.id),:class=>"#{uma.message.viewed==0?"newsBlack":"newsGrey"}",
|
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
|
||||||
:title => "#{uma.message.course_message.subject.html_safe}" %></a></li>
|
</ul>
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
|
<% end %>
|
||||||
<% else %>
|
<% if ma.course_message_type == "Poll" %>
|
||||||
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复帖子</li>
|
<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">
|
<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,
|
<%= 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),
|
||||||
:topic_id => uma.message.course_message.id),:class=>"#{uma.message.viewed==0?"newsBlack":"newsGrey"}",
|
:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
|
||||||
:title => "#{uma.message.course_message.subject.html_safe}" %> </a></li>
|
:title => "#{ma.course_message.polls_name}" %></a></li>
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
|
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
|
||||||
<% end %>
|
</ul>
|
||||||
</ul>
|
<% end %>
|
||||||
<% end %>
|
<% if ma.course_message_type == "Message" %>
|
||||||
<% if uma.message.course_message_type == "StudentWorksScore" %>
|
<ul class="homepageNewsList fl">
|
||||||
<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="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 ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
|
||||||
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.user, user_path(uma.message.course_message.user), :class => "newsBlue" %></li>
|
<% if ma.course_message.parent_id.nil? %>
|
||||||
<li class="homepageNewsType fl">评阅了作品</li>
|
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布帖子</li>
|
||||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
<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>
|
<%=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,
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_at).html_safe %> </li>
|
:topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
|
||||||
</ul>
|
:title => "#{ma.course_message.subject.html_safe}" %></a></li>
|
||||||
<% end %>
|
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
|
||||||
<% if uma.message.course_message_type == "JournalsForMessage" %>
|
<% else %>
|
||||||
<ul class="homepageNewsList fl">
|
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复帖子</li>
|
||||||
<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="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||||
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.user, user_path(uma.message.course_message.user), :class => "newsBlue" %></li>
|
<%=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,
|
||||||
<li class="homepageNewsType fl">回复了作品</li>
|
:topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
|
||||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
:title => "#{ma.course_message.subject.html_safe}" %> </a></li>
|
||||||
<%= 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(ma.course_message.created_on).html_safe %> </li>
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
|
<% end %>
|
||||||
</ul>
|
</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 %>
|
<% 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>
|
||||||
<ul class="homepageNewsList fl">
|
<% end %>
|
||||||
<li class="homepageNewsPortrait fl">
|
<% if ma.forge_message_type == "News" %>
|
||||||
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.forge_message.author), :width => "30", :height => "30") %></a>
|
<ul class="homepageNewsList fl">
|
||||||
</li>
|
<li class="homepageNewsPortrait fl">
|
||||||
<li class="homepageNewsPublisher fl">
|
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30") %></a>
|
||||||
<%=link_to uma.message.forge_message.author, user_path(uma.message.forge_message.author), :class => "newsBlue" %>
|
</li>
|
||||||
</li>
|
<li class="homepageNewsPublisher fl">
|
||||||
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">指派问题给我</li>
|
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %>
|
||||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
</li>
|
||||||
<%= 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 class="homepageNewsType fl">发布新闻</li>
|
||||||
</li>
|
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(uma.message.forge_message.created_on).html_safe %> </li>
|
<%= 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>
|
||||||
</ul>
|
</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 %>
|
<% end %>
|
||||||
<% if uma.message.forge_message_type == "Journal" %>
|
<!--公共贴吧-->
|
||||||
<ul class="homepageNewsList fl">
|
<% if ma.class == MemoMessage %>
|
||||||
<li class="homepageNewsPortrait fl">
|
<% if ma.memo_type == "Memo" %>
|
||||||
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.forge_message.user), :width => "30", :height => "30") %></a>
|
<ul class="homepageNewsList fl">
|
||||||
</li>
|
<li class="homepageNewsPortrait fl">
|
||||||
<li class="homepageNewsPublisher fl">
|
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.memo.author), :width => "30", :height => "30") %></a>
|
||||||
<%=link_to uma.message.forge_message.user, user_path(uma.message.forge_message.user), :class => "newsBlue" %>
|
</li>
|
||||||
</li>
|
<li class="homepageNewsPublisher fl">
|
||||||
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
|
<%=link_to ma.memo.author, user_path(ma.memo.author), :class => "newsBlue" %>
|
||||||
更新了问题
|
</li>
|
||||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
<li class="homepageNewsType fl" ><%= ma.memo.parent_id.nil? ? "新建贴吧帖子" : "回复贴吧帖子" %></li>
|
||||||
<%= link_to get_issue_des_update(uma.message.forge_message),
|
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||||
issue_path(:id => uma.message.forge_message.journalized_id), :class => "#{uma.message.viewed == 0 ? "newsBlack" : "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>
|
||||||
:title => "#{get_issue_des_update(uma.message.forge_message)}" %></a>
|
</li>
|
||||||
</li>
|
<li class="homepageNewsTime fl"><%= time_tag(ma.memo.created_at).html_safe %> </li>
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(uma.message.forge_message.created_on).html_safe %> </li>
|
</ul>
|
||||||
</ul>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if uma.message.forge_message_type == "Message" %>
|
<!--用户留言-->
|
||||||
<ul class="homepageNewsList fl">
|
<% if ma.class == UserFeedbackMessage %>
|
||||||
<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>
|
<% if ma.journals_for_message_type == "JournalsForMessage" %>
|
||||||
<li class="homepageNewsPublisher fl"><%=link_to uma.message.forge_message.author, user_path(uma.message.forge_message.author), :class => "newsBlue" %></li>
|
<ul class="homepageNewsList fl">
|
||||||
|
<li class="homepageNewsPortrait fl">
|
||||||
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= uma.message.forge_message.parent_id.nil? ? "发布帖子" : "回复帖子" %></li>
|
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ma.journals_for_message.user), :width => "30", :height => "30") %></a>
|
||||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
</li>
|
||||||
<%=link_to uma.message.forge_message.subject.html_safe, project_boards_path(uma.message.forge_message.project,
|
<li class="homepageNewsPublisher fl">
|
||||||
:parent_id => uma.message.forge_message.parent_id ? uma.message.forge_message.parent_id : uma.message.forge_message.id,
|
<%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue" %>
|
||||||
:topic_id => uma.message.forge_message.id),:class=>"#{uma.message.viewed==0?"newsBlack":"newsGrey"}",
|
</li>
|
||||||
:title => "#{uma.message.forge_message.subject.html_safe}" %></a></li>
|
<li class="homepageNewsType fl"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了" : "回复了你的留言" %></li>
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(uma.message.forge_message.created_on).html_safe %> </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>
|
||||||
</ul>
|
</li>
|
||||||
|
<li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
<% 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 %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!--项目消息-->
|
<!--项目消息-->
|
||||||
|
|
||||||
<%# 公共贴吧 %>
|
|
||||||
|
|
||||||
<%# 用户留言消息 %>
|
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="flash notice">暂无消息!</div>
|
<div class="flash notice">暂无消息!</div>
|
||||||
|
|
20
db/schema.rb
20
db/schema.rb
|
@ -14,11 +14,12 @@
|
||||||
ActiveRecord::Schema.define(:version => 20150824133916) do
|
ActiveRecord::Schema.define(:version => 20150824133916) do
|
||||||
|
|
||||||
create_table "activities", :force => true do |t|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
t.string "act_type", :null => false
|
t.string "act_type", :null => false
|
||||||
t.integer "user_id", :null => false
|
t.integer "user_id", :null => false
|
||||||
t.integer "activity_container_id"
|
t.integer "activity_container_id"
|
||||||
t.string "activity_container_type", :default => ""
|
t.string "activity_container_type", :default => ""
|
||||||
|
t.datetime "created_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type"
|
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
|
t.datetime "updated_at", :null => false
|
||||||
end
|
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|
|
create_table "messages", :force => true do |t|
|
||||||
t.integer "board_id", :null => false
|
t.integer "board_id", :null => false
|
||||||
t.integer "parent_id"
|
t.integer "parent_id"
|
||||||
|
@ -1539,6 +1532,7 @@ ActiveRecord::Schema.define(:version => 20150824133916) do
|
||||||
t.string "identity_url"
|
t.string "identity_url"
|
||||||
t.string "mail_notification", :default => "", :null => false
|
t.string "mail_notification", :default => "", :null => false
|
||||||
t.string "salt", :limit => 64
|
t.string "salt", :limit => 64
|
||||||
|
t.integer "gid"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"
|
add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id"
|
||||||
|
|
Loading…
Reference in New Issue