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:
parent
7913dafe50
commit
261a93fbbc
36 changed files with 25 additions and 111 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue