个人主页消息铃铛翻页

This commit is contained in:
daiao 2016-12-17 15:34:26 +08:00
parent feca94ffc0
commit 73747a81d6
5 changed files with 28 additions and 7 deletions

View File

@ -437,6 +437,7 @@ class UsersController < ApplicationController
@message_alls = paginateHelper @message_alls, 25
respond_to do |format|
format.js
format.html{render :layout=>'new_base_user'}
end
end
@ -1868,7 +1869,7 @@ class UsersController < ApplicationController
@applied_message_alls << mess
end
elsif (message_all.message_type == "AppliedMessage" )
if (mess.applied_type == "AppliedProject" && mess.status == 1) || (mess.applied_type == "ApplyAddSchools" && mess.status == 0)
if (mess.applied_type == "StudentWorksScoresAppeal" && mess.status == 0) || (mess.applied_type == "AppliedProject" && mess.status == 1) || ( mess.applied_type == "ApplyAddSchools" && ApplyAddSchools.where(:school_id => mess.applied_id, :status => 0).count != 0 )
@applied_message_alls << mess
end
elsif message_all.message_type == "CourseMessage"
@ -2079,13 +2080,19 @@ class UsersController < ApplicationController
@message_alls << mess
end
elsif (message_all.message_type == "AppliedMessage" )
if (mess.applied_type == "AppliedProject" && mess.status == 1) || ( mess.applied_type == "ApplyAddSchools" && ApplyAddSchools.where(:school_id => mess.applied_id, :status => 0).count != 0 )
if (mess.applied_type == "StudentWorksScoresAppeal" && mess.status == 0) || (mess.applied_type == "AppliedProject" && mess.status == 1) || ( mess.applied_type == "ApplyAddSchools" && ApplyAddSchools.where(:school_id => mess.applied_id, :status => 0).count != 0 )
@message_alls << mess
end
elsif message_all.message_type == "CourseMessage"
if mess.course_message_type == "JoinCourseRequest" && mess.status == 0
@message_alls << mess
end
=begin
elsif message_all.message_type == "ForgeMessage"
if mess.forge_message_type == "PullRequest" && PullRequest.where(:forge_message_id => mess.forge_message_id, :status =>0 )
@message_alls << mess
end
=end
end
end
end

View File

@ -25,3 +25,14 @@
<ul class="pages" style="width: auto;display: table;margin-left: auto;margin-right: auto; padding-top: 10px">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
</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>

View File

@ -1,6 +1,6 @@
<% if ma.class == AtMessage && ma.at_valid? && ma.at_message %>
<ul class="homepageNewsList fl">
<div class="longMessageContents">
<div class="longMessageWidth">
<li class="homepageNewsPortrait fl">
<%= link_to image_tag(url_to_avatar(ma.author), :width => "30", :height => "30"), user_path(ma.author) %>
</li>

View File

@ -13,9 +13,11 @@
<% end %>
<!--总消息列表-->
<div id="all_message_list">
<% unless @message_alls.nil? %>
<%= render :partial => 'users/new_user_message', :locals => { :message_alls => @message_alls } %>
<% end %>
</div>
<!--项目消息-->
<% else %>
<div class="flash notice">您目前还没有相关消息!</div>

View File

@ -0,0 +1 @@
$("#all_message_list").html("<%= escape_javascript( render :partial => 'users/new_user_message', :locals => { :message_alls => @message_alls }) %>");