summaryrefslogtreecommitdiffstats
path: root/lib/redmine/pagination.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-17 20:19:48 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-17 20:19:48 +0000
commit7f152d34858e22a1d6a4cc5b50c23b108caa6ffc (patch)
tree7e5139bbe8e9ca1c2c715c96a52df0a86d7f5003 /lib/redmine/pagination.rb
parent56669f9b13d1bb14fd1385255db8b9681406f0ac (diff)
downloadredmine-7f152d34858e22a1d6a4cc5b50c23b108caa6ffc.tar.gz
redmine-7f152d34858e22a1d6a4cc5b50c23b108caa6ffc.zip
Makes #per_page_links take a paginator.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11032 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/pagination.rb')
-rw-r--r--lib/redmine/pagination.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/redmine/pagination.rb b/lib/redmine/pagination.rb
index 97d04dcf9..5d2b58481 100644
--- a/lib/redmine/pagination.rb
+++ b/lib/redmine/pagination.rb
@@ -199,7 +199,7 @@ module Redmine
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}"
end
@@ -207,11 +207,11 @@ module Redmine
end
# Renders the "Per page" links.
- def per_page_links(selected=nil, item_count=nil, &block)
- values = per_page_options(selected, item_count)
+ def per_page_links(paginator, &block)
+ values = per_page_options(paginator.per_page, paginator.item_count)
if values.any?
links = values.collect do |n|
- n == selected ? n : yield(n, :per_page => n)
+ n == paginator.per_page ? n : yield(n, :per_page => n)
end
l(:label_display_per_page, links.join(', '))
end