|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
<font></font>
|
|
|
|
|
<div id="message_list_detail">
|
|
|
|
|
<h4 class="shadowbox_news_title">未读消息</h4>
|
|
|
|
|
<p style="display: none;" id="none_message" class="shadowbox_news_p text_c">无未读消息</p>
|
|
|
|
|
<ul class="shadowbox_news_list">
|
|
|
|
|
<% messages.each do |ma| %>
|
|
|
|
|
<% if ma.class == SystemMessage %>
|
|
|
|
@ -123,13 +125,42 @@
|
|
|
|
|
<% elsif AtMessage === ma && ma.at_valid? %>
|
|
|
|
|
<% if ma.at_message_type == "Message" && !ma.at_message.course.nil? %>
|
|
|
|
|
<% href = course_boards_path(ma.at_message.course,:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id) %>
|
|
|
|
|
<li><a href="<%=href %>" target="_blank" title="<%=ma.author.show_name %> 提到了你:<%= ma.subject.html_safe%>"><span class="shadowbox_news_user"><%=ma.author.show_name %> </span>提到了你:<%= ma.subject.html_safe%></a></li>
|
|
|
|
|
<% elsif ma.at_message_type == "Message" && !ma.at_message.project.nil? %>
|
|
|
|
|
<% href = project_boards_path(ma.at_message.project,:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id) %>
|
|
|
|
|
<% href = project_boards_path(ma.at_message.project,:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id) %>
|
|
|
|
|
<li><a href="<%=href %>" target="_blank" title="<%=ma.author.show_name %> 提到了你:<%= ma.subject.html_safe%>"><span class="shadowbox_news_user"><%=ma.author.show_name %> </span>提到了你:<%= ma.subject.html_safe%></a></li>
|
|
|
|
|
<% else %>
|
|
|
|
|
<% href = ma.url %>
|
|
|
|
|
<% content = '<span class="shadowbox_news_user">'+ma.author.show_name+' </span>提到了你:'+ma.subject.html_safe %>
|
|
|
|
|
<li><%=link_to content.html_safe, ma.url, :title => ma.author.show_name+' 提到了你:'+ma.subject.html_safe, :target => '_blank' %></li>
|
|
|
|
|
<% end %>
|
|
|
|
|
<li><a href="<%=href %>" target="_blank" title="<%=ma.author.show_name %> 提到了你:<%= ma.subject.html_safe%>"><span class="shadowbox_news_user"><%=ma.author.show_name %> </span>提到了你:<%= ma.subject.html_safe%></a></li>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</ul>
|
|
|
|
|
<%= link_to '查看全部', user_message_path(User.current), :class => "shadowbox_news_all", :target =>"_Blank" %>
|
|
|
|
|
<a onclick = "show_more();" id = "show_more_messages" style="display: none" class = "shadowbox_news_all">展开更多</a>
|
|
|
|
|
<%= link_to '查看全部', user_message_path(User.current),:id =>'show_all_messages', :class => "shadowbox_news_all", :style => "display:none", :target =>"_Blank" %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(function(){
|
|
|
|
|
if($(".shadowbox_news_list li").length > 5) {
|
|
|
|
|
$(".shadowbox_news_list li").hide();
|
|
|
|
|
$(".shadowbox_news_list li").eq(0).show();
|
|
|
|
|
$(".shadowbox_news_list li").eq(1).show();
|
|
|
|
|
$(".shadowbox_news_list li").eq(2).show();
|
|
|
|
|
$(".shadowbox_news_list li").eq(3).show();
|
|
|
|
|
$(".shadowbox_news_list li").eq(4).show();
|
|
|
|
|
$("#show_more_messages").show();
|
|
|
|
|
} else if ($(".shadowbox_news_list li").length == 0) {
|
|
|
|
|
$("#none_message").show();
|
|
|
|
|
$("#show_all_messages").show();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$("#show_all_messages").show();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
function show_more() {
|
|
|
|
|
$(".shadowbox_news_list li").show();
|
|
|
|
|
$("#show_more_messages").hide();
|
|
|
|
|
$("#show_all_messages").show();
|
|
|
|
|
}
|
|
|
|
|
</script>
|