Commit 0261b0c6 authored by randx's avatar randx

Project activity inifinite scroll paging

parent 16e67fd8
...@@ -46,7 +46,7 @@ class ProjectsController < ApplicationController ...@@ -46,7 +46,7 @@ class ProjectsController < ApplicationController
def show def show
limit = (params[:limit] || 20).to_i 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| respond_to do |format|
format.html do format.html do
...@@ -57,6 +57,7 @@ class ProjectsController < ApplicationController ...@@ -57,6 +57,7 @@ class ProjectsController < ApplicationController
render "projects/empty" render "projects/empty"
end end
end end
format.js
end end
end end
......
...@@ -2,3 +2,7 @@ ...@@ -2,3 +2,7 @@
= render 'clone_panel' = render 'clone_panel'
= render "events/event_last_push", event: @last_push = render "events/event_last_push", event: @last_push
.content_list= render @events .content_list= render @events
.loading.hide
:javascript
$(function(){ Pager.init(20); });
:plain
Pager.append(#{@events.count}, "#{escape_javascript(render(@events))}");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment