Replace the existing pagination of changesets in the browser with a

simple next/previous pagination that avoids the need to count the total
number of matches.
This commit is contained in:
Tom Hughes 2009-11-18 20:21:54 +00:00
parent 7913dafe50
commit 261a93fbbc
36 changed files with 25 additions and 111 deletions

View file

@ -307,11 +307,15 @@ class ChangesetController < ApplicationController
@description = t 'changeset.list.description'
end
@edit_pages, @edits = paginate(:changesets,
:include => [:user, :changeset_tags],
:conditions => conditions,
:order => "changesets.created_at DESC",
:per_page => 20)
@page = (params[:page] || 1).to_i
@page_size = 20
@edits = Changeset.find(:all,
:include => [:user, :changeset_tags],
:conditions => conditions,
:order => "changesets.created_at DESC",
:offset => (@page - 1) * @page_size,
:limit => @page_size)
end
private