<% if @message_alls.count >0 || @user_system_messages.count >0 %>
<% if params[:type].nil? || params[:type] == "unviewed" %>
<% end %>
<%# 系统消息 %>
<% if params[:type] != 'system_messages' %>
<% @user_system_messages.each do |usm| %>
-
<%= image_tag("/images/logo.png", width: "30px", height: "30px", class: "mt3") %>
-
Trustie平台发布新消息:
【系统消息】-
-
<%= link_to usm.content.nil? ? usm.description.html_safe : usm.content.html_safe, user_message_path(User.current, :type => "system_messages"),
:id => "content_link_#{usm.id}",
:onmouseover =>"message_titile_show($(this),event);",
:onmouseout => "message_titile_hide($(this));"
%>
<%= usm.content.nil? ? usm.description.html_safe : usm.content.html_safe %>
- <%= time_tag(usm.created_at).html_safe %>
<% end %>
<% end %>
<%# 课程消息 %>
<% unless @message_alls.nil? %>
<% @message_alls.each do |ma| %>
<% if ma.class == CourseMessage %>
<% if ma.course_message_type == "News" %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"),user_path(ma.course_message.author) %>
- <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %>">发布了通知:
-
<%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id },
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.course_message.title.html_safe %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% if ma.course_message_type == "Comment" %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %>
- <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %>">评论了通知:
-
<%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.course_message.comments.html_safe %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% if ma.course_message_type == "HomeworkCommon" && ma.status != 1 %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
- <%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>">发布了作业:
-
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.course_message.name %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 1 %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
- <%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>">发布的作业:
<% if ma.viewed == 0 %>
-
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.course_message.name %>
- 截止时间快到了!
<% else %>
-
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))"%>
<%= ma.course_message.name %>
<% end %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% if ma.course_message_type == "Poll" %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
- <%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>">发布了问卷:
-
<%= link_to format_activity_title(" #{ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name}"), poll_path(ma.course_message.id),
:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.course_message.polls_name %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% if ma.course_message_type == "Message" %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %>
- <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %>"><%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %>
<% if ma.course_message.parent_id.nil? %>
-
<%= link_to ma.course_message.subject, 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}" %>
<% else %>
-
<%= link_to ma.course_message.content.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"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.course_message.content.html_safe %>
<% end %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% if ma.course_message_type == "StudentWorksScore" %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
- <%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>"><%= ma.status == 0 ? "评阅了作品:" : "重新评阅了作品:" %>
-
<% unless ma.content.nil? %>
<%= link_to ma.content.html_safe, student_work_index_path(:homework => ma.course_message.student_work.homework_common_id),
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.content.html_safe %>
<% end %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% if ma.course_message_type == "JournalsForMessage" %>
<% if ma.course_message.jour_type == 'Course' %>
-
<%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
- <%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
">在课程中留言了:
-
<%= link_to ma.course_message.notes.html_safe, course_feedback_path(:id => ma.course_id),
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.course_message.notes.html_safe %>
- <%= time_tag(ma.created_at).html_safe %>
<% else %>
-
<%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
- <%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
">回复了作品评论:
-
<%= link_to ma.course_message.notes, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.course_message.notes %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% end %>
<% end %>
<% if ma.class == ForgeMessage %>
<% if ma.forge_message_type == "AppliedProject" %>
-
<%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user) %>
-
<%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue homepageNewsPublisher" %>
">申请加入项目:
-
<%= link_to ma.project, settings_project_path(:id => ma.project, :tab => "members"), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.project %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% if ma.forge_message_type == "Issue" %>
-
<%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
-
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
">指派了问题给你:
-
<%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.forge_message.subject %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% if ma.forge_message_type == "Journal" %>
-
<%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user) %>
-
<%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue homepageNewsPublisher" %>
">
更新了问题状态:
-
<%= link_to get_issue_des_update(ma.forge_message).html_safe,
issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= get_issue_des_update(ma.forge_message).html_safe %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% if ma.forge_message_type == "Message" %>
- <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
- <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %>
<% if ma.forge_message.parent_id.nil? %>
-
<%= link_to ma.forge_message.subject, 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"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.forge_message.subject.html_safe %>
<% else %>
-
<%= link_to ma.forge_message.content.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"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.forge_message.content.html_safe %>
<% end %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% if ma.forge_message_type == "News" %>
-
<%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
-
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
">发布了新闻:
-
<%= link_to ("#{ma.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ma.forge_message.id},
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.forge_message.title.html_safe %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% if ma.forge_message_type == "Comment" %>
- <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
- <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
">评论了新闻:
-
<%= link_to "#{ma.forge_message.comments.html_safe}",
{:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.forge_message.comments.html_safe %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% end %>
<% if ma.class == MemoMessage %>
<% if ma.memo_type == "Memo" %>
-
<%=link_to image_tag(url_to_avatar(ma.memo.author), :width => "30", :height => "30"), user_path(ma.memo.author) %>
-
<%=link_to ma.memo.author, user_path(ma.memo.author), :class => "newsBlue homepageNewsPublisher" %>
" ><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %>
<% if ma.memo.parent_id.nil? %>
-
<%= link_to ma.memo.subject, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.memo.subject %>
<% else %>
-
<%= 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 =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
标题:<%= ma.memo.subject %>
内容:<%= ma.memo.content.html_safe %>
<% end %>
- <%= time_tag(ma.memo.created_at).html_safe %>
<% end %>
<% end %>
<% if ma.class == UserFeedbackMessage %>
<% if ma.journals_for_message_type == "JournalsForMessage" %>
-
<%=link_to image_tag(url_to_avatar(ma.journals_for_message.user), :width => "30", :height => "30"), user_path(ma.journals_for_message.user) %>
-
<%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue homepageNewsPublisher" %>
"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %>
-
<%= link_to ma.journals_for_message.notes.html_safe, feedback_path(ma.journals_for_message.jour_id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<%= ma.journals_for_message.notes.html_safe %>
- <%= time_tag(ma.journals_for_message.created_on).html_safe %>
<% end %>
<% end %>
<%# 系统消息 %>
<% if ma.class == SystemMessage %>
-
<%=image_tag("/images/logo.png",width:"30px", height: "30px",class: "mt3")%>
- Trustie平台发布新消息:
【系统消息】-
<%= link_to ma.content.nil? ? ma.description.html_safe : ma.content.html_safe, user_message_path(User.current, :type => "system_messages"),
:id => "content_link_#{ma.id}",
:onmouseover =>"message_titile_show($(this),event);",
:onmouseout => "message_titile_hide($(this));"
%>
[展开]
<%= ma.content.nil? ? ma.description.html_safe : ma.content.html_safe %>
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
<% end %>
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
<% end %>
<% else %>
您目前还没有相关消息!
<% end %>