Makes #per_page_links take a paginator.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11032 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-12-17 20:19:48 +00:00
parent 56669f9b13
commit 7f152d3485
1 changed files with 4 additions and 4 deletions

View File

@ -199,7 +199,7 @@ module Redmine
html << "(#{paginator.first_item}-#{paginator.last_item}/#{paginator.item_count}) " html << "(#{paginator.first_item}-#{paginator.last_item}/#{paginator.item_count}) "
if per_page_links != false && links = per_page_links(paginator.per_page, paginator.item_count, &block) if per_page_links != false && links = per_page_links(paginator, &block)
html << "| #{links}" html << "| #{links}"
end end
@ -207,11 +207,11 @@ module Redmine
end end
# Renders the "Per page" links. # Renders the "Per page" links.
def per_page_links(selected=nil, item_count=nil, &block) def per_page_links(paginator, &block)
values = per_page_options(selected, item_count) values = per_page_options(paginator.per_page, paginator.item_count)
if values.any? if values.any?
links = values.collect do |n| links = values.collect do |n|
n == selected ? n : yield(n, :per_page => n) n == paginator.per_page ? n : yield(n, :per_page => n)
end end
l(:label_display_per_page, links.join(', ')) l(:label_display_per_page, links.join(', '))
end end