0
@@ -14,24 +14,24 @@ module WillPaginate
0
# WillPaginate::ViewHelpers.pagination_options hash. You can write to this hash to
0
# override default options on the global level:
0
- # WillPaginate::ViewHelpers.pagination_options[:prev
_label] = 'Previous page'
0
+ # WillPaginate::ViewHelpers.pagination_options[:prev
ious_label] = 'Previous page'
0
# By putting this into your environment.rb you can easily translate link texts to previous
0
# and next pages, as well as override some other defaults to your liking.
0
# default options that can be overridden on the global level
0
@@pagination_options = {
0
- :class => 'pagination',
0
- :prev_label => '« Previous',
0
- :next_label => 'Next »',
0
- :inner_window => 4, # links around the current page
0
- :outer_window => 1, # links around beginning and end
0
- :separator => ' ', # single space is friendly to spiders and non-graphic browsers
0
- :renderer => 'WillPaginate::LinkRenderer',
0
+ :class => 'pagination',
0
+ :previous_label => '« Previous',
0
+ :next_label => 'Next »',
0
+ :inner_window => 4, # links around the current page
0
+ :outer_window => 1, # links around beginning and end
0
+ :separator => ' ', # single space is friendly to spiders and non-graphic browsers
0
+ :renderer => 'WillPaginate::LinkRenderer',
0
mattr_reader :pagination_options
0
@@ -41,7 +41,7 @@ module WillPaginate
0
# * <tt>:class</tt> -- CSS class name for the generated DIV (default: "pagination")
0
- # * <tt>:prev
_label</tt> -- default: "« Previous"
0
+ # * <tt>:prev
ious_label</tt> -- default: "« Previous"
0
# * <tt>:next_label</tt> -- default: "Next »"
0
# * <tt>:inner_window</tt> -- how many links are shown around the current page (default: 4)
0
# * <tt>:outer_window</tt> -- how many links are around the first and the last page (default: 1)
0
@@ -92,6 +92,10 @@ module WillPaginate
0
return nil unless WillPaginate::ViewHelpers.total_pages_for_collection(collection) > 1
0
options = options.symbolize_keys.reverse_merge WillPaginate::ViewHelpers.pagination_options
0
+ if options[:prev_label]
0
+ WillPaginate::Deprecation::warn(":prev_label view parameter is now :previous_label; the old name has been deprecated.")
0
+ options[:previous_label] = options.delete(:prev_label)
0
# get the renderer instance
0
renderer = case options[:renderer]
0
@@ -214,7 +218,7 @@ module WillPaginate
0
links = @options[:page_links] ? windowed_links : []
0
# previous/next buttons
0
- links.unshift page_link_or_span(@collection.previous_page, 'disabled prev_page', @options[:prev
_label])
0
+ links.unshift page_link_or_span(@collection.previous_page, 'disabled prev_page', @options[:prev
ious_label])
0
links.push page_link_or_span(@collection.next_page, 'disabled next_page', @options[:next_label])
0
html = links.join(@options[:separator])