pagy 6.4.4 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/lib/config/pagy.rb +18 -16
  4. data/lib/javascripts/pagy-dev.js +3 -3
  5. data/lib/javascripts/pagy-module.js +2 -2
  6. data/lib/javascripts/pagy.js +1 -1
  7. data/lib/locales/ar.yml +14 -10
  8. data/lib/locales/be.yml +11 -10
  9. data/lib/locales/bg.yml +9 -10
  10. data/lib/locales/bs.yml +11 -10
  11. data/lib/locales/ca.yml +11 -10
  12. data/lib/locales/cs.yml +12 -9
  13. data/lib/locales/da.yml +11 -10
  14. data/lib/locales/de.yml +9 -10
  15. data/lib/locales/en.yml +9 -10
  16. data/lib/locales/es.yml +9 -10
  17. data/lib/locales/fr.yml +9 -10
  18. data/lib/locales/hr.yml +11 -10
  19. data/lib/locales/id.yml +9 -10
  20. data/lib/locales/it.yml +9 -10
  21. data/lib/locales/ja.yml +9 -10
  22. data/lib/locales/km.yml +9 -9
  23. data/lib/locales/ko.yml +9 -10
  24. data/lib/locales/nb.yml +9 -10
  25. data/lib/locales/nl.yml +9 -10
  26. data/lib/locales/nn.yml +9 -10
  27. data/lib/locales/pl.yml +11 -10
  28. data/lib/locales/pt-BR.yml +9 -10
  29. data/lib/locales/pt.yml +9 -10
  30. data/lib/locales/ru.yml +13 -10
  31. data/lib/locales/sr.yml +11 -9
  32. data/lib/locales/sv-SE.yml +10 -12
  33. data/lib/locales/sv.yml +10 -12
  34. data/lib/locales/sw.yml +11 -10
  35. data/lib/locales/ta.yml +11 -10
  36. data/lib/locales/tr.yml +9 -10
  37. data/lib/locales/uk.yml +11 -10
  38. data/lib/locales/vi.yml +7 -10
  39. data/lib/locales/zh-CN.yml +9 -10
  40. data/lib/locales/zh-HK.yml +9 -10
  41. data/lib/locales/zh-TW.yml +9 -10
  42. data/lib/pagy/backend.rb +2 -2
  43. data/lib/pagy/calendar/day.rb +3 -2
  44. data/lib/pagy/calendar/helper.rb +3 -7
  45. data/lib/pagy/calendar/month.rb +3 -2
  46. data/lib/pagy/calendar/quarter.rb +3 -2
  47. data/lib/pagy/calendar/year.rb +2 -1
  48. data/lib/pagy/extras/bootstrap.rb +42 -29
  49. data/lib/pagy/extras/bulma.rb +40 -31
  50. data/lib/pagy/extras/calendar.rb +7 -8
  51. data/lib/pagy/extras/elasticsearch_rails.rb +6 -6
  52. data/lib/pagy/extras/foundation.rb +44 -31
  53. data/lib/pagy/extras/frontend_helpers.rb +7 -7
  54. data/lib/pagy/extras/headers.rb +7 -7
  55. data/lib/pagy/extras/i18n.rb +4 -4
  56. data/lib/pagy/extras/items.rb +10 -9
  57. data/lib/pagy/extras/jsonapi.rb +2 -7
  58. data/lib/pagy/extras/materialize.rb +41 -29
  59. data/lib/pagy/extras/meilisearch.rb +7 -7
  60. data/lib/pagy/extras/metadata.rb +1 -1
  61. data/lib/pagy/extras/navs.rb +21 -33
  62. data/lib/pagy/extras/overflow.rb +7 -5
  63. data/lib/pagy/extras/searchkick.rb +6 -6
  64. data/lib/pagy/extras/semantic.rb +40 -27
  65. data/lib/pagy/extras/standalone.rb +4 -7
  66. data/lib/pagy/extras/support.rb +18 -32
  67. data/lib/pagy/extras/trim.rb +2 -2
  68. data/lib/pagy/extras/uikit.rb +43 -30
  69. data/lib/pagy/frontend.rb +56 -25
  70. data/lib/pagy/i18n.rb +0 -2
  71. data/lib/pagy/url_helpers.rb +1 -2
  72. data/lib/pagy.rb +16 -14
  73. metadata +4 -19
  74. data/lib/templates/bootstrap_nav.html.erb +0 -24
  75. data/lib/templates/bootstrap_nav.html.haml +0 -34
  76. data/lib/templates/bootstrap_nav.html.slim +0 -34
  77. data/lib/templates/bulma_nav.html.erb +0 -24
  78. data/lib/templates/bulma_nav.html.haml +0 -32
  79. data/lib/templates/bulma_nav.html.slim +0 -32
  80. data/lib/templates/foundation_nav.html.erb +0 -24
  81. data/lib/templates/foundation_nav.html.haml +0 -34
  82. data/lib/templates/foundation_nav.html.slim +0 -34
  83. data/lib/templates/nav.html.erb +0 -22
  84. data/lib/templates/nav.html.haml +0 -30
  85. data/lib/templates/nav.html.slim +0 -29
  86. data/lib/templates/uikit_nav.html.erb +0 -15
  87. data/lib/templates/uikit_nav.html.haml +0 -28
  88. data/lib/templates/uikit_nav.html.slim +0 -28
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagy
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.4.4
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Domizio Demichelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-14 00:00:00.000000000 Z
11
+ date: 2024-02-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Agnostic pagination in plain ruby. It does it all. Better.
14
14
  email:
