diff --git a/docs/api/calendar/units.md b/docs/api/calendar/units.md index 9e1438a66..73a18dc7b 100644 --- a/docs/api/calendar/units.md +++ b/docs/api/calendar/units.md @@ -42,9 +42,10 @@ The following variables are specific to `Pagy::Calendar::*` instances: | Variable | Description | Default | |:----------|:----------------------------------------------------------------------------------------------------------|:--------| -| `:period` | Required two items Array with the calendar starting and ending local `TimeWithZone` objects | `nil` | -| `:order` | Order of pagination: it can be`:asc` or `:desc` | `:asc` | | `:format` | String containing the `strftime` extendable format used for labelling (each subclass has its own default) | | +| `:order` | Order of pagination: it can be`:asc` or `:desc` | `:asc` | +| `:period` | Required two items Array with the calendar starting and ending local `TimeWithZone` objects | `nil` | +| `:leap` | Boolean variable to leap empty pages when `pagy_calendar_count` is defined by the app | `nil` | **Notice**: For the `Pagy::Calendar::Quarter` the `:format` variable can contain a non-standard `%q` format which is substituted with the quarter (1-4). diff --git a/docs/extras/calendar.md b/docs/extras/calendar.md index 474c23e52..1ffdf56cc 100644 --- a/docs/extras/calendar.md +++ b/docs/extras/calendar.md @@ -270,13 +270,10 @@ So in order to filter the actual search with the `from` and `to` local `TimeWith ==- `pagy_calendar_counts(collection, unit, from, to)` !!!primary Optional implementation -This method can be implemented by the application in order to add some UI feedback to the pagy nav links +This method can be implemented by the application in order to add some extra UI feedback to the pagy nav links and optionally +leap the empty pages !!! -If this method is defined, pagy will run it for each used calendar unit and will add an extra `empty-page` -CSS class to the links to empty pages (that can be targeted to give a visual UI feedback). Pagy will also add a `title` -attribute to display a tooltip info for each page link. - The method receives the main `collection`, the `unit` symbol, and must return the array of the counts grouped by unit using the `from` and `to` **local Time** objects. @@ -301,6 +298,21 @@ it on your actual DB in order to evaluate the performance. If you want to use it dynamically, you can skip the extra query and the relative feedback by returning `nil` when you need it. !!! +### UI features + +If this method is defined, pagy will run it for each configured calendar unit and will add an extra `empty-page` +CSS class to the links to empty pages (that can be targeted to give a visual UI feedback or hide the empty pages). Pagy will also +add a `title` attribute to display a tooltip info for each page link. + +You can also leap the empty pages, forcing the UI to land on the next page with results, regardless of the request. Just pass the +`leap: true` variable to the configuration of any unit to enable the behavior for that unit. + +!!! Browser address +Notice that the leap feature **does not perform a new request** to the next page with results: it just serves the target page +as it were requested originally. That means that while the UI leaps to the next page with results, the address in the browser +will obviously not update. +!!! + === ## Customization @@ -356,7 +368,7 @@ option `fit_time: true` to avoid the error and get the url to the page closest t Each page link in the calendar navs is conveniently labeled with the specific `Time` period it refers to. You can change the time format to your needs by setting the `:format` variable to a standard `strftime` format. (See -the [Pagy::Calendar variables](/docs/api/calendar.md#variables)) +the [Pagy::Calendar::Unit variables](/docs/api/calendar/units.md#variables)) You can also get the [label method](/docs/api/calendar.md#methods) with e.g.: `@calendar[:month].label`, which might be useful to use in your UI. diff --git a/e2e/snapshots.js b/e2e/snapshots.js index 575c2b253..369b6dff7 100644 --- a/e2e/snapshots.js +++ b/e2e/snapshots.js @@ -462,19 +462,19 @@ module.exports = { }, "[calendar] Test helpers (skip true)": { "[calendar] Test #go-to-day": { - "1": "
\n

Event #86 - 2022-03-02 23:35:41 UTC

\n
", + "1": "
\n

Event #68 - 2022-03-02 23:35:41 UTC

\n
", "2": "", "3": "", "4": "", "5": "Displaying 1 item" }, "[calendar] Test calendar navs": { - "1": "
\n

Event #51 - 2022-01-01 19:18:06 UTC

\n
", + "1": "
\n
", "2": "", "3": "", "4": "", - "5": "Displaying 1 item", - "6": "
\n

Event #106 - 2022-04-01 15:35:47 UTC

\n
", + "5": "No items found", + "6": "
\n

Event #88 - 2022-04-01 15:35:47 UTC

\n
", "7": "", "8": "", "9": "", @@ -484,7 +484,7 @@ module.exports = { "13": "", "14": "", "15": "No items found", - "16": "
\n

Event #110 - 2022-04-06 10:59:32 UTC

\n
", + "16": "
\n

Event #92 - 2022-04-06 10:59:32 UTC

\n
", "17": "", "18": "", "19": "", @@ -493,31 +493,31 @@ module.exports = { }, "[calendar] Test helpers (skip false)": { "[calendar] Test #go-to-day": { - "1": "
\n

Event #86 - 2022-03-02 23:35:41 UTC

\n
", + "1": "
\n

Event #68 - 2022-03-02 23:35:41 UTC

\n
", "2": "", - "3": "", + "3": "", "4": "", "5": "Displaying 1 item" }, "[calendar] Test calendar navs": { - "1": "
\n

Event #51 - 2022-01-01 19:18:06 UTC

\n
", + "1": "
\n

Event #51 - 2022-02-01 21:23:58 UTC

\n
", "2": "", - "3": "", - "4": "", + "3": "", + "4": "", "5": "Displaying 1 item", - "6": "
\n

Event #106 - 2022-04-01 15:35:47 UTC

\n
", + "6": "
\n

Event #88 - 2022-04-01 15:35:47 UTC

\n
", "7": "", - "8": "", + "8": "", "9": "", "10": "Displaying 1 item", - "11": "
\n
", + "11": "
\n

Event #92 - 2022-04-06 10:59:32 UTC

\n
", "12": "", - "13": "", - "14": "", - "15": "No items found", - "16": "
\n

Event #110 - 2022-04-06 10:59:32 UTC

\n
", + "13": "", + "14": "", + "15": "Displaying 1 item", + "16": "
\n

Event #92 - 2022-04-06 10:59:32 UTC

\n
", "17": "", - "18": "", + "18": "", "19": "", "20": "Displaying 1 item" } @@ -525,14 +525,14 @@ module.exports = { "[calendar] Test app": { "[calendar] Test #toggle": { "1": "
\n

Event #1 - 2021-10-21 13:18:23 UTC

\n

Event #2 - 2021-10-21 23:14:50 UTC

\n
", - "2": "", + "2": "", "3": "", "4": "", "5": "Displaying 2 items", "6": "
\n

Event #1 - 2021-10-21 13:18:23 UTC

\n

Event #2 - 2021-10-21 23:14:50 UTC

\n

Event #3 - 2021-10-23 01:06:02 UTC

\n

Event #4 - 2021-10-25 18:54:35 UTC

\n

Event #5 - 2021-10-26 02:22:17 UTC

\n

Event #6 - 2021-10-28 22:59:49 UTC

\n

Event #7 - 2021-10-30 15:02:25 UTC

\n

Event #8 - 2021-11-02 04:03:39 UTC

\n

Event #9 - 2021-11-04 22:41:23 UTC

\n

Event #10 - 2021-11-06 00:34:29 UTC

\n

Event #11 - 2021-11-06 23:56:16 UTC

\n

Event #12 - 2021-11-07 06:22:04 UTC

\n

Event #13 - 2021-11-07 19:46:08 UTC

\n

Event #14 - 2021-11-08 09:31:13 UTC

\n

Event #15 - 2021-11-09 17:22:03 UTC

\n

Event #16 - 2021-11-11 05:29:54 UTC

\n

Event #17 - 2021-11-13 09:41:04 UTC

\n

Event #18 - 2021-11-16 07:48:22 UTC

\n

Event #19 - 2021-11-16 12:43:44 UTC

\n

Event #20 - 2021-11-17 16:03:07 UTC

\n
", - "7": "", + "7": "", "8": "
\n

Event #1 - 2021-10-21 13:18:23 UTC

\n

Event #2 - 2021-10-21 23:14:50 UTC

\n
", - "9": "", + "9": "", "10": "", "11": "", "12": "Displaying 2 items" diff --git a/gem/apps/calendar.ru b/gem/apps/calendar.ru index d1f4bbcf9..b13219b90 100644 --- a/gem/apps/calendar.ru +++ b/gem/apps/calendar.ru @@ -130,8 +130,8 @@ class EventsController < ActionController::Base # which would be inactive by default and only active on demand. @calendar, @pagy, @events = pagy_calendar(Event.all, year: {}, - month: {}, - day: {}, + month: { leap: true }, + day: { leap: true }, active: !params[:skip]) render inline: TEMPLATE end @@ -278,24 +278,6 @@ TIMES = <<~TIMES 2021-12-27 12:18:57 +0000 2021-12-28 16:59:57 +0000 2021-12-31 15:10:23 +0000 - 2022-01-01 19:18:06 +0000 - 2022-01-03 08:36:27 +0000 - 2022-01-03 23:31:01 +0000 - 2022-01-05 02:14:57 +0000 - 2022-01-06 09:26:03 +0000 - 2022-01-07 20:22:22 +0000 - 2022-01-10 04:04:28 +0000 - 2022-01-11 17:17:55 +0000 - 2022-01-14 05:21:54 +0000 - 2022-01-16 01:18:58 +0000 - 2022-01-18 08:42:56 +0000 - 2022-01-19 00:45:04 +0000 - 2022-01-20 08:18:54 +0000 - 2022-01-22 05:26:38 +0000 - 2022-01-24 10:57:50 +0000 - 2022-01-26 09:47:02 +0000 - 2022-01-28 20:44:30 +0000 - 2022-01-31 16:19:50 +0000 2022-02-01 21:23:58 +0000 2022-02-04 14:41:57 +0000 2022-02-06 20:40:06 +0000 diff --git a/gem/lib/pagy/calendar.rb b/gem/lib/pagy/calendar.rb index 8742dc1a0..66a23d7d1 100644 --- a/gem/lib/pagy/calendar.rb +++ b/gem/lib/pagy/calendar.rb @@ -26,8 +26,8 @@ def create(unit, **vars) end # Return calendar, from, to - def init(conf, period, params) - new.send(:init, conf, period, params) + def init(*args) + new.send(:init, *args) end end @@ -39,7 +39,7 @@ def showtime private # Create the calendar - def init(conf, period, params) + def init(conf, period, params, get_counts) @conf = Marshal.load(Marshal.dump(conf)) # store a copy @units = Calendar::UNITS & @conf.keys # get the units in time length desc order raise ArgumentError, 'no calendar unit found in pagy_calendar @configuration' if @units.empty? @@ -47,18 +47,24 @@ def init(conf, period, params) @period = period @params = params @page_param = conf[:pagy][:page_param] || DEFAULT[:page_param] - @units.each do |unit| # set all the :page_param vars for later deletion - unit_page_param = :"#{unit}_#{@page_param}" - conf[unit][:page_param] = unit_page_param - conf[unit][:page] = @params[unit_page_param] - end + # set all the :page_param vars for later deletion + @units.each { |unit| conf[unit][:page_param] = :"#{unit}_#{@page_param}" } calendar = {} object = nil @units.each_with_index do |unit, index| params_to_delete = @units[(index + 1), @units.size].map { |sub| conf[sub][:page_param] } + [@page_param] - conf[unit][:params] = lambda { |up| up.except(*params_to_delete.map(&:to_s)) } # rubocop:disable Style/Lambda + conf[unit][:params] = ->(up) { up.except(*params_to_delete.map(&:to_s)) } conf[unit][:period] = object&.send(:active_period) || @period - calendar[unit] = object = Calendar.send(:create, unit, **conf[unit]) + conf[unit][:page] = @params[:"#{unit}_#{@page_param}"] # requested page + if get_counts && (counts = get_counts.(unit, conf[unit][:period])) + conf[unit][:counts] = counts + if conf[unit][:leap] + requested_page = (conf[unit][:page] || 1).to_i + count_index = requested_page - 1 + conf[unit][:page] = requested_page + counts[count_index..].index(&:positive?).to_i + end + end + calendar[unit] = object = Calendar.send(:create, unit, **conf[unit]) end [replace(calendar), object.from, object.to] end diff --git a/gem/lib/pagy/extras/calendar.rb b/gem/lib/pagy/extras/calendar.rb index 4b409363c..e0bd14b24 100644 --- a/gem/lib/pagy/extras/calendar.rb +++ b/gem/lib/pagy/extras/calendar.rb @@ -19,12 +19,9 @@ def pagy_calendar(collection, conf) conf[:pagy] ||= {} unless conf.key?(:active) && !conf[:active] - calendar, from, to = Calendar.send(:init, conf, pagy_calendar_period(collection), params) - if respond_to?(:pagy_calendar_counts) - calendar.each_key do |unit| - calendar[unit].vars[:counts] = pagy_calendar_counts(collection, unit, *calendar[unit].vars[:period]) - end - end + get_counts = ->(unit, period) { pagy_calendar_counts(collection, unit, *period) } \ + if respond_to?(:pagy_calendar_counts) + calendar, from, to = Calendar.send(:init, conf, pagy_calendar_period(collection), params, get_counts) collection = pagy_calendar_filter(collection, from, to) end pagy, results = send(conf[:pagy][:backend] || :pagy, collection, **conf[:pagy]) # use backend: :pagy when omitted diff --git a/test/files/db/test.sqlite3 b/test/files/db/test.sqlite3 index c288625bc..c92388de2 100644 Binary files a/test/files/db/test.sqlite3 and b/test/files/db/test.sqlite3 differ diff --git a/test/files/models.rb b/test/files/models.rb index 0ccfb55e8..00b748448 100644 --- a/test/files/models.rb +++ b/test/files/models.rb @@ -95,24 +95,6 @@ class Pet < ActiveRecord::Base 2021-12-27 12:18:57 +0000 2021-12-28 16:59:57 +0000 2021-12-31 15:10:23 +0000 - 2022-01-01 19:18:06 +0000 - 2022-01-03 08:36:27 +0000 - 2022-01-03 23:31:01 +0000 - 2022-01-05 02:14:57 +0000 - 2022-01-06 09:26:03 +0000 - 2022-01-07 20:22:22 +0000 - 2022-01-10 04:04:28 +0000 - 2022-01-11 17:17:55 +0000 - 2022-01-14 05:21:54 +0000 - 2022-01-16 01:18:58 +0000 - 2022-01-18 08:42:56 +0000 - 2022-01-19 00:45:04 +0000 - 2022-01-20 08:18:54 +0000 - 2022-01-22 05:26:38 +0000 - 2022-01-24 10:57:50 +0000 - 2022-01-26 09:47:02 +0000 - 2022-01-28 20:44:30 +0000 - 2022-01-31 16:19:50 +0000 2022-02-01 21:23:58 +0000 2022-02-04 14:41:57 +0000 2022-02-06 20:40:06 +0000 diff --git a/test/pagy/extras/calendar_extra_test.rb b/test/pagy/extras/calendar_extra_test.rb index 623c38752..0a35e96dc 100644 --- a/test/pagy/extras/calendar_extra_test.rb +++ b/test/pagy/extras/calendar_extra_test.rb @@ -32,8 +32,8 @@ def app(**opts) _(calendar).must_be_nil _(records.size).must_equal 20 _(pagy).must_be_instance_of Pagy - _(pagy.count).must_equal 505 - _(pagy.pages).must_equal 26 + _(pagy.count).must_equal 487 + _(pagy.pages).must_equal 25 end it 'raises NoMethodError for #pagy_calendar_period' do error = assert_raises(NoMethodError) { MockApp.new.send(:pagy_calendar_period) } @@ -306,4 +306,19 @@ def app(**opts) _(app_counts.pagy_nav(calendar[:year], anchor_string: 'data-foo="bar"')).must_rematch :year end end + describe "Leap feature" do + c = MockApp::CalendarCounts + it "works with #{c} leap month" do + app_counts = c.new(params: { year_page: 2 }) + calendar, _pagy, _entries = app_counts.send(:pagy_calendar, + Event.all, + year: {}, + month: { leap: true }, + day: { leap: true }, + pagy: { limit: 10 }) + _(app_counts.pagy_nav(calendar[:year])).must_rematch :year + _(app_counts.pagy_nav(calendar[:month])).must_rematch :month + _(app_counts.pagy_nav(calendar[:day])).must_rematch :day + end + end end diff --git a/test/pagy/extras/calendar_extra_test.rb.yaml b/test/pagy/extras/calendar_extra_test.rb.yaml index cd740f2db..2a7ba53b6 100644 --- a/test/pagy/extras/calendar_extra_test.rb.yaml +++ b/test/pagy/extras/calendar_extra_test.rb.yaml @@ -1,37 +1,97 @@ --- -pagy/extras/calendar__instance_methods_test_0016_selects__day_for_the_first_page: - :entries: - - 2021-10-21 13:18:23.000000000 Z - - 2021-10-21 23:14:50.000000000 Z -pagy/extras/calendar__instance_methods_test_0018_selects__day_for_the_last_page: - :entries: - - 2021-12-19 00:34:04.000000000 Z - - 2021-12-19 06:58:41.000000000 Z -pagy/extras/calendar__instance_methods_test_0015_selects__week_for_the_last_page: - :entries: - - 2023-11-12 01:20:18.000000000 Z - - 2023-11-12 04:22:50.000000000 Z - - 2023-11-12 08:38:58.000000000 Z - - 2023-11-13 15:43:40.000000000 Z -pagy/extras/calendar__instance_methods_test_0012_selects__month_for_the_last_page: - :entries: - - 2023-11-02 02:52:55.000000000 Z - - 2023-11-02 06:00:32.000000000 Z - - 2023-11-03 08:39:06.000000000 Z - - 2023-11-04 23:51:22.000000000 Z - - 2023-11-07 16:11:33.000000000 Z - - 2023-11-10 10:55:29.000000000 Z - - 2023-11-12 01:20:18.000000000 Z - - 2023-11-12 04:22:50.000000000 Z - - 2023-11-12 08:38:58.000000000 Z - - 2023-11-13 15:43:40.000000000 Z -pagy/extras/calendar__instance_methods_test_0014_selects__week_for_an_intermediate_page: - :entries: - - 2022-04-03 18:27:19.000000000 Z - - 2022-04-03 23:44:08.000000000 Z - - 2022-04-06 10:59:32.000000000 Z - - 2022-04-07 01:33:53.000000000 Z - - 2022-04-08 10:26:34.000000000 Z +pagy/extras/calendar__Counts_feature_test_0001_works_with_MockApp__CalendarCounts: + :year: + :month: + :day: +pagy/extras/calendar__Counts_feature_test_0003_works_with_anchor_string: + :year: +pagy/extras/calendar__Counts_feature_test_0002_works_with_MockApp__CalendarCountsSkip: + :year: + :month: + :day: pagy/extras/calendar__instance_methods_test_0011_selects__month_for_an_intermediate_page: :entries: - 2023-10-01 11:54:24.000000000 Z @@ -54,186 +114,7 @@ pagy/extras/calendar__instance_methods_test_0011_selects__month_for_an_intermedi - 2023-10-28 05:52:20.000000000 Z - 2023-10-29 22:11:01.000000000 Z - 2023-10-30 12:29:25.000000000 Z -pagy/extras/calendar__instance_methods_test_0008_selects__quarter_for_an_intermediate_page: - :entries: - - 2022-07-01 16:05:14.000000000 Z - - 2022-07-02 14:02:12.000000000 Z - - 2022-07-05 11:08:11.000000000 Z - - 2022-07-05 12:44:38.000000000 Z - - 2022-07-08 03:55:17.000000000 Z - - 2022-07-08 18:02:14.000000000 Z - - 2022-07-09 09:41:17.000000000 Z - - 2022-07-11 07:34:51.000000000 Z - - 2022-07-13 05:11:19.000000000 Z - - 2022-07-15 02:46:56.000000000 Z - - 2022-07-16 15:40:39.000000000 Z - - 2022-07-17 19:44:15.000000000 Z - - 2022-07-19 00:31:12.000000000 Z - - 2022-07-21 21:58:24.000000000 Z - - 2022-07-22 05:25:48.000000000 Z - - 2022-07-22 18:33:04.000000000 Z - - 2022-07-24 07:42:24.000000000 Z - - 2022-07-25 07:21:20.000000000 Z - - 2022-07-27 12:02:44.000000000 Z - - 2022-07-29 03:29:28.000000000 Z - - 2022-07-29 11:35:43.000000000 Z - - 2022-07-30 05:25:21.000000000 Z - - 2022-07-30 19:39:10.000000000 Z - - 2022-07-31 18:54:58.000000000 Z - - 2022-08-03 11:18:44.000000000 Z - - 2022-08-05 00:37:47.000000000 Z - - 2022-08-05 12:08:08.000000000 Z - - 2022-08-07 14:39:19.000000000 Z - - 2022-08-08 09:52:59.000000000 Z - - 2022-08-09 13:48:29.000000000 Z - - 2022-08-11 19:03:04.000000000 Z - - 2022-08-13 01:56:49.000000000 Z - - 2022-08-15 11:33:09.000000000 Z - - 2022-08-17 23:37:45.000000000 Z - - 2022-08-19 00:47:19.000000000 Z - - 2022-08-19 01:01:12.000000000 Z - - 2022-08-21 07:37:55.000000000 Z - - 2022-08-21 21:42:15.000000000 Z - - 2022-08-23 10:55:39.000000000 Z - - 2022-08-25 16:20:29.000000000 Z - - 2022-08-27 06:28:14.000000000 Z - - 2022-08-27 13:12:57.000000000 Z - - 2022-08-28 23:00:13.000000000 Z - - 2022-08-31 05:19:56.000000000 Z - - 2022-09-02 18:00:18.000000000 Z - - 2022-09-04 12:02:47.000000000 Z - - 2022-09-06 00:57:21.000000000 Z - - 2022-09-08 04:26:01.000000000 Z - - 2022-09-09 04:55:45.000000000 Z - - 2022-09-11 22:59:36.000000000 Z - - 2022-09-12 00:54:25.000000000 Z - - 2022-09-12 17:44:24.000000000 Z - - 2022-09-12 20:47:30.000000000 Z - - 2022-09-15 11:39:20.000000000 Z - - 2022-09-16 07:54:15.000000000 Z - - 2022-09-17 08:06:29.000000000 Z - - 2022-09-18 07:17:17.000000000 Z - - 2022-09-19 08:39:55.000000000 Z - - 2022-09-22 06:32:56.000000000 Z - - 2022-09-22 21:26:29.000000000 Z - - 2022-09-24 16:06:50.000000000 Z - - 2022-09-27 05:50:18.000000000 Z - - 2022-09-28 12:12:13.000000000 Z - - 2022-09-29 21:13:01.000000000 Z - - 2022-09-30 00:09:29.000000000 Z -pagy/extras/calendar__instance_methods_test_0017_selects__day_for_an_intermediate_page: - :entries: [] -pagy/extras/calendar__instance_methods_test_0013_selects__week_for_the_first_page: - :entries: - - 2021-10-21 13:18:23.000000000 Z - - 2021-10-21 23:14:50.000000000 Z - - 2021-10-23 01:06:02.000000000 Z -pagy/extras/calendar__instance_methods_test_0009_selects__quarter_for_last_page: - :entries: - - 2023-10-01 11:54:24.000000000 Z - - 2023-10-03 07:36:32.000000000 Z - - 2023-10-05 05:13:57.000000000 Z - - 2023-10-06 16:07:06.000000000 Z - - 2023-10-09 00:03:52.000000000 Z - - 2023-10-09 02:32:01.000000000 Z - - 2023-10-10 16:39:07.000000000 Z - - 2023-10-12 13:28:16.000000000 Z - - 2023-10-14 04:29:14.000000000 Z - - 2023-10-17 03:30:24.000000000 Z - - 2023-10-20 03:13:15.000000000 Z - - 2023-10-20 20:47:06.000000000 Z - - 2023-10-21 13:59:34.000000000 Z - - 2023-10-23 21:38:48.000000000 Z - - 2023-10-24 06:07:13.000000000 Z - - 2023-10-25 22:51:17.000000000 Z - - 2023-10-26 21:12:50.000000000 Z - - 2023-10-28 05:52:20.000000000 Z - - 2023-10-29 22:11:01.000000000 Z - - 2023-10-30 12:29:25.000000000 Z - - 2023-11-02 02:52:55.000000000 Z - - 2023-11-02 06:00:32.000000000 Z - - 2023-11-03 08:39:06.000000000 Z - - 2023-11-04 23:51:22.000000000 Z - - 2023-11-07 16:11:33.000000000 Z - - 2023-11-10 10:55:29.000000000 Z - - 2023-11-12 01:20:18.000000000 Z - - 2023-11-12 04:22:50.000000000 Z - - 2023-11-12 08:38:58.000000000 Z - - 2023-11-13 15:43:40.000000000 Z -pagy/extras/calendar__instance_methods_test_0007_selects__quarter_for_the_first_page: - :entries: - - 2021-10-21 13:18:23.000000000 Z - - 2021-10-21 23:14:50.000000000 Z - - 2021-10-23 01:06:02.000000000 Z - - 2021-10-25 18:54:35.000000000 Z - - 2021-10-26 02:22:17.000000000 Z - - 2021-10-28 22:59:49.000000000 Z - - 2021-10-30 15:02:25.000000000 Z - - 2021-11-02 04:03:39.000000000 Z - - 2021-11-04 22:41:23.000000000 Z - - 2021-11-06 00:34:29.000000000 Z - - 2021-11-06 23:56:16.000000000 Z - - 2021-11-07 06:22:04.000000000 Z - - 2021-11-07 19:46:08.000000000 Z - - 2021-11-08 09:31:13.000000000 Z - - 2021-11-09 17:22:03.000000000 Z - - 2021-11-11 05:29:54.000000000 Z - - 2021-11-13 09:41:04.000000000 Z - - 2021-11-16 07:48:22.000000000 Z - - 2021-11-16 12:43:44.000000000 Z - - 2021-11-17 16:03:07.000000000 Z - - 2021-11-20 02:39:01.000000000 Z - - 2021-11-21 02:01:24.000000000 Z - - 2021-11-23 19:24:43.000000000 Z - - 2021-11-26 11:47:22.000000000 Z - - 2021-11-28 06:30:04.000000000 Z - - 2021-12-01 00:13:55.000000000 Z - - 2021-12-03 19:10:16.000000000 Z - - 2021-12-04 00:43:47.000000000 Z - - 2021-12-06 20:15:35.000000000 Z - - 2021-12-09 16:27:07.000000000 Z - - 2021-12-10 15:28:48.000000000 Z - - 2021-12-10 23:08:16.000000000 Z - - 2021-12-11 23:09:08.000000000 Z - - 2021-12-14 04:56:58.000000000 Z - - 2021-12-14 14:00:56.000000000 Z - - 2021-12-15 22:58:51.000000000 Z - - 2021-12-16 01:28:21.000000000 Z - - 2021-12-16 20:16:54.000000000 Z - - 2021-12-19 00:34:04.000000000 Z - - 2021-12-19 06:58:41.000000000 Z - - 2021-12-21 11:13:53.000000000 Z - - 2021-12-23 07:28:50.000000000 Z - - 2021-12-23 07:57:58.000000000 Z - - 2021-12-23 18:32:13.000000000 Z - - 2021-12-24 01:17:51.000000000 Z - - 2021-12-25 05:36:16.000000000 Z - - 2021-12-25 23:21:57.000000000 Z - - 2021-12-27 12:18:57.000000000 Z - - 2021-12-28 16:59:57.000000000 Z - - 2021-12-31 15:10:23.000000000 Z -pagy/extras/calendar__instance_methods_test_0010_selects__month_for_the_first_page: - :entries: - - 2021-10-21 13:18:23.000000000 Z - - 2021-10-21 23:14:50.000000000 Z - - 2021-10-23 01:06:02.000000000 Z - - 2021-10-25 18:54:35.000000000 Z - - 2021-10-26 02:22:17.000000000 Z - - 2021-10-28 22:59:49.000000000 Z - - 2021-10-30 15:02:25.000000000 Z -pagy/extras/calendar__instance_methods_test_0019_runs_multiple_units: - :entries: - - 2022-07-16 15:40:39.000000000 Z - - 2022-07-17 19:44:15.000000000 Z - - 2022-07-19 00:31:12.000000000 Z - - 2022-07-21 21:58:24.000000000 Z - - 2022-07-22 05:25:48.000000000 Z - - 2022-07-22 18:33:04.000000000 Z - - 2022-07-24 07:42:24.000000000 Z - - 2022-07-25 07:21:20.000000000 Z - - 2022-07-27 12:02:44.000000000 Z - - 2022-07-29 03:29:28.000000000 Z -pagy/extras/calendar__instance_methods_test_0006_selects__year_for_the_pages_and_check_the_total: +pagy/extras/calendar__instance_methods_test_0006_selects__year_for_the_pages_and_check_the_total: :entries: - 2021-10-21 13:18:23.000000000 Z - 2021-10-21 23:14:50.000000000 Z @@ -286,24 +167,6 @@ pagy/extras/calendar__instance_methods_test_0006_selects__year_for_the_pages_and - 2021-12-28 16:59:57.000000000 Z - 2021-12-31 15:10:23.000000000 Z :entries_2: - - 2022-01-01 19:18:06.000000000 Z - - 2022-01-03 08:36:27.000000000 Z - - 2022-01-03 23:31:01.000000000 Z - - 2022-01-05 02:14:57.000000000 Z - - 2022-01-06 09:26:03.000000000 Z - - 2022-01-07 20:22:22.000000000 Z - - 2022-01-10 04:04:28.000000000 Z - - 2022-01-11 17:17:55.000000000 Z - - 2022-01-14 05:21:54.000000000 Z - - 2022-01-16 01:18:58.000000000 Z - - 2022-01-18 08:42:56.000000000 Z - - 2022-01-19 00:45:04.000000000 Z - - 2022-01-20 08:18:54.000000000 Z - - 2022-01-22 05:26:38.000000000 Z - - 2022-01-24 10:57:50.000000000 Z - - 2022-01-26 09:47:02.000000000 Z - - 2022-01-28 20:44:30.000000000 Z - - 2022-01-31 16:19:50.000000000 Z - 2022-02-01 21:23:58.000000000 Z - 2022-02-04 14:41:57.000000000 Z - 2022-02-06 20:40:06.000000000 Z @@ -742,96 +605,260 @@ pagy/extras/calendar__instance_methods_test_0006_selects__year_for_the_pages_and - 2023-11-12 04:22:50.000000000 Z - 2023-11-12 08:38:58.000000000 Z - 2023-11-13 15:43:40.000000000 Z -pagy/extras/calendar__Counts_feature_test_0001_works_with_MockApp__CalendarCounts: +pagy/extras/calendar__instance_methods_test_0019_runs_multiple_units: + :entries: + - 2022-07-16 15:40:39.000000000 Z + - 2022-07-17 19:44:15.000000000 Z + - 2022-07-19 00:31:12.000000000 Z + - 2022-07-21 21:58:24.000000000 Z + - 2022-07-22 05:25:48.000000000 Z + - 2022-07-22 18:33:04.000000000 Z + - 2022-07-24 07:42:24.000000000 Z + - 2022-07-25 07:21:20.000000000 Z + - 2022-07-27 12:02:44.000000000 Z + - 2022-07-29 03:29:28.000000000 Z +pagy/extras/calendar__instance_methods_test_0014_selects__week_for_an_intermediate_page: + :entries: + - 2022-04-03 18:27:19.000000000 Z + - 2022-04-03 23:44:08.000000000 Z + - 2022-04-06 10:59:32.000000000 Z + - 2022-04-07 01:33:53.000000000 Z + - 2022-04-08 10:26:34.000000000 Z +pagy/extras/calendar__instance_methods_test_0018_selects__day_for_the_last_page: + :entries: + - 2021-12-19 00:34:04.000000000 Z + - 2021-12-19 06:58:41.000000000 Z +pagy/extras/calendar__instance_methods_test_0007_selects__quarter_for_the_first_page: + :entries: + - 2021-10-21 13:18:23.000000000 Z + - 2021-10-21 23:14:50.000000000 Z + - 2021-10-23 01:06:02.000000000 Z + - 2021-10-25 18:54:35.000000000 Z + - 2021-10-26 02:22:17.000000000 Z + - 2021-10-28 22:59:49.000000000 Z + - 2021-10-30 15:02:25.000000000 Z + - 2021-11-02 04:03:39.000000000 Z + - 2021-11-04 22:41:23.000000000 Z + - 2021-11-06 00:34:29.000000000 Z + - 2021-11-06 23:56:16.000000000 Z + - 2021-11-07 06:22:04.000000000 Z + - 2021-11-07 19:46:08.000000000 Z + - 2021-11-08 09:31:13.000000000 Z + - 2021-11-09 17:22:03.000000000 Z + - 2021-11-11 05:29:54.000000000 Z + - 2021-11-13 09:41:04.000000000 Z + - 2021-11-16 07:48:22.000000000 Z + - 2021-11-16 12:43:44.000000000 Z + - 2021-11-17 16:03:07.000000000 Z + - 2021-11-20 02:39:01.000000000 Z + - 2021-11-21 02:01:24.000000000 Z + - 2021-11-23 19:24:43.000000000 Z + - 2021-11-26 11:47:22.000000000 Z + - 2021-11-28 06:30:04.000000000 Z + - 2021-12-01 00:13:55.000000000 Z + - 2021-12-03 19:10:16.000000000 Z + - 2021-12-04 00:43:47.000000000 Z + - 2021-12-06 20:15:35.000000000 Z + - 2021-12-09 16:27:07.000000000 Z + - 2021-12-10 15:28:48.000000000 Z + - 2021-12-10 23:08:16.000000000 Z + - 2021-12-11 23:09:08.000000000 Z + - 2021-12-14 04:56:58.000000000 Z + - 2021-12-14 14:00:56.000000000 Z + - 2021-12-15 22:58:51.000000000 Z + - 2021-12-16 01:28:21.000000000 Z + - 2021-12-16 20:16:54.000000000 Z + - 2021-12-19 00:34:04.000000000 Z + - 2021-12-19 06:58:41.000000000 Z + - 2021-12-21 11:13:53.000000000 Z + - 2021-12-23 07:28:50.000000000 Z + - 2021-12-23 07:57:58.000000000 Z + - 2021-12-23 18:32:13.000000000 Z + - 2021-12-24 01:17:51.000000000 Z + - 2021-12-25 05:36:16.000000000 Z + - 2021-12-25 23:21:57.000000000 Z + - 2021-12-27 12:18:57.000000000 Z + - 2021-12-28 16:59:57.000000000 Z + - 2021-12-31 15:10:23.000000000 Z +pagy/extras/calendar__instance_methods_test_0017_selects__day_for_an_intermediate_page: + :entries: [] +pagy/extras/calendar__instance_methods_test_0013_selects__week_for_the_first_page: + :entries: + - 2021-10-21 13:18:23.000000000 Z + - 2021-10-21 23:14:50.000000000 Z + - 2021-10-23 01:06:02.000000000 Z +pagy/extras/calendar__instance_methods_test_0016_selects__day_for_the_first_page: + :entries: + - 2021-10-21 13:18:23.000000000 Z + - 2021-10-21 23:14:50.000000000 Z +pagy/extras/calendar__instance_methods_test_0010_selects__month_for_the_first_page: + :entries: + - 2021-10-21 13:18:23.000000000 Z + - 2021-10-21 23:14:50.000000000 Z + - 2021-10-23 01:06:02.000000000 Z + - 2021-10-25 18:54:35.000000000 Z + - 2021-10-26 02:22:17.000000000 Z + - 2021-10-28 22:59:49.000000000 Z + - 2021-10-30 15:02:25.000000000 Z +pagy/extras/calendar__instance_methods_test_0015_selects__week_for_the_last_page: + :entries: + - 2023-11-12 01:20:18.000000000 Z + - 2023-11-12 04:22:50.000000000 Z + - 2023-11-12 08:38:58.000000000 Z + - 2023-11-13 15:43:40.000000000 Z +pagy/extras/calendar__instance_methods_test_0008_selects__quarter_for_an_intermediate_page: + :entries: + - 2022-07-01 16:05:14.000000000 Z + - 2022-07-02 14:02:12.000000000 Z + - 2022-07-05 11:08:11.000000000 Z + - 2022-07-05 12:44:38.000000000 Z + - 2022-07-08 03:55:17.000000000 Z + - 2022-07-08 18:02:14.000000000 Z + - 2022-07-09 09:41:17.000000000 Z + - 2022-07-11 07:34:51.000000000 Z + - 2022-07-13 05:11:19.000000000 Z + - 2022-07-15 02:46:56.000000000 Z + - 2022-07-16 15:40:39.000000000 Z + - 2022-07-17 19:44:15.000000000 Z + - 2022-07-19 00:31:12.000000000 Z + - 2022-07-21 21:58:24.000000000 Z + - 2022-07-22 05:25:48.000000000 Z + - 2022-07-22 18:33:04.000000000 Z + - 2022-07-24 07:42:24.000000000 Z + - 2022-07-25 07:21:20.000000000 Z + - 2022-07-27 12:02:44.000000000 Z + - 2022-07-29 03:29:28.000000000 Z + - 2022-07-29 11:35:43.000000000 Z + - 2022-07-30 05:25:21.000000000 Z + - 2022-07-30 19:39:10.000000000 Z + - 2022-07-31 18:54:58.000000000 Z + - 2022-08-03 11:18:44.000000000 Z + - 2022-08-05 00:37:47.000000000 Z + - 2022-08-05 12:08:08.000000000 Z + - 2022-08-07 14:39:19.000000000 Z + - 2022-08-08 09:52:59.000000000 Z + - 2022-08-09 13:48:29.000000000 Z + - 2022-08-11 19:03:04.000000000 Z + - 2022-08-13 01:56:49.000000000 Z + - 2022-08-15 11:33:09.000000000 Z + - 2022-08-17 23:37:45.000000000 Z + - 2022-08-19 00:47:19.000000000 Z + - 2022-08-19 01:01:12.000000000 Z + - 2022-08-21 07:37:55.000000000 Z + - 2022-08-21 21:42:15.000000000 Z + - 2022-08-23 10:55:39.000000000 Z + - 2022-08-25 16:20:29.000000000 Z + - 2022-08-27 06:28:14.000000000 Z + - 2022-08-27 13:12:57.000000000 Z + - 2022-08-28 23:00:13.000000000 Z + - 2022-08-31 05:19:56.000000000 Z + - 2022-09-02 18:00:18.000000000 Z + - 2022-09-04 12:02:47.000000000 Z + - 2022-09-06 00:57:21.000000000 Z + - 2022-09-08 04:26:01.000000000 Z + - 2022-09-09 04:55:45.000000000 Z + - 2022-09-11 22:59:36.000000000 Z + - 2022-09-12 00:54:25.000000000 Z + - 2022-09-12 17:44:24.000000000 Z + - 2022-09-12 20:47:30.000000000 Z + - 2022-09-15 11:39:20.000000000 Z + - 2022-09-16 07:54:15.000000000 Z + - 2022-09-17 08:06:29.000000000 Z + - 2022-09-18 07:17:17.000000000 Z + - 2022-09-19 08:39:55.000000000 Z + - 2022-09-22 06:32:56.000000000 Z + - 2022-09-22 21:26:29.000000000 Z + - 2022-09-24 16:06:50.000000000 Z + - 2022-09-27 05:50:18.000000000 Z + - 2022-09-28 12:12:13.000000000 Z + - 2022-09-29 21:13:01.000000000 Z + - 2022-09-30 00:09:29.000000000 Z +pagy/extras/calendar__instance_methods_test_0009_selects__quarter_for_last_page: + :entries: + - 2023-10-01 11:54:24.000000000 Z + - 2023-10-03 07:36:32.000000000 Z + - 2023-10-05 05:13:57.000000000 Z + - 2023-10-06 16:07:06.000000000 Z + - 2023-10-09 00:03:52.000000000 Z + - 2023-10-09 02:32:01.000000000 Z + - 2023-10-10 16:39:07.000000000 Z + - 2023-10-12 13:28:16.000000000 Z + - 2023-10-14 04:29:14.000000000 Z + - 2023-10-17 03:30:24.000000000 Z + - 2023-10-20 03:13:15.000000000 Z + - 2023-10-20 20:47:06.000000000 Z + - 2023-10-21 13:59:34.000000000 Z + - 2023-10-23 21:38:48.000000000 Z + - 2023-10-24 06:07:13.000000000 Z + - 2023-10-25 22:51:17.000000000 Z + - 2023-10-26 21:12:50.000000000 Z + - 2023-10-28 05:52:20.000000000 Z + - 2023-10-29 22:11:01.000000000 Z + - 2023-10-30 12:29:25.000000000 Z + - 2023-11-02 02:52:55.000000000 Z + - 2023-11-02 06:00:32.000000000 Z + - 2023-11-03 08:39:06.000000000 Z + - 2023-11-04 23:51:22.000000000 Z + - 2023-11-07 16:11:33.000000000 Z + - 2023-11-10 10:55:29.000000000 Z + - 2023-11-12 01:20:18.000000000 Z + - 2023-11-12 04:22:50.000000000 Z + - 2023-11-12 08:38:58.000000000 Z + - 2023-11-13 15:43:40.000000000 Z +pagy/extras/calendar__instance_methods_test_0012_selects__month_for_the_last_page: + :entries: + - 2023-11-02 02:52:55.000000000 Z + - 2023-11-02 06:00:32.000000000 Z + - 2023-11-03 08:39:06.000000000 Z + - 2023-11-04 23:51:22.000000000 Z + - 2023-11-07 16:11:33.000000000 Z + - 2023-11-10 10:55:29.000000000 Z + - 2023-11-12 01:20:18.000000000 Z + - 2023-11-12 04:22:50.000000000 Z + - 2023-11-12 08:38:58.000000000 Z + - 2023-11-13 15:43:40.000000000 Z +pagy/extras/calendar__Leap_feature_test_0001_works_with_MockApp__CalendarCounts_leap_month: :year: - :month: - :day: -pagy/extras/calendar__Counts_feature_test_0003_works_with_anchor_string: - :year: -pagy/extras/calendar__Counts_feature_test_0002_works_with_MockApp__CalendarCountsSkip: - :year: - :month: - :day: + :month: + :day: diff --git a/test/pagy/extras/headers_test.rb b/test/pagy/extras/headers_test.rb index 5ddf4d825..6f0183a39 100644 --- a/test/pagy/extras/headers_test.rb +++ b/test/pagy/extras/headers_test.rb @@ -65,7 +65,7 @@ _(app.send(:pagy_headers, pagy)).must_rematch :headers end it 'omit next on last page' do - pagy, _records = app.send(:pagy, Event.all, page: 26) + pagy, _records = app.send(:pagy, Event.all, page: 25) _(app.send(:pagy_headers, pagy)).must_rematch :headers end end diff --git a/test/pagy/extras/headers_test.rb.yaml b/test/pagy/extras/headers_test.rb.yaml index 6bcbf00b5..f045408f5 100644 --- a/test/pagy/extras/headers_test.rb.yaml +++ b/test/pagy/extras/headers_test.rb.yaml @@ -1,47 +1,28 @@ --- -pagy/extras/headers___pagy_headers_merge_test_0001_returns_the_full_headers_hash: - :response: !ruby/hash:Rack::Headers - link: ; rel="first", ; - rel="prev", ; rel="next", ; - rel="last" - current-page: '3' - page-items: '20' - total-pages: '50' - total-count: '1000' -pagy/extras/headers___pagy_headers_merge_with_Calendar_test_0001_returns_the_full_headers_hash: - :response: !ruby/hash:Rack::Headers - link: ; rel="first", ; - rel="prev", ; rel="next", ; - rel="last" - current-page: '3' - page-items: '20' - total-pages: '26' - total-count: '505' -pagy/extras/headers___pagy_headers_with_Keyset_test_0003_omit_next_on_last_page: +pagy/extras/headers___pagy_headers_test_0003_returns_custom_headers_hash: :headers: - link: ; rel="first" - page-items: '50' -pagy/extras/headers___pagy_headers_with_Keyset_test_0002_returns_custom_headers_hash: + link: ; rel="first", ; + rel="next", ; rel="last" +pagy/extras/headers___pagy_headers_test_0002_returns_custom_headers_hash: :headers: - link: ; rel="first", ; - rel="next" - Page: eyJpZCI6MjB9 + link: ; rel="first", ; + rel="next", ; rel="last" Per-Page: '20' -pagy/extras/headers___pagy_headers_with_Keyset_test_0001_returns_the_full_headers_hash: + Total: '1000' +pagy/extras/headers___pagy_headers_test_0001_returns_the_full_headers_hash: :headers: - link: ; rel="first", ; - rel="next" + link: ; rel="first", ; + rel="next", ; rel="last" + current-page: '1' page-items: '20' + total-pages: '50' + total-count: '1000' pagy/extras/headers___pagy_headers_test_0004_returns_the_countless_headers_hash: :headers: link: ; rel="first", ; rel="next" current-page: '1' page-items: '20' -pagy/extras/headers___pagy_headers_test_0003_returns_custom_headers_hash: - :headers: - link: ; rel="first", ; - rel="next", ; rel="last" pagy/extras/headers___pagy_headers_test_0006_omit_next_on_last_page: :headers: link: ; rel="first", ; @@ -50,7 +31,7 @@ pagy/extras/headers___pagy_headers_test_0006_omit_next_on_last_page: page-items: '20' total-pages: '50' total-count: '1000' -pagy/extras/headers___pagy_headers_test_0001_returns_the_full_headers_hash: +pagy/extras/headers___pagy_headers_test_0005_omit_prev_on_first_page: :headers: link: ; rel="first", ; rel="next", ; rel="last" @@ -58,57 +39,76 @@ pagy/extras/headers___pagy_headers_test_0001_returns_the_full_headers_hash: page-items: '20' total-pages: '50' total-count: '1000' -pagy/extras/headers___pagy_headers_test_0002_returns_custom_headers_hash: +pagy/extras/headers___pagy_headers_with_Keyset_test_0002_returns_custom_headers_hash: :headers: - link: ; rel="first", ; - rel="next", ; rel="last" + link: ; rel="first", ; + rel="next" + Page: eyJpZCI6MjB9 Per-Page: '20' - Total: '1000' -pagy/extras/headers___pagy_headers_test_0005_omit_prev_on_first_page: - :headers: - link: ; rel="first", ; - rel="next", ; rel="last" - current-page: '1' - page-items: '20' - total-pages: '50' - total-count: '1000' -pagy/extras/headers___pagy_headers_with_Calendar_test_0004_returns_the_countless_headers_hash: +pagy/extras/headers___pagy_headers_with_Keyset_test_0001_returns_the_full_headers_hash: :headers: - link: ; rel="first", ; + link: ; rel="first", ; rel="next" - current-page: '1' page-items: '20' +pagy/extras/headers___pagy_headers_with_Keyset_test_0003_omit_next_on_last_page: + :headers: + link: ; rel="first" + page-items: '50' pagy/extras/headers___pagy_headers_with_Calendar_test_0003_returns_custom_headers_hash: :headers: link: ; rel="first", ; - rel="next", ; rel="last" -pagy/extras/headers___pagy_headers_with_Calendar_test_0006_omit_next_on_last_page: + rel="next", ; rel="last" +pagy/extras/headers___pagy_headers_with_Calendar_test_0002_returns_custom_headers_hash: :headers: - link: ; rel="first", ; - rel="prev", ; rel="last" - current-page: '26' - page-items: '20' - total-pages: '26' - total-count: '505' + link: ; rel="first", ; + rel="next", ; rel="last" + Per-Page: '20' + Total: '487' pagy/extras/headers___pagy_headers_with_Calendar_test_0001_returns_the_full_headers_hash: :headers: link: ; rel="first", ; - rel="next", ; rel="last" + rel="next", ; rel="last" current-page: '1' page-items: '20' - total-pages: '26' - total-count: '505' -pagy/extras/headers___pagy_headers_with_Calendar_test_0002_returns_custom_headers_hash: + total-pages: '25' + total-count: '487' +pagy/extras/headers___pagy_headers_with_Calendar_test_0004_returns_the_countless_headers_hash: :headers: link: ; rel="first", ; - rel="next", ; rel="last" - Per-Page: '20' - Total: '505' + rel="next" + current-page: '1' + page-items: '20' +pagy/extras/headers___pagy_headers_with_Calendar_test_0006_omit_next_on_last_page: + :headers: + link: ; rel="first", ; + rel="prev", ; rel="last" + current-page: '25' + page-items: '20' + total-pages: '25' + total-count: '487' pagy/extras/headers___pagy_headers_with_Calendar_test_0005_omit_prev_on_first_page: :headers: link: ; rel="first", ; - rel="next", ; rel="last" + rel="next", ; rel="last" current-page: '1' page-items: '20' - total-pages: '26' - total-count: '505' + total-pages: '25' + total-count: '487' +pagy/extras/headers___pagy_headers_merge_with_Calendar_test_0001_returns_the_full_headers_hash: + :response: !ruby/hash:Rack::Headers + link: ; rel="first", ; + rel="prev", ; rel="next", ; + rel="last" + current-page: '3' + page-items: '20' + total-pages: '25' + total-count: '487' +pagy/extras/headers___pagy_headers_merge_test_0001_returns_the_full_headers_hash: + :response: !ruby/hash:Rack::Headers + link: ; rel="first", ; + rel="prev", ; rel="next", ; + rel="last" + current-page: '3' + page-items: '20' + total-pages: '50' + total-count: '1000'