|
|
|
@ -605,6 +605,15 @@ class CoursesController < ApplicationController
|
|
|
|
|
events = @activity.events(@date_from, @date_to, :is_public => 1)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 无新动态时,显示老动态
|
|
|
|
|
if events.count == 0
|
|
|
|
|
if User.current.member_of_course?(@course)|| User.current.admin?
|
|
|
|
|
events = @activity.events
|
|
|
|
|
else
|
|
|
|
|
events = @activity.events(:is_public => 1)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@offset, @limit = api_offset_and_limit({:limit => 10})
|
|
|
|
|
@events_count = events.count
|
|
|
|
|
@events_pages = Paginator.new @events_count, @limit, params['page']
|
|
|
|
|