@@ -98,21 +98,6 @@ files:
98
98
  - lib/pagy/frontend.rb
99
99
  - lib/pagy/i18n.rb
100
100
  - lib/pagy/url_helpers.rb
101
- - lib/templates/bootstrap_nav.html.erb
102
- - lib/templates/bootstrap_nav.html.haml
103
- - lib/templates/bootstrap_nav.html.slim
104
- - lib/templates/bulma_nav.html.erb
105
- - lib/templates/bulma_nav.html.haml
106
- - lib/templates/bulma_nav.html.slim
107
- - lib/templates/foundation_nav.html.erb
108
- - lib/templates/foundation_nav.html.haml
109
- - lib/templates/foundation_nav.html.slim
110
- - lib/templates/nav.html.erb
111
- - lib/templates/nav.html.haml
112
- - lib/templates/nav.html.slim
113
- - lib/templates/uikit_nav.html.erb
114
- - lib/templates/uikit_nav.html.haml
115
- - lib/templates/uikit_nav.html.slim
116
101
  homepage: https://github.com/ddnexus/pagy
117
102
  licenses:
118
103
  - MIT
@@ -131,14 +116,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
116
  requirements:
132
117
  - - ">="
133
118
  - !ruby/object:Gem::Version
134
- version: '2.5'
119
+ version: '3.1'
135
120
  required_rubygems_version: !ruby/object:Gem::Requirement
136
121
  requirements:
137
122
  - - ">="
138
123
  - !ruby/object:Gem::Version
139
124
  version: '0'
140
125
  requirements: []
141
- rubygems_version: 3.3.26
126
+ rubygems_version: 3.5.3
142
127
  signing_key:
143
128
  specification_version: 4
144
129
  summary: The kick-ass pagination ruby gem
