Bump will_paginate

This commit is contained in:
Benjamin Neff 2023-06-26 02:50:21 +02:00
parent 64887e75c5
commit 7cefa8577a
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
3 changed files with 13 additions and 9 deletions

View file

@ -157,7 +157,7 @@ gem "gon", "6.4.0"
gem "hamlit", "3.0.3"
gem "mobile-fu", "1.4.0"
gem "rails-timeago", "2.20.0"
gem "will_paginate", "3.3.1"
gem "will_paginate", "4.0.0"
# Logging

View file

@ -778,7 +778,7 @@ GEM
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
will_paginate (3.3.1)
will_paginate (4.0.0)
xpath (3.2.0)
nokogiri (~> 1.8)
yajl-ruby (1.4.3)
@ -901,7 +901,7 @@ DEPENDENCIES
uuid (= 2.3.9)
versionist (= 2.0.1)
webmock (= 3.14.0)
will_paginate (= 3.3.1)
will_paginate (= 4.0.0)
yajl-ruby (= 1.4.3)
BUNDLED WITH

View file

@ -1,13 +1,13 @@
# frozen_string_literal: true
require 'will_paginate/array'
require "will_paginate/array"
# Optional for Bootstrap :renderer => WillPaginate::ActionView::BootstrapLinkRenderer
# https://github.com/yrgoldteeth/bootstrap-will_paginate
module WillPaginate
module ActionView
def will_paginate(collection = nil, options = {} )
def will_paginate(collection=nil, options={})
options, collection = collection, nil if collection.is_a? Hash
# Taken from original will_paginate code to handle if the helper is not passed a collection object.
collection ||= infer_collection_from_controller
@ -23,15 +23,19 @@ module WillPaginate
end
def page_number(page)
tag :li, link(page, page, :rel => rel_value(page)), :class => ('active' if page == current_page)
tag :li, link(page, page, rel: rel_value(page)), class: ("active" if page == current_page)
end
def gap
tag :li, link(super, '#'), :class => 'disabled'
tag :li, link(super, "#"), class: "disabled"
end
def previous_or_next_page(page, text, classname)
tag :li, link(text, page || '#'), :class => [classname[0..3], classname, ('disabled' unless page)].join(' ')
def previous_or_next_page(page, text, classname, aria_label=nil)
tag :li, link(text, page || "#"),
{
class: [classname[0..3], classname, ("disabled" unless page)].join(" "),
"aria-label": aria_label
}
end
end
end