班级动态只有10条,底部却显示“点击展开更多”
This commit is contained in:
parent
27fa113de1
commit
808b553e43
|
@ -888,23 +888,25 @@ class CoursesController < ApplicationController
|
||||||
if params[:type].present?
|
if params[:type].present?
|
||||||
case params[:type]
|
case params[:type]
|
||||||
when "homework"
|
when "homework"
|
||||||
@course_activities = course_activities.where("course_act_type = 'HomeworkCommon'").order('updated_at desc').limit(10).offset(@page * 10)
|
@course_activities = course_activities.where("course_act_type = 'HomeworkCommon'").order('updated_at desc')
|
||||||
when "news"
|
when "news"
|
||||||
@course_activities = course_activities.where("course_act_type = 'News'").order('updated_at desc').limit(10).offset(@page * 10)
|
@course_activities = course_activities.where("course_act_type = 'News'").order('updated_at desc')
|
||||||
when "message"
|
when "message"
|
||||||
@course_activities = course_activities.where("course_act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
|
@course_activities = course_activities.where("course_act_type = 'Message'").order('updated_at desc')
|
||||||
when "poll"
|
when "poll"
|
||||||
@course_activities = course_activities.where("course_act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10)
|
@course_activities = course_activities.where("course_act_type = 'Poll'").order('updated_at desc')
|
||||||
when "attachment"
|
when "attachment"
|
||||||
@course_activities = course_activities.where("course_act_type = 'Attachment'").order('updated_at desc').limit(10).offset(@page * 10)
|
@course_activities = course_activities.where("course_act_type = 'Attachment'").order('updated_at desc')
|
||||||
when "journalsForMessage"
|
when "journalsForMessage"
|
||||||
@course_activities = course_activities.where("course_act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10)
|
@course_activities = course_activities.where("course_act_type = 'JournalsForMessage'").order('updated_at desc')
|
||||||
else
|
else
|
||||||
@course_activities = course_activities.order('updated_at desc').limit(10).offset(@page * 10)
|
@course_activities = course_activities.order('updated_at desc')
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@course_activities = course_activities.order('updated_at desc').limit(10).offset(@page * 10)
|
@course_activities = course_activities.order('updated_at desc')
|
||||||
end
|
end
|
||||||
|
@course_activities_count = @course_activities.count
|
||||||
|
@course_activities = @course_activities.limit(10).offset(@page * 10)
|
||||||
@type = params[:type]
|
@type = params[:type]
|
||||||
|
|
||||||
@left_nav_type = 1
|
@left_nav_type = 1
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if course_activities.count == 10 %>
|
<% if course_activities.count + page * 10 < @course_activities_count %>
|
||||||
<!--<div id="show_more_course_activities" class="loadMore mt10 f_grey">点击展开更多<%#= link_to "", course_activity_path(@course.id, :type => type, :page => page), :id => "more_course_activities_link", :remote => "true", :class => "none" %></div>-->
|
<!--<div id="show_more_course_activities" class="loadMore mt10 f_grey">点击展开更多<%#= link_to "", course_activity_path(@course.id, :type => type, :page => page), :id => "more_course_activities_link", :remote => "true", :class => "none" %></div>-->
|
||||||
<%= link_to "点击展开更多",course_activity_path(@course.id, :type => type, :page => page),:id => "show_more_course_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
<%= link_to "点击展开更多",course_activity_path(@course.id, :type => type, :page => page),:id => "show_more_course_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in New Issue