socialforge/app/views/users/user_messages.html.erb

639 lines
48 KiB
Plaintext
Raw Normal View History

2015-09-02 14:15:26 +08:00
<div class="homepageRightBanner">
2015-09-17 14:41:03 +08:00
<div class="NewsBannerName"><%= title_for_message(params[:type]) %></div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="newsType">
<li><%= link_to "全部",user_message_path(User.current), :class => "resourcesGrey" %></li>
<li><%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "resourcesGrey" %></li>
<li><%= link_to "用户申请", user_message_path(User.current, :type => 'apply'), :class => "resourcesGrey" %></li>
<%# 课程相关消息 %>
<li><%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "resourcesGrey" %></li>
<li><%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "resourcesGrey" %></li>
<li><%= link_to "课程通知",user_message_path(User.current, :type => 'course_news'), :class => "resourcesGrey" %></li>
<!--<li><%#= link_to "通知回复", user_message_path(User.current, :type => 'course_news_reply'), :class => "resourcesGrey" %></li>-->
<!--<li><%#= link_to "课程问卷", user_message_path(User.current, :type => 'poll'), :class => "resourcesGrey" %></a></li>-->
<!--<li><%#= link_to "作品评阅", user_message_path(User.current, :type => 'works_reviewers'), :class => "resourcesGrey" %></li>-->
<!--<li><%#= link_to "作品讨论", user_message_path(User.current, :type => 'works_reply'), :class => "resourcesGrey" %></li>-->
<%# 项目相关消息 %>
<li><%= link_to "项目任务", user_message_path(User.current, :type => 'issue'), :class => "resourcesGrey" %></li>
<!--<li><%#= link_to "问题更新", user_message_path(User.current, :type => 'issue_update'), :class => "resourcesGrey" %></li>-->
<!--<li><%#= link_to "项目讨论区", user_message_path(User.current, :type => 'forge_message'), :class => "resourcesGrey" %></li>-->
<!--<li><%#= link_to "项目新闻", user_message_path(User.current, :type => 'forge_news'), :class => "resourcesGrey" %></li>-->
<!--<li><%#= link_to "新闻回复", user_message_path(User.current, :type => 'forge_news_reply'), :class => "resourcesGrey" %></li>-->
<%# 项目相关消息 %>
<li><%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "resourcesGrey" %></li>
<%# 系统贴吧 %>
<li><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "resourcesGrey" %></li>
<%# 系统消息 %>
2015-09-18 13:30:25 +08:00
<li><%= link_to "系统消息", user_system_messages_path(User.current), :class => "resourcesGrey" %></li>
2015-09-17 14:41:03 +08:00
</ul>
</li>
</ul>
</div>
2015-08-28 17:05:27 +08:00
<div class="resources mt10" id="users_setting">
<div>
<% if @message_alls.count >0 || @user_system_messages.count >0 %>
<% if params[:type].nil? || params[:type] == "unviewed" %>
<div class="newsReadSetting">
有&nbsp;<span class="c_red"><%= unviewed_message(@user) %></span>&nbsp;条未读
<% unless (unviewed_message(@user) == 0 || User.current != @user) %>
<a href="javascript:void(0);" class="ml15"><%= link_to "全部设为已读", user_message_path(User.current, :viewed => 'all') %></a>
<% end %>
</div>
<% end %>
2015-09-09 17:43:33 +08:00
<%# 系统消息 %>
2015-09-17 14:41:03 +08:00
<% if params[:type] != 'system_messages' %>
<% @user_system_messages.each do |usm| %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/logo.png", width: "30px", height: "30px", class: "mt3") %></div></a>
</li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">Trustie平台</span><span class="homepageNewsType fl">发布新消息:</span>
</li>
2015-09-18 09:35:26 +08:00
<span style="color: red;float: left">【系统消息】</span><li class="homepageSystenMessageContent fl" id="content_<%= usm.id %>">
<li class="homepageSystenMessageContent fl">
<%= link_to usm.subject.blank? ? (usm.content.nil? ? usm.description.html_safe : usm.content.html_safe) : usm.subject, user_system_messages_path(User.current),
2015-09-17 14:41:03 +08:00
:id => "content_link_#{usm.id}",
:onmouseover =>"message_titile_show($(this),event);",
:onmouseout => "message_titile_hide($(this));"
%>
</li>
<div style="display:none;" class="message_title_red system_message_style">
<% unless usm.subject.blank? %>
2015-09-18 17:49:43 +08:00
<p><strong>标题:</strong><%= usm.subject %></p>
2015-09-18 17:01:30 +08:00
<% end %>
<% if (!usm.description.blank?) || (!usm.content.blank?) %>
<div class="fl"><strong>内容:</strong></div><div class="ml36"><%= usm.description.nil? ? usm.content.html_safe : usm.description.html_safe %></div>
2015-09-18 16:09:55 +08:00
<% end %>
2015-09-17 14:41:03 +08:00
</div>
<li class="homepageNewsTime fl"><%= time_tag(usm.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>
<!--总消息列表-->
2015-08-28 17:05:27 +08:00
<% unless @message_alls.nil? %>
<% @message_alls.each do |ma| %>
<%# 课程消息 %>
2015-08-28 17:05:27 +08:00
<% if ma.class == CourseMessage %>
<% if ma.course_message_type == "News" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"),user_path(ma.course_message.author) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了通知:</span></li>
<li class="homepageNewsContent fl">
<%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id },
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
2015-09-18 11:25:23 +08:00
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %></li>
<div style="display: none" class="message_title_red system_message_style">
2015-09-19 10:25:58 +08:00
<p><strong>标题:</strong><%= ma.course_message.title %></p>
2015-09-19 10:57:42 +08:00
<% unless ma.course_message.description.nil? %>
<div class="fl"><strong>内容:</strong></div>
<div class="ml36"><%= ma.course_message.description.html_safe %></div>
<% end %>
2015-09-18 11:25:23 +08:00
</div>
2015-08-30 11:20:37 +08:00
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
2015-08-28 17:05:27 +08:00
</ul>
2015-08-24 14:29:38 +08:00
<% end %>
2015-08-28 17:05:27 +08:00
<% if ma.course_message_type == "Comment" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了通知:</span></li>
<li class="homepageNewsContent fl">
<%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
2015-09-02 16:21:47 +08:00
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %></li>
2015-09-18 11:25:23 +08:00
<div style="display: none" class="message_title_red system_message_style">
2015-09-19 10:25:58 +08:00
<p><strong>标题:</strong><%= ma.course_message.commented.title %></p>
2015-09-19 10:57:42 +08:00
<% unless ma.course_message.comments.nil? %>
<div class="fl"><strong>内容:</strong></div>
<div class="ml36"><%= ma.course_message.comments.html_safe %></div>
<% end %>
2015-09-02 16:21:47 +08:00
</div>
2015-08-30 11:20:37 +08:00
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
2015-08-28 17:05:27 +08:00
</ul>
<% end %>
2015-09-19 10:54:50 +08:00
<% if ma.course_message_type == "HomeworkCommon" && ma.status.nil? %>
2015-08-28 17:05:27 +08:00
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了作业:</span></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
2015-09-18 11:25:23 +08:00
<%= 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))" %></a></li>
<div style="display: none" class="message_title_red system_message_style">
2015-09-19 10:25:58 +08:00
<p><strong>标题:</strong><%= ma.course_message.name %></p>
2015-09-19 10:57:42 +08:00
<% unless ma.course_message.description.nil? %>
<div class="fl"><strong>内容:</strong></div>
<div class="ml36"><%= ma.course_message.description.html_safe %></div>
<% end %>
2015-09-18 11:25:23 +08:00
</div>
2015-08-30 11:20:37 +08:00
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
2015-09-11 14:41:23 +08:00
</ul>
<% end %>
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 1 %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的作业:</span></li>
2015-09-17 14:41:03 +08:00
<% if ma.viewed == 0 %>
2015-09-11 14:41:23 +08:00
<li class="homepageHomeworkContent fl">
2015-09-18 11:25:23 +08:00
<%= 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))" %>
2015-09-11 14:41:23 +08:00
</li>
2015-09-18 11:25:23 +08:00
<div style="display: none" class="message_title_red system_message_style">
<%= ma.course_message.name %>
</div>
2015-09-11 14:41:23 +08:00
<li class="homepageHomeworkContentWarn fl"> &nbsp;&nbsp; 截止时间快到了!</li>
2015-09-17 14:41:03 +08:00
<% else %>
2015-09-11 14:41:23 +08:00
<li class="homepageNewsContent fl">
2015-09-18 11:25:23 +08:00
<%= 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))"%>
2015-09-11 14:41:23 +08:00
</li>
2015-09-18 11:25:23 +08:00
<div style="display: none" class="message_title_red system_message_style">
<%= ma.course_message.name %>
</div>
2015-09-17 14:41:03 +08:00
<% end %>
2015-08-30 11:20:37 +08:00
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
2015-08-28 17:05:27 +08:00
</ul>
<% end %>
2015-09-19 10:54:50 +08:00
<!--作品开启匿评 待整合:时间紧-->
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 2 %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的作业:</span></li>
<% if ma.viewed == 0 %>
<li class="homepageHomeworkContent fl">
<%= 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))" %>
</li>
<div style="display: none" class="message_title_red system_message_style">
<%= ma.course_message.name %>
</div>
<li class="homepageHomeworkContentWarn fl"> &nbsp;&nbsp; 开启匿评了!</li>
<% else %>
<li class="homepageNewsContent fl">
<%= 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))"%>
</li>
<div style="display: none" class="message_title_red system_message_style">
<%= ma.course_message.name %>
</div>
<% end %>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<!--作品关闭匿评-->
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 3 %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的作业:</span></li>
<% if ma.viewed == 0 %>
<li class="homepageHomeworkContent fl">
<%= 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))" %>
</li>
<div style="display: none" class="message_title_red system_message_style">
<%= ma.course_message.name %>
</div>
<li class="homepageHomeworkContentWarn fl"> &nbsp;&nbsp; 匿评已经关闭!</li>
<% else %>
<li class="homepageNewsContent fl">
<%= 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))"%>
</li>
<div style="display: none" class="message_title_red system_message_style">
<%= ma.course_message.name %>
</div>
<% end %>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
2015-08-28 17:05:27 +08:00
<% if ma.course_message_type == "Poll" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了问卷:</span></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= 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"}",
2015-09-18 11:25:23 +08:00
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %></a></li>
<div style="display: none" class="message_title_red system_message_style">
<%= ma.course_message.polls_name %>
</div>
2015-08-30 11:20:37 +08:00
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
2015-08-28 17:05:27 +08:00
</ul>
<% end %>
<% if ma.course_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %></span></li>
2015-09-02 19:35:51 +08:00
<% if ma.course_message.parent_id.nil? %>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= 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"}",
2015-09-19 10:57:42 +08:00
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %></a></li>
<div style="display: none" class="message_title_red system_message_style" >
<p><strong>主题:</strong><%= ma.course_message.subject %></p>
<% unless ma.course_message.content.nil? %>
<div class="fl"><strong>内容:</strong></div>
<div class="ml36"><%= ma.course_message.content.html_safe %></div>
<% end %>
</div>
2015-09-02 19:35:51 +08:00
<% else %>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= 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))" %></a></li>
2015-09-18 11:25:23 +08:00
<div style="display: none" class="message_title_red system_message_style" >
2015-09-19 10:25:58 +08:00
<p><strong>主题:</strong><%= ma.course_message.subject %></p>
2015-09-19 10:57:42 +08:00
<% unless ma.course_message.content.nil? %>
<div class="fl"><strong>内容:</strong></div>
<div class="ml36"><%= ma.course_message.content.html_safe %></div>
<% end %>
2015-09-02 19:35:51 +08:00
</div>
<% end %>
2015-08-30 11:20:37 +08:00
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
2015-08-24 14:29:38 +08:00
2015-08-28 17:05:27 +08:00
</ul>
2015-08-24 14:29:38 +08:00
<% end %>
2015-08-28 17:05:27 +08:00
<% if ma.course_message_type == "StudentWorksScore" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.status == 0 ? "评阅了作品:" : "重新评阅了作品:" %></span></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<% unless ma.content.nil? %>
2015-09-18 11:25:23 +08:00
<%= 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))" %></a></li>
<div style="display: none" class="message_title_red system_message_style" >
<%= ma.content.html_safe %>
</div>
2015-08-28 17:05:27 +08:00
<% end %>
2015-08-30 11:20:37 +08:00
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
2015-08-25 11:10:08 +08:00
</ul>
2015-08-24 14:29:38 +08:00
<% end %>
2015-09-17 14:41:03 +08:00
<% if ma.course_message_type == "JournalsForMessage" %>
<% if ma.course_message.jour_type == 'Course' %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a>
</li>
<li class="homepageNewsPubType fl"><%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">在课程中留言了:</span>
2015-09-17 14:41:03 +08:00
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= 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))" %></a>
</li>
2015-09-18 11:25:23 +08:00
<div style="display: none" class="message_title_red system_message_style">
2015-09-17 14:41:03 +08:00
<%= ma.course_message.notes.html_safe %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
2015-09-16 11:28:35 +08:00
2015-09-17 14:41:03 +08:00
<% else %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a>
</li>
<li class="homepageNewsPubType fl"><%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">回复了作品评论:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
2015-09-18 11:25:23 +08:00
<%= 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))" %></a>
2015-09-17 14:41:03 +08:00
</li>
2015-09-18 11:25:23 +08:00
<div style="display: none" class="message_title_red system_message_style">
<%= ma.course_message.notes %>
</div>
2015-09-17 14:41:03 +08:00
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>
2015-08-28 17:05:27 +08:00
<% end %>
<!--项目消息-->
<% if ma.class == ForgeMessage %>
<!--申请加入项目-->
<% if ma.forge_message_type == "AppliedProject" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user) %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">申请加入项目:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
2015-09-18 11:25:23 +08:00
<%= 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))" %></a>
</li>
2015-09-18 11:25:23 +08:00
<div style="display: none" class="message_title_red system_message_style">
<%= ma.project %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<!--邀请加入项目-->
<% if ma.forge_message_type == "ProjectInvite" %>
<% inviter = User.find(ma.forge_message_id) %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(inviter), :width => "30", :height => "30"), user_path(inviter) %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to inviter, user_path(inviter), :class => "newsBlue homepageNewsPublisher" %>
2015-09-21 14:28:22 +08:00
<span class='<%= ma.viewed == 0 ? 'homepageNewsTypeNotRead fl' : 'homepageNewsType fl' %>'>邀请你加入项目</span>
</li>
2015-09-21 14:28:22 +08:00
<% if ma.user.member_of?(ma.project) %>
<li class="homepageNewsContent fl">
<% else %>
<li class="homepageHomeworkContent fl">
<% end %>
<%= link_to ma.project, project_path(ma.project),
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
</li>
<div style="display: none" class="message_title_red system_message_style">
<%= ma.project %>
</div>
2015-09-21 14:28:22 +08:00
<% unless User.current.member_of?(ma.project) %>
<li class="homepageHomeworkContentWarn fl">
<%=link_to "同意加入", {:controller => 'projects', :action => 'member', :id => ma.project_id, :message_id =>ma.id, :key => ma.secret_key},
:value => ma.secret_key,
:class => "green_btn_cir ml10",
:style => "color:#fff" %>
</li>
2015-09-19 09:19:35 +08:00
<% end %>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
2015-08-28 17:05:27 +08:00
<% if ma.forge_message_type == "Issue" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">指派了问题给你:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
2015-09-18 11:25:23 +08:00
<%= 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))" %></a>
2015-08-28 17:05:27 +08:00
</li>
2015-09-18 11:25:23 +08:00
<div style="display: none" class="message_title_red system_message_style">
2015-09-19 10:25:58 +08:00
<p><strong>主题:</strong><%= ma.forge_message.subject %></p>
2015-09-19 10:57:42 +08:00
<% unless ma.forge_message.description.nil? || ma.forge_message.description == "" %>
<div class="fl"><strong>描述:</strong></div>
<div class="ml36"><%= ma.forge_message.description.html_safe %></div>
<% end %>
2015-09-18 11:25:23 +08:00
</div>
2015-08-30 11:20:37 +08:00
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
2015-08-28 17:05:27 +08:00
</ul>
<% end %>
<% if ma.forge_message_type == "Journal" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user) %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
更新了问题状态:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= 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"}",
2015-09-16 17:35:08 +08:00
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %></a>
2015-08-28 17:05:27 +08:00
</li>
2015-09-18 11:25:23 +08:00
<div style="display: none" class="message_title_red system_message_style" >
2015-09-18 17:49:43 +08:00
<p><strong>问题标题:</strong><%= ma.forge_message.journalized.subject %></p>
<div class="fl"><strong>更新内容:</strong></div>
2015-09-19 10:25:58 +08:00
<div class="ml60"><%= get_issue_des_update(ma.forge_message).html_safe %></div>
2015-09-16 17:35:08 +08:00
</div>
2015-08-30 11:20:37 +08:00
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
2015-08-28 17:05:27 +08:00
</ul>
<% end %>
<% if ma.forge_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %></span></li>
2015-09-02 19:35:51 +08:00
<% if ma.forge_message.parent_id.nil? %>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
2015-09-18 11:25:23 +08:00
<%= 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))" %></a></li>
<div style="display: none" class="message_title_red system_message_style">
2015-09-19 10:25:58 +08:00
<p><strong>主题:</strong><%= ma.forge_message.subject %></p>
2015-09-19 10:57:42 +08:00
<% unless ma.forge_message.content.nil? %>
<div class="fl"><strong>内容:</strong></div>
<div class="ml36"><%= ma.forge_message.content.html_safe %></div>
<% end %>
2015-09-18 11:25:23 +08:00
</div>
2015-09-02 19:35:51 +08:00
<% else %>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
2015-09-18 11:25:23 +08:00
<%= 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))" %></a></li>
<div style="display: none" class="message_title_red system_message_style">
2015-09-19 10:25:58 +08:00
<p><strong>主题:</strong><%= ma.forge_message.subject %></p>
2015-09-19 10:57:42 +08:00
<% unless ma.forge_message.content.nil? %>
<div class="fl"><strong>内容:</strong></div>
<div class="ml36"><%= ma.forge_message.content.html_safe %></div>
<% end %>
2015-09-02 19:35:51 +08:00
</div>
<% end %>
2015-08-30 11:20:37 +08:00
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
2015-08-28 17:05:27 +08:00
</ul>
<% end %>
<% if ma.forge_message_type == "News" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了新闻:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
2015-09-18 11:25:23 +08:00
<%= 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))" %></a>
2015-08-28 17:05:27 +08:00
</li>
2015-09-18 11:25:23 +08:00
<div style="display: none" class="message_title_red system_message_style">
2015-09-19 10:25:58 +08:00
<p><strong>标题:</strong><%= ma.forge_message.title %></p>
2015-09-19 10:57:42 +08:00
<% unless ma.forge_message.description.nil? %>
<div class="fl"><strong>内容:</strong></div>
<div class="ml36"><%= ma.forge_message.description.html_safe %></div>
<% end %>
2015-09-18 11:25:23 +08:00
</div>
2015-08-30 11:20:37 +08:00
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
2015-08-28 17:05:27 +08:00
</ul>
<% end %>
<% if ma.forge_message_type == "Comment" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了新闻:</span></li>
<li class="homepageNewsContent fl">
<%= link_to "#{ma.forge_message.comments.html_safe}",
2015-09-02 16:21:47 +08:00
{:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
2015-09-18 11:25:23 +08:00
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
2015-09-02 16:21:47 +08:00
</li>
2015-09-18 11:25:23 +08:00
<div style="display: none" class="message_title_red system_message_style">
2015-09-19 10:25:58 +08:00
<p><strong>新闻标题:</strong><%= ma.forge_message.commented.title %></p>
<div class="fl"><strong>评论内容:</strong></div>
<div class="ml60"><%= ma.forge_message.comments.html_safe %></div>
2015-09-18 11:25:23 +08:00
</div>
2015-08-30 11:20:37 +08:00
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
2015-08-28 17:05:27 +08:00
</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);"><%=link_to image_tag(url_to_avatar(ma.memo.author), :width => "30", :height => "30"), user_path(ma.memo.author) %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.memo.author, user_path(ma.memo.author), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>" ><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %></span>
</li>
2015-09-02 19:35:51 +08:00
<% if ma.memo.parent_id.nil? %>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= 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"}",
2015-09-18 11:25:23 +08:00
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %></a>
2015-09-02 19:35:51 +08:00
</li>
2015-09-18 11:25:23 +08:00
<div style="display: none" class="message_title_red system_message_style">
2015-09-18 17:49:43 +08:00
<p><strong>标题:</strong><%= ma.memo.subject %></p>
2015-09-19 10:57:42 +08:00
<% unless ma.memo.content.nil? %>
<div class="fl"><strong>内容:</strong></div>
<div class="ml36"><%= ma.memo.content.html_safe %></div>
<% end %>
2015-09-18 11:25:23 +08:00
</div>
2015-09-02 19:35:51 +08:00
<% else %>
<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 =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %></a>
</li>
2015-09-18 11:25:23 +08:00
<div style="display: none" class="message_title_red system_message_style">
2015-09-18 17:49:43 +08:00
<p><strong>标题:</strong><%= ma.memo.subject %></p>
2015-09-19 10:57:42 +08:00
<% unless ma.memo.content.nil? %>
<div class="fl"><strong>内容:</strong></div>
<div class="ml36"><%= ma.memo.content.html_safe %></div>
<% end %>
2015-09-02 19:35:51 +08:00
</div>
<% end %>
2015-08-28 17:05:27 +08:00
<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);"><%=link_to image_tag(url_to_avatar(ma.journals_for_message.user), :width => "30", :height => "30"), user_path(ma.journals_for_message.user) %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %></span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
2015-09-02 16:21:47 +08:00
<%= 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))" %></a>
2015-08-28 17:05:27 +08:00
</li>
2015-09-18 11:25:23 +08:00
<div style="display: none" class="message_title_red system_message_style" >
2015-09-02 16:21:47 +08:00
<%= ma.journals_for_message.notes.html_safe %>
</div>
2015-08-28 17:05:27 +08:00
<li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
2015-09-01 17:37:43 +08:00
2015-08-28 17:05:27 +08:00
</ul>
2015-08-24 14:29:38 +08:00
<% end %>
2015-08-21 09:41:59 +08:00
<% end %>
<% end %>
2015-08-28 17:05:27 +08:00
<ul class="wlist" style=" border:none; padding-top: 15px;">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
2015-08-21 09:41:59 +08:00
<% end %>
2015-08-28 17:05:27 +08:00
<!--项目消息-->
<% else %>
<div class="flash notice">您目前还没有相关消息!</div>
<% end %>
<div class="cl"></div>
</div>
</div>
2015-08-21 17:40:28 +08:00
2015-09-02 16:21:47 +08:00
<script>
2015-09-17 14:41:03 +08:00
function message_titile_show(obj,e)
{
obj.parent().next("div").show();
obj.parent().next("div").css("top",e.pageY).css("left",e.pageX).css("position","absolute");
}
function message_titile_hide(obj)
{
obj.parent().next("div").hide();
}
2015-09-16 11:28:35 +08:00
2015-09-17 14:41:03 +08:00
function show_more_system_messages(list,content, id2, id3) {
$(list).toggleClass("show_more_li");
$(content).toggleClass("show_more_system_message");
var information = $(id2);
var val = information.attr("value");
if (val == "show_more") {
$(id2).text("[收起]");
information.attr("value", "hide_more");
information.attr("style", "color:#3ca5c6");
}
else {
$(id2).text("[展开]");
information.attr("value", "show_more");
information.attr("style", "color:#0781b4;");
}
}
2015-09-02 16:21:47 +08:00
</script>
2015-08-24 14:29:38 +08:00
2015-09-01 17:37:43 +08:00
2015-08-24 14:29:38 +08:00