2017-01-12 17:14:52 +08:00
|
|
|
<%# 系统消息总显示在最上面 %>
|
|
|
|
<%= render :partial => 'users/user_message_system' %>
|
2016-12-07 09:00:33 +08:00
|
|
|
|
2017-01-12 17:14:52 +08:00
|
|
|
<% message_alls.each do |ma| %>
|
2017-01-13 11:13:22 +08:00
|
|
|
<% ma = ma.try(:message) %>
|
2017-01-12 16:19:11 +08:00
|
|
|
<% if ma.class == AtMessage && ma.at_valid? && ma.at_message %>
|
|
|
|
<%= render :partial => 'users/user_at_message', :locals => {:ma => ma} %>
|
|
|
|
<% end %>
|
2016-12-07 09:00:33 +08:00
|
|
|
|
|
|
|
<%# 课程消息 %>
|
2017-01-12 16:19:11 +08:00
|
|
|
<% if ma.class == CourseMessage %>
|
|
|
|
<%= render :partial => 'users/user_message_course', :locals => {:ma => ma} %>
|
|
|
|
<% end %>
|
2016-12-07 09:00:33 +08:00
|
|
|
|
|
|
|
<!--项目消息-->
|
2017-01-12 16:19:11 +08:00
|
|
|
<% if ma.class == ForgeMessage %>
|
|
|
|
<%= render :partial => 'users/user_message_forge', :locals => {:ma => ma} %>
|
|
|
|
<% end %>
|
2016-12-07 09:00:33 +08:00
|
|
|
|
2016-12-22 16:02:36 +08:00
|
|
|
<%# 竞赛消息 %>
|
2017-01-12 16:19:11 +08:00
|
|
|
<% if ma.class == ContestMessage %>
|
|
|
|
<%= render :partial => 'users/user_message_contest', :locals => {:ma => ma} %>
|
|
|
|
<% end %>
|
2016-12-22 16:02:36 +08:00
|
|
|
|
2017-01-11 17:32:04 +08:00
|
|
|
<%# 博客消息 %>
|
|
|
|
<%= render :partial => 'users/user_message_blog', :locals => {:ma => ma} %>
|
2016-12-07 09:00:33 +08:00
|
|
|
<!--公共贴吧-->
|
2017-01-12 16:19:11 +08:00
|
|
|
<% if ma.class == MemoMessage %>
|
|
|
|
<%= render :partial => 'users/user_message_forum', :locals => {:ma => ma} %>
|
|
|
|
<% end %>
|
2016-12-07 09:00:33 +08:00
|
|
|
|
|
|
|
<!--用户留言-->
|
2017-01-12 16:19:11 +08:00
|
|
|
<% if ma.class == UserFeedbackMessage %>
|
|
|
|
<%= render :partial => 'users/user_message_userfeedaback', :locals => {:ma => ma} %>
|
|
|
|
<% end %>
|
2016-12-07 09:00:33 +08:00
|
|
|
|
2017-01-12 16:19:11 +08:00
|
|
|
<% if ma.class == OrgMessage %>
|
|
|
|
<%= render :partial => 'users/user_message_org', :locals => {:ma => ma} %>
|
|
|
|
<% end %>
|
2016-12-07 09:00:33 +08:00
|
|
|
|
|
|
|
<%# 申请类消息 %>
|
2017-01-12 16:19:11 +08:00
|
|
|
<% if ma.class == AppliedMessage %>
|
|
|
|
<%= render :partial => 'users/user_message_applied', :locals => {:ma => ma} %>
|
|
|
|
<% end %>
|
2016-12-07 09:00:33 +08:00
|
|
|
<% end %>
|
|
|
|
|
2016-12-07 15:13:51 +08:00
|
|
|
<ul class="pages" style="width: auto;display: table;margin-left: auto;margin-right: auto; padding-top: 10px">
|
2017-01-13 11:13:22 +08:00
|
|
|
<%= pagination_links_full @message_all_pages, @messages_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
|
2016-12-17 15:34:26 +08:00
|
|
|
</ul>
|
|
|
|
<script>
|
|
|
|
$(function(){
|
|
|
|
$(".messageInformationContents").each(function(){
|
|
|
|
var parentWidth = $(this).parent().width();
|
|
|
|
var eq0Width = $(this).parent().children().eq(0).width();
|
|
|
|
var eq1Width = $(this).parent().children().eq(1).width();
|
|
|
|
var classWidth = parentWidth - eq0Width - eq1Width - 20;
|
|
|
|
$(this).css("max-width",classWidth + "px");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|