pagy 6.5.0 → 7.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) 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 +10 -11
  5. data/lib/javascripts/pagy-module.js +9 -10
  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/ckb.yml +8 -10
  13. data/lib/locales/cs.yml +13 -12
  14. data/lib/locales/da.yml +11 -10
  15. data/lib/locales/de.yml +9 -10
  16. data/lib/locales/en.yml +9 -10
  17. data/lib/locales/es.yml +9 -10
  18. data/lib/locales/fr.yml +9 -10
  19. data/lib/locales/hr.yml +11 -10
  20. data/lib/locales/id.yml +9 -10
  21. data/lib/locales/it.yml +9 -10
  22. data/lib/locales/ja.yml +9 -10
  23. data/lib/locales/km.yml +9 -9
  24. data/lib/locales/ko.yml +9 -10
  25. data/lib/locales/nb.yml +9 -10
  26. data/lib/locales/nl.yml +9 -10
  27. data/lib/locales/nn.yml +9 -10
  28. data/lib/locales/pl.yml +11 -10
  29. data/lib/locales/pt-BR.yml +9 -10
  30. data/lib/locales/pt.yml +9 -10
  31. data/lib/locales/ru.yml +13 -10
  32. data/lib/locales/sr.yml +11 -9
  33. data/lib/locales/sv-SE.yml +10 -12
  34. data/lib/locales/sv.yml +10 -12
  35. data/lib/locales/sw.yml +11 -10
  36. data/lib/locales/ta.yml +11 -10
  37. data/lib/locales/tr.yml +9 -10
  38. data/lib/locales/uk.yml +11 -10
  39. data/lib/locales/vi.yml +7 -10
  40. data/lib/locales/zh-CN.yml +9 -10
  41. data/lib/locales/zh-HK.yml +9 -10
  42. data/lib/locales/zh-TW.yml +9 -10
  43. data/lib/pagy/backend.rb +3 -2
  44. data/lib/pagy/calendar/day.rb +3 -2
  45. data/lib/pagy/calendar/helper.rb +3 -7
  46. data/lib/pagy/calendar/month.rb +3 -2
  47. data/lib/pagy/calendar/quarter.rb +3 -2
  48. data/lib/pagy/calendar/year.rb +2 -1
  49. data/lib/pagy/extras/bootstrap.rb +45 -30
  50. data/lib/pagy/extras/bulma.rb +44 -33
  51. data/lib/pagy/extras/calendar.rb +7 -8
  52. data/lib/pagy/extras/elasticsearch_rails.rb +6 -6
  53. data/lib/pagy/extras/foundation.rb +46 -33
  54. data/lib/pagy/extras/frontend_helpers.rb +8 -8
  55. data/lib/pagy/extras/headers.rb +9 -9
  56. data/lib/pagy/extras/i18n.rb +4 -4
  57. data/lib/pagy/extras/items.rb +11 -10
  58. data/lib/pagy/extras/jsonapi.rb +2 -7
  59. data/lib/pagy/extras/materialize.rb +41 -29
  60. data/lib/pagy/extras/meilisearch.rb +7 -7
  61. data/lib/pagy/extras/metadata.rb +6 -6
  62. data/lib/pagy/extras/navs.rb +26 -38
  63. data/lib/pagy/extras/overflow.rb +7 -5
  64. data/lib/pagy/extras/searchkick.rb +6 -6
  65. data/lib/pagy/extras/semantic.rb +40 -27
  66. data/lib/pagy/extras/standalone.rb +4 -7
  67. data/lib/pagy/extras/support.rb +18 -32
  68. data/lib/pagy/extras/trim.rb +2 -2
  69. data/lib/pagy/extras/uikit.rb +44 -31
  70. data/lib/pagy/frontend.rb +59 -28
  71. data/lib/pagy/i18n.rb +0 -2
  72. data/lib/pagy/url_helpers.rb +1 -2
  73. data/lib/pagy.rb +16 -14
  74. data/lib/stylesheets/pagy.css +61 -0
  75. data/lib/stylesheets/pagy.scss +50 -0
  76. data/lib/stylesheets/pagy.tailwind.scss +24 -0
  77. metadata +7 -19
  78. data/lib/templates/bootstrap_nav.html.erb +0 -24
  79. data/lib/templates/bootstrap_nav.html.haml +0 -34
  80. data/lib/templates/bootstrap_nav.html.slim +0 -34
  81. data/lib/templates/bulma_nav.html.erb +0 -24
  82. data/lib/templates/bulma_nav.html.haml +0 -32
  83. data/lib/templates/bulma_nav.html.slim +0 -32
  84. data/lib/templates/foundation_nav.html.erb +0 -24
  85. data/lib/templates/foundation_nav.html.haml +0 -34
  86. data/lib/templates/foundation_nav.html.slim +0 -34
  87. data/lib/templates/nav.html.erb +0 -22
  88. data/lib/templates/nav.html.haml +0 -30
  89. data/lib/templates/nav.html.slim +0 -29
  90. data/lib/templates/uikit_nav.html.erb +0 -15
  91. data/lib/templates/uikit_nav.html.haml +0 -28
  92. data/lib/templates/uikit_nav.html.slim +0 -28
