Project activity inifinite scroll paging
This commit is contained in:
parent
16e67fd8be
commit
0261b0c64c
|
@ -46,7 +46,7 @@ class ProjectsController < ApplicationController
|
|||
|
||||
def show
|
||||
limit = (params[:limit] || 20).to_i
|
||||
@events = @project.events.recent.limit(limit)
|
||||
@events = @project.events.recent.limit(limit).offset(params[:offset] || 0)
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
|
@ -57,6 +57,7 @@ class ProjectsController < ApplicationController
|
|||
render "projects/empty"
|
||||
end
|
||||
end
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -2,3 +2,7 @@
|
|||
= render 'clone_panel'
|
||||
= render "events/event_last_push", event: @last_push
|
||||
.content_list= render @events
|
||||
.loading.hide
|
||||
|
||||
:javascript
|
||||
$(function(){ Pager.init(20); });
|
||||
|
|
2
app/views/projects/show.js.haml
Normal file
2
app/views/projects/show.js.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
:plain
|
||||
Pager.append(#{@events.count}, "#{escape_javascript(render(@events))}");
|
Loading…
Reference in a new issue