Adds pagination to admin project list.

git-svn-id: http://svn.redmine.org/redmine/trunk@15755 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2016-08-30 20:10:56 +00:00
parent 3b7d651bbb
commit daab32923d
5 changed files with 14 additions and 7 deletions

View File

@@ -34,7 +34,10 @@ class AdminController < ApplicationController
scope = Project.status(@status).sorted
scope = scope.like(params[:name]) if params[:name].present?
@projects = scope.to_a
@project_count = scope.count
@project_pages = Paginator.new @project_count, per_page_option, params['page']
@projects = scope.limit(@project_pages.per_page).offset(@project_pages.offset).to_a
render :action => "projects", :layout => false if request.xhr?
end