@@ -0,0 +1,61 @@
1
+ .pagy {
2
+ display: flex;
3
+ }
4
+
5
+ .pagy > :not([hidden]) ~ :not([hidden]) {
6
+ --space-reverse: 0;
7
+ margin-right: calc(0.25rem * var(--space-reverse));
8
+ margin-left: calc(0.25rem * calc(1 - var(--space-reverse)));
9
+ }
10
+
11
+ .pagy {
12
+ font-family: sans-serif;
13
+ font-size: 0.875rem;
14
+ line-height: 1.25rem;
15
+ font-weight: 600;
16
+ color: rgb(107 114 128);
17
+ }
18
+
19
+ .pagy .page.gap {
20
+ /* if you need to customize it */
21
+ }
22
+
23
+ .pagy .page a {
24
+ display: block;
25
+ text-decoration: none;
26
+ border-radius: 0.5rem;
27
+ background-color: rgb(229 231 235);
28
+ padding: 0.25rem 0.75rem;
29
+ color: inherit;
30
+ }
31
+
32
+ .pagy .page a:hover {
33
+ background-color: rgb(209 213 219);
34
+ }
35
+
36
+ .pagy .page.active a {
37
+ cursor: default;
38
+ background-color: rgb(156 163 175);
39
+ color: rgb(255 255 255);
40
+ }
41
+
42
+ .pagy .page.disabled a {
43
+ cursor: default;
44
+ background-color: rgb(243 244 246);
45
+ color: rgb(209 213 219);
46
+ }
47
+
48
+ .pagy .pagy-combo-input, .pagy.pagy-items-selector-js {
49
+ white-space: nowrap;
50
+ display: inline-block;
51
+ border-radius: 0.5rem;
52
+ background-color: rgb(229 231 235);
53
+ padding: 0.125rem 0.75rem;
54
+ }
55
+
56
+ .pagy .pagy-combo-input input, .pagy.pagy-items-selector-js input {
57
+ line-height: 1.5rem;
58
+ border-radius: 0.375rem;
59
+ border-style: none;
60
+ background-color: rgb(243 244 246);
61
+ }
@@ -0,0 +1,50 @@
1
+ .pagy {
2
+ display: flex;
3
+ font-family: sans-serif;
4
+ font-size: 0.875rem;
5
+ line-height: 1.25rem;
6
+ font-weight: 600;
7
+ color: rgb(107 114 128);
8
+ & > :not([hidden]) ~ :not([hidden]) {
9
+ --space-reverse: 0;
10
+ margin-right: calc(0.25rem * var(--space-reverse));
11
+ margin-left: calc(0.25rem * calc(1 - var(--space-reverse)));
12
+ }
13
+ .page {
14
+ a {
15
+ display: block;
16
+ text-decoration: none;
17
+ border-radius: 0.5rem;
18
+ background-color: rgb(229 231 235);
19
+ padding: 0.25rem 0.75rem;
20
+ color: inherit;
21
+ &:hover {
22
+ background-color: rgb(209 213 219);
23
+ }
24
+ }
25
+ &.active a {
26
+ cursor: default;
27
+ background-color: rgb(156 163 175);
28
+ color: rgb(255 255 255);
29
+ }
30
+ &.disabled a {
31
+ cursor: default;
32
+ background-color: rgb(243 244 246);
33
+ color: rgb(209 213 219);
34
+ }
35
+ &.gap { } /* if you need to customize it */
36
+ }
37
+ .pagy-combo-input, &.pagy-items-selector-js {
38
+ white-space: nowrap;
39
+ display: inline-block;
40
+ border-radius: 0.5rem;
41
+ background-color: rgb(229 231 235);
42
+ padding: 0.125rem 0.75rem;
43
+ input {
44
+ line-height: 1.5rem;
45
+ border-radius: 0.375rem;
46
+ border-style: none;
47
+ background-color: rgb(243 244 246);
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,24 @@
1
+ .pagy {
2
+ @apply flex space-x-1 font-semibold text-sm text-gray-500;
3
+ .page {
4
+ a {
5
+ @apply block rounded-lg px-3 py-1 bg-gray-200;
6
+ &:hover {
7
+ @apply bg-gray-300;
8
+ }
9
+ }
10
+ &.active a {
11
+ @apply text-white bg-gray-400 cursor-default;
12
+ }
13
+ &.disabled a {
14
+ @apply text-gray-300 bg-gray-100 cursor-default;
15
+ }
16
+ &.gap { } /* if you need to customize it */
17
+ }
18
+ .pagy-combo-input, &.pagy-items-selector-js {
19
+ @apply inline-block whitespace-nowrap bg-gray-200 rounded-lg px-3 py-0.5;
20
+ input {
21
+ @apply bg-gray-100 border-none rounded-md;
22
+ }
23
+ }
24
+ }
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.5.0
4
+ version: 7.0.9
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-16 00:00:00.000000000 Z
11
+ date: 2024-03-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Agnostic pagination in plain ruby. It does it all. Better.
14
14
  email:
@@ -99,21 +99,9 @@ files:
99
99
  - lib/pagy/frontend.rb
100
100
  - lib/pagy/i18n.rb
101
101
  - lib/pagy/url_helpers.rb
102
- - lib/templates/bootstrap_nav.html.erb
103
- - lib/templates/bootstrap_nav.html.haml
104
- - lib/templates/bootstrap_nav.html.slim
105
- - lib/templates/bulma_nav.html.erb
106
- - lib/templates/bulma_nav.html.haml
107
- - lib/templates/bulma_nav.html.slim
108
- - lib/templates/foundation_nav.html.erb
109
- - lib/templates/foundation_nav.html.haml
110
- - lib/templates/foundation_nav.html.slim
111
- - lib/templates/nav.html.erb
112
- - lib/templates/nav.html.haml
113
- - lib/templates/nav.html.slim
114
- - lib/templates/uikit_nav.html.erb
115
- - lib/templates/uikit_nav.html.haml
116
- - lib/templates/uikit_nav.html.slim
102
+ - lib/stylesheets/pagy.css
103
+ - lib/stylesheets/pagy.scss
104
+ - lib/stylesheets/pagy.tailwind.scss
117
105
  homepage: https://github.com/ddnexus/pagy
118
106
  licenses:
119
107
  - MIT
@@ -132,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
120
  requirements:
133
121
  - - ">="
134
122
  - !ruby/object:Gem::Version
135
- version: '2.5'
123
+ version: '3.1'
136
124
  required_rubygems_version: !ruby/object:Gem::Requirement
137
125
  requirements:
138
126
  - - ">="
@@ -142,5 +130,5 @@ requirements: []
142
130
  rubygems_version: 3.5.3
143
131
  signing_key:
144
132
  specification_version: 4
145
- summary: The kick-ass pagination ruby gem
133
+ summary: The best pagination ruby gem
146
134
  test_files: []
@@ -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')