@@ -1,24 +0,0 @@
1
- <%#
2
- This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
3
- calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
4
-
5
- The link variable is set to a proc that returns the link tag.
6
- Usage: link.call( page_number [, text [, extra_attributes_string ]])
7
- -%>
8
- <% link = pagy_link_proc(pagy, link_extra: 'class="page-link"') -%>
9
- <%# -%><nav class="pagy-bootstrap-nav" role="navigation">
10
- <%# -%> <ul class="pagination">
11
- <% if pagy.prev -%> <li class="page-item prev"><%== link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"') %></li>
12
- <% else -%> <li class="page-item prev disabled"><a href="#" class="page-link"><%== pagy_t('pagy.nav.prev') %></a></li>
13
- <% end -%>
14
- <% pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] -%>
15
- <% if item.is_a?(Integer) -%> <li class="page-item"><%== link.call(item) %></li>
16
- <% elsif item.is_a?(String) -%> <li class="page-item active"><%== link.call(item) %></li>
17
- <% elsif item == :gap -%> <li class="page-item disabled gap"><a href="#" class="page-link"><%== pagy_t('pagy.nav.gap') %></a></li>
18
- <% end -%>
19
- <% end -%>
20
- <% if pagy.next -%> <li class="page-item next"><%== link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"') %></li>
21
- <% else -%> <li class="page-item next disabled"><a href="#" class="page-link"><%== pagy_t('pagy.nav.next') %></a></li>
22
- <% end -%>
23
- <%# -%> </ul>
24
- <%# -%></nav>
@@ -1,34 +0,0 @@
1
- -# This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
2
- -# calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
3
-
4
- -# The link variable is set to a proc that returns the link tag.
5
- -# Usage: link.call( page_number [, text [, extra_attributes_string ]])
6
-
7
- - link = pagy_link_proc(pagy, link_extra: 'class="page-link"')
8
-
9
- %nav.pagy-bootstrap-nav{:role => "navigation"}
10
-
11
- %ul.pagination
12
-
13
- - if pagy.prev
14
- %li.page-item.prev!= link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"')
15
- - else
16
- %li.page-item.prev.disabled
17
- %a.page-link{:href => '#'}!= pagy_t('pagy.nav.prev')
18
-
19
- - pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
20
- - if item.is_a?(Integer) # page link
21
- %li.page-item!= link.call(item)
22
-
23
- - elsif item.is_a?(String) # current page
24
- %li.page-item.active!= link.call(item)
25
-
26
- - elsif item == :gap # page gap
27
- %li.page-item.disabled.gap
28
- %a.page-link{:href => "#"}!= pagy_t('pagy.nav.gap')
29
-
30
- - if pagy.next
31
- %li.page-item.next!= link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"')
32
- - else
33
- %li.page-item.next.disabled
34
- %a.page-link{:href => '#'}!= pagy_t('pagy.nav.next')
@@ -1,34 +0,0 @@
1
- / This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
2
- / calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
3
-
4
- / The link variable is set to a proc that returns the link tag.
5
- / Usage: link.call( page_number [, text [, extra_attributes_string ]])
6
-
7
- - link = pagy_link_proc(pagy, link_extra: 'class="page-link"')
8
-
9
- nav.pagy-bootstrap-nav role="navigation"
10
-
11
- ul.pagination
12
-
13
- - if pagy.prev
14
- li.page-item.prev == link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"')
15
- - else
16
- li.page-item.prev.disabled
17
- a.page-link href="#" == pagy_t('pagy.nav.prev')
18
-
19
- - pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
20
- - if item.is_a?(Integer) # page link
21
- li.page-item == link.call(item)
22
-
23
- - elsif item.is_a?(String) # current page
24
- li.page-item.active == link.call(item)
25
-
26
- - elsif item == :gap # page gap
27
- li.page-item.disabled.gap
28
- a.page-link href="#" == pagy_t('pagy.nav.gap')
29
-
30
- - if pagy.next
31
- li.page-item.next == link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"')
32
- - else
33
- li.page-item.next.disabled
34
- a.page-link href="#" == pagy_t('pagy.nav.next')
@@ -1,24 +0,0 @@
1
- <%#
2
- This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
3
- calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
4
-
5
- The link variable is set to a proc that returns the link tag.
6
- Usage: link.call( page_number [, text [, extra_attributes_string ]])
7
- -%>
8
- <% link = pagy_link_proc(pagy) -%>
9
- <%# -%><nav class="pagy-bulma-nav pagination is-centered" role="navigation" aria-label="pagination">
10
- <% if pagy.prev -%> <%== link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'class="pagination-previous" aria-label="previous page"') %>
11
- <% else -%> <a class="pagination-previous" disabled><%== pagy_t('pagy.nav.prev') %></a>
12
- <% end -%>
13
- <% if pagy.next -%> <%== link.call(pagy.next, pagy_t('pagy.nav.next'), 'class="pagination-next" aria-label="next page"') %>
14
- <% else -%> <a class="pagination-next" disabled><%== pagy_t('pagy.nav.next') %></a>
15
- <% end -%>
16
- <%# -%> <ul class="pagination-list">
17
- <% pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] -%>
18
- <% if item.is_a?(Integer) -%> <li><%== link.call item, item, %(class="pagination-link" aria-label="goto page #{item}") %></li>
19
- <% elsif item.is_a?(String) -%> <li><%== link.call item, item, %(class="pagination-link is-current" aria-label="page #{item}" aria-current="page") %></li>
20
- <% elsif item == :gap -%> <li><span class="pagination-ellipsis"><%== pagy_t('pagy.nav.gap') %></span></li>
21
- <% end -%>
22
- <% end -%>
23
- <%# -%> </ul>
24
- <%# -%></nav>
@@ -1,32 +0,0 @@
1
- -# This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
2
- -# calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
3
-
4
- -# The link variable is set to a proc that returns the link tag.
5
- -# Usage: link.call( page_number [, text [, extra_attributes_string ]])
6
-
7
- - link = pagy_link_proc(pagy)
8
-
9
- %nav.pagy-bulma_nav.pagination.is-centered{:role => "navigation", "aria-label" => "pagination"}
10
-
11
- - if pagy.prev
12
- != link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'class="pagination-previous" aria-label="previous page"')
13
- - else
14
- %a.pagination-previous{:disabled => "disabled"}!= pagy_t('pagy.nav.prev')
15
-
16
- - if pagy.next
17
- != link.call(pagy.next, pagy_t('pagy.nav.next'), 'class="pagination-next" aria-label="next page"')
18
- - else
19
- %a.pagination-next{:disabled => "disabled"}!= pagy_t('pagy.nav.next')
20
-
21
- %ul.pagination-list
22
-
23
- - pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
24
- - if item.is_a?(Integer) # page link
25
- %li!= link.call item, item, %(class="pagination-link" aria-label="goto page #{item}")
26
-
27
- - elsif item.is_a?(String) # current page
28
- %li!= link.call item, item, %(class="pagination-link is-current" aria-label="page #{item}" aria-current="page")
29
-
30
- - elsif item == :gap # page gap
31
- %li
32
- %span.pagination-ellipsis!= pagy_t('pagy.nav.gap')
@@ -1,32 +0,0 @@
1
- / This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
2
- / calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
3
-
4
- / The link variable is set to a proc that returns the link tag.
5
- / Usage: link.call( page_number [, text [, extra_attributes_string ]])
6
-
7
- - link = pagy_link_proc(pagy)
8
-
9
- nav.pagy-bulma-nav.pagination.is-centered role="navigation" aria-label="pagination"
10
-
11
- - if pagy.prev
12
- == link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'class="pagination-previous" aria-label="previous page"')
13
- - else
14
- a.pagination-previous disabled="disabled" == pagy_t('pagy.nav.prev')
15
-
16
- - if pagy.next
17
- == link.call(pagy.next, pagy_t('pagy.nav.next'), 'class="pagination-next" aria-label="next page"')
18
- - else
19
- a.pagination-next disabled="disabled" == pagy_t('pagy.nav.next')
20
-
21
- ul.pagination-list
22
-
23
- - pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
24
- - if item.is_a?(Integer) # page link
25
- li == link.call item, item, %(class="pagination-link" aria-label="goto page #{item}")
26
-
27
- - elsif item.is_a?(String) # current page
28
- li == link.call item, item, %(class="pagination-link is-current" aria-label="page #{item}" aria-current="page")
29
-
30
- - elsif item == :gap # page gap
31
- li
32
- span.pagination-ellipsis == pagy_t('pagy.nav.gap')
@@ -1,24 +0,0 @@
1
- <%#
2
- This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
3
- calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
4
-
5
- The link variable is set to a proc that returns the link tag.
6
- Usage: link.call( page_number [, text [, extra_attributes_string ]])
7
- -%>
8
- <% link = pagy_link_proc(pagy) -%>
9
- <%# -%><nav class="pagy-foundation-nav" role="navigation" aria-label="Pagination">
10
- <%# -%> <ul class="pagination">
11
- <% if pagy.prev -%> <li class="prev"><%== link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"') %></li>
12
- <% else -%> <li class="prev disabled"><%== pagy_t('pagy.nav.prev') %></li>
13
- <% end -%>
14
- <% pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] -%>
15
- <% if item.is_a?(Integer) -%> <li><%== link.call(item) %></li>
16
- <% elsif item.is_a?(String) -%> <li class="current"><%= pagy.label_for(item) %></li>
17
- <% elsif item == :gap -%> <li class="ellipsis gap" aria-hidden="true"></li>
18
- <% end -%>
19
- <% end -%>
20
- <% if pagy.next -%> <li class="next"><%== link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"') %></li>
21
- <% else -%> <li class="next disabled"><%== pagy_t('pagy.nav.next') %></li>
22
- <% end -%>
23
- <%# -%> </ul>
24
- <%# -%></nav>
@@ -1,34 +0,0 @@
1
- -# This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
2
- -# calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
3
-
4
- -# The link variable is set to a proc that returns the link tag.
5
- -# Usage: link.call( page_number [, text [, extra_attributes_string ]])
6
-
7
- - link = pagy_link_proc(pagy)
8
-
9
- %nav.pagy-foundation-nav{"role" => "navigation", "aria-label" => "Pagination"}
10
-
11
- %ul.pagination
12
-
13
- - if pagy.prev
14
- %li.prev!= link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"')
15
- - else
16
- %li.prev.disabled
17
- != pagy_t('pagy.nav.prev')
18
-
19
- - pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
20
- - if item.is_a?(Integer) # page link
21
- %li!= link.call(item)
22
-
23
- - elsif item.is_a?(String) # current page
24
- %li.current
25
- = pagy.label_for(item)
26
-
27
- - elsif item == :gap # page gap
28
- %li.ellipsis.gap{"aria-hidden" => true}
29
-
30
- - if pagy.next
31
- %li.next!= link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"')
32
- - else
33
- %li.next.disabled
34
- != pagy_t('pagy.nav.next')
@@ -1,34 +0,0 @@
1
- / This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
2
- / calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
3
-
4
- / The link variable is set to a proc that returns the link tag.
5
- / Usage: link.call( page_number [, text [, extra_attributes_string ]])
6
-
7
- - link = pagy_link_proc(pagy)
8
-
9
- nav.pagy-foundation-nav role="navigation" aria-label="Pagination"
10
-
11
- ul.pagination
12
-
13
- - if pagy.prev
14
- li.prev == link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"')
15
- - else
16
- li.prev.disabled
17
- == pagy_t('pagy.nav.prev')
18
-
19
- - pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
20
- - if item.is_a?(Integer) # page link
21
- li == link.call(item)
22
-
23
- - elsif item.is_a?(String) # current page
24
- li.current
25
- = pagy.label_for(item)
26
-
27
- - elsif item == :gap # page gap
28
- li.ellipsis.gap aria-hidden="true"
29
-
30
- - if pagy.next
31
- li.next == link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"')
32
- - else
33
- li.next.disabled
34
- == pagy_t('pagy.nav.next')
@@ -1,22 +0,0 @@
1
- <%#
2
- This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
3
- calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
4
-
5
- The link variable is set to a proc that returns the link tag.
6
- Usage: link.call( page_number [, text [, extra_attributes_string ]])
7
- -%>
8
- <% link = pagy_link_proc(pagy) -%>
9
- <%# -%><nav class="pagy_nav pagination" role="navigation">
10
- <% if pagy.prev -%> <span class="page prev"><%== link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"') %></span>
11
- <% else -%> <span class="page prev disabled"><%== pagy_t('pagy.nav.prev') %></span>
12
- <% end -%>
13
- <% pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] -%>
14
- <% if item.is_a?(Integer) -%> <span class="page"><%== link.call(item) %></span>
15
- <% elsif item.is_a?(String) -%> <span class="page current"><%= item %></span>
16
- <% elsif item == :gap -%> <span class="page gap"><%== pagy_t('pagy.nav.gap') %></span>
17
- <% end -%>
18
- <% end -%>
19
- <% if pagy.next -%> <span class="page next"><%== link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"') %></span>
20
- <% else -%> <span class="page next disabled"><%== pagy_t('pagy.nav.next') %></span>
21
- <% end -%>
22
- <%# -%></nav>
@@ -1,30 +0,0 @@
1
- -# This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
2
- -# calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
3
-
4
- -# The link variable is set to a proc that returns the link tag.
5
- -# Usage: link.call( page_number [, text [, extra_attributes_string ]])
6
-
7
- - link = pagy_link_proc(pagy)
8
-
9
- %nav.pagy_nav.pagination{:role => "navigation"}
10
-
11
- - if pagy.prev
12
- %span.page.prev!= link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"')
13
- - else
14
- %span.page.prev.disabled!= pagy_t('pagy.nav.prev')
15
-
16
- - pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
17
- - if item.is_a?(Integer) # page link
18
- %span.page
19
- != link.call(item)
20
-
21
- - elsif item.is_a?(String) # current page
22
- %span.page.current= item
23
-
24
- - elsif item == :gap # page gap
25
- %span.page.gap!= pagy_t('pagy.nav.gap')
26
-
27
- - if pagy.next
28
- %span.page.next!= link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"')
29
- - else
30
- %span.page.next.disabled!= pagy_t('pagy.nav.next')
@@ -1,29 +0,0 @@
1
- / This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
2
- / calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
3
-
4
- / The link variable is set to a proc that returns the link tag.
5
- / Usage: link.call( page_number [, text [, extra_attributes_string ]])
6
-
7
- - link = pagy_link_proc(pagy)
8
-
9
- nav.pagy_nav.pagination role="navigation"
10
-
11
- - if pagy.prev
12
- span.page.prev ==> link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"')
13
- - else
14
- span.page.prev.disabled ==> pagy_t('pagy.nav.prev')
15
-
16
- - pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
17
- - if item.is_a?(Integer) # page link
18
- span.page ==> link.call(item)
19
-
20
- - elsif item.is_a?(String) # current page
21
- span.page.current ==> item
22
-
23
- - elsif item == :gap # page gap
24
- span.page.gap ==> pagy_t('pagy.nav.gap')
25
-
26
- - if pagy.next
27
- span.page.next == link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"')
28
- - else
29
- span.page.next.disabled == pagy_t('pagy.nav.next')
@@ -1,15 +0,0 @@
1
- <% link = pagy_link_proc(pagy) -%>
2
- <%# -%> <ul class="uk-pagination uk-flex-center">
3
- <% if page.prev -%> <li><%== link.call(pagy.prev, "<span uk-pagination-previous>#{pagy_t('pagy.nav.prev')}</span>") %></li>
4
- <% else -%> <li class="uk-disabled"><a href="#"><span uk-pagination-previous><%== pagy_t('pagy.nav.prev') %></span></a></li>
5
- <% end -%>
6
- <% pagy.series.each do |item| -%>
7
- <% if item.is_a?(Integer) -%> <li><%== link.call(item) %></li>
8
- <% elsif item.is_a?(String) -%> <li class="uk-active"><span><%== pagy.label_for(item) %></span></li>
9
- <% elsif item == :gap -%> <li class="uk-disabled"><span><%== pagy_t('pagy.nav.gap') %></span></li>
10
- <% end -%>
11
- <% end -%>
12
- <% if pagy.next -%> <li><%== link.call(pagy.next, "<span uk-pagination-next>#{pagy_t('pagy.nav.next')}</span>") %></li>
13
- <% else -%> <li class="uk-disabled"><a href="#"><span uk-pagination-next><%== pagy_t('pagy.nav.next') %></span></a></li>
14
- <% end -%>
15
- <%# -%> </ul>
@@ -1,28 +0,0 @@
1
- - link = pagy_link_proc(pagy)
2
-
3
- %ul.uk-pagination.uk-flex-center
4
- - if page.prev
5
- %li!= link.call(pagy.prev, "<span uk-pagination-previous>#{pagy_t('pagy.nav.prev')}</span>")
6
- - else
7
- %li.uk-disabled
8
- %a{href: "#"}
9
- %span{"uk-pagination-previous" => ""}!= pagy_t('pagy.nav.prev')
10
-
11
- - pagy.series.each do |item|
12
- - if item.is_a?(Integer)
13
- %li!= link.call(item)
14
-
15
- - elsif item.is_a?(String)
16
- %li.uk-active
17
- %span!= pagy.label_for(item)
18
-
19
- - elsif item == :gap
20
- %li.uk-disabled
21
- %span!= pagy_t('pagy.nav.gap')
22
-
23
- - if pagy.next
24
- %li!= link.call(p_next, "<span uk-pagination-next>#{pagy_t('pagy.nav.next')}</span>")
25
- - else
26
- %li.uk-disabled
27
- %a{href: "#"}
28
- %span{"uk-pagination-next" => ""}!= pagy_t('pagy.nav.next')
@@ -1,28 +0,0 @@
1
- - link = pagy_link_proc(pagy)
2
-
3
- ul.uk-pagination.uk-flex-center
4
- - if page.prev
5
- li== link.call(pagy.prev, "<span uk-pagination-previous>#{pagy_t('pagy.nav.prev')}</span>")
6
- - else
7
- li.uk-disabled
8
- a href="#"
9
- span uk-pagination-previous="" == pagy_t('pagy.nav.prev')
10
-
11
- - pagy.series.each do |item|
12
- - if item.is_a?(Integer)
13
- li== link.call(item)
14
-
15
- - elsif item.is_a?(String)
16
- li.uk-active
17
- span== pagy.label_for(item)
18
-
19
- - elsif item == :gap
20
- li.uk-disabled
21
- span== pagy_t('pagy.nav.gap')
22
-
23
- - if pagy.next
24
- li== link.call(pagy.next, "<span uk-pagination-next>#{pagy_t('pagy.nav.next')}</span>")
25
- - else
26
- li.uk-disabled
27
- a href="#"
28
- span uk-pagination-next="" == pagy_t('pagy.nav.next')