pagy 5.7.5 → 8.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/apps/calendar.ru +745 -0
  4. data/apps/demo.ru +435 -0
  5. data/apps/rails.ru +213 -0
  6. data/apps/repro.ru +177 -0
  7. data/apps/tmp/calendar.sqlite3 +0 -0
  8. data/apps/tmp/calendar.sqlite3-shm +0 -0
  9. data/apps/tmp/calendar.sqlite3-wal +0 -0
  10. data/apps/tmp/local_secret.txt +1 -0
  11. data/bin/pagy +100 -0
  12. data/{lib/config → config}/pagy.rb +72 -96
  13. data/javascripts/pagy-module.js +100 -0
  14. data/javascripts/pagy.d.ts +5 -0
  15. data/javascripts/pagy.js +4 -0
  16. data/javascripts/pagy.min.js +4 -0
  17. data/javascripts/pagy.min.js.map +10 -0
  18. data/javascripts/pagy.mjs +100 -0
  19. data/lib/optimist.rb +1022 -0
  20. data/lib/pagy/backend.rb +16 -4
  21. data/lib/pagy/calendar/day.rb +22 -10
  22. data/lib/pagy/calendar/month.rb +35 -9
  23. data/lib/pagy/calendar/quarter.rb +36 -10
  24. data/lib/pagy/calendar/unit.rb +106 -0
  25. data/lib/pagy/calendar/week.rb +16 -16
  26. data/lib/pagy/calendar/year.rb +15 -9
  27. data/lib/pagy/calendar.rb +60 -68
  28. data/lib/pagy/console.rb +3 -3
  29. data/lib/pagy/countless.rb +17 -12
  30. data/lib/pagy/exceptions.rb +1 -1
  31. data/lib/pagy/extras/arel.rb +2 -2
  32. data/lib/pagy/extras/array.rb +2 -2
  33. data/lib/pagy/extras/bootstrap.rb +57 -53
  34. data/lib/pagy/extras/bulma.rb +53 -57
  35. data/lib/pagy/extras/calendar.rb +54 -37
  36. data/lib/pagy/extras/countless.rb +3 -3
  37. data/lib/pagy/extras/elasticsearch_rails.rb +12 -11
  38. data/lib/pagy/extras/foundation.rb +59 -54
  39. data/lib/pagy/extras/gearbox.rb +32 -19
  40. data/lib/pagy/extras/headers.rb +11 -11
  41. data/lib/pagy/extras/i18n.rb +5 -5
  42. data/lib/pagy/extras/items.rb +34 -24
  43. data/lib/pagy/extras/{frontend_helpers.rb → js_tools.rb} +24 -24
  44. data/lib/pagy/extras/jsonapi.rb +79 -0
  45. data/lib/pagy/extras/materialize.rb +63 -47
  46. data/lib/pagy/extras/meilisearch.rb +26 -22
  47. data/lib/pagy/extras/metadata.rb +13 -9
  48. data/lib/pagy/extras/overflow.rb +13 -10
  49. data/lib/pagy/extras/pagy.rb +82 -0
  50. data/lib/pagy/extras/searchkick.rb +12 -11
  51. data/lib/pagy/extras/semantic.rb +57 -45
  52. data/lib/pagy/extras/size.rb +40 -0
  53. data/lib/pagy/extras/standalone.rb +12 -16
  54. data/lib/pagy/extras/trim.rb +13 -13
  55. data/lib/pagy/extras/uikit.rb +60 -46
  56. data/lib/pagy/frontend.rb +62 -45
  57. data/lib/pagy/i18n.rb +4 -3
  58. data/lib/pagy/url_helpers.rb +13 -25
  59. data/lib/pagy.rb +61 -59
  60. data/locales/ar.yml +28 -0
  61. data/locales/be.yml +25 -0
  62. data/locales/bg.yml +21 -0
  63. data/locales/bs.yml +25 -0
  64. data/locales/ca.yml +21 -0
  65. data/locales/ckb.yml +18 -0
  66. data/locales/cs.yml +23 -0
  67. data/locales/da.yml +21 -0
  68. data/locales/de.yml +21 -0
  69. data/locales/en.yml +21 -0
  70. data/locales/es.yml +21 -0
  71. data/locales/fr.yml +21 -0
  72. data/locales/hr.yml +25 -0
  73. data/locales/id.yml +19 -0
  74. data/locales/it.yml +21 -0
  75. data/locales/ja.yml +19 -0
  76. data/locales/km.yml +19 -0
  77. data/locales/ko.yml +17 -0
  78. data/locales/nb.yml +21 -0
  79. data/locales/nl.yml +21 -0
  80. data/locales/nn.yml +21 -0
  81. data/locales/pl.yml +25 -0
  82. data/locales/pt-BR.yml +21 -0
  83. data/locales/pt.yml +21 -0
  84. data/locales/ru.yml +25 -0
  85. data/locales/sr.yml +25 -0
  86. data/locales/sv-SE.yml +21 -0
  87. data/locales/sv.yml +21 -0
  88. data/locales/sw.yml +23 -0
  89. data/locales/ta.yml +23 -0
  90. data/locales/tr.yml +19 -0
  91. data/locales/uk.yml +25 -0
  92. data/locales/vi.yml +17 -0
  93. data/locales/zh-CN.yml +19 -0
  94. data/locales/zh-HK.yml +19 -0
  95. data/locales/zh-TW.yml +19 -0
  96. data/stylesheets/pagy.css +46 -0
  97. data/stylesheets/pagy.scss +48 -0
  98. data/stylesheets/pagy.tailwind.css +21 -0
  99. metadata +79 -66
  100. data/lib/javascripts/pagy-dev.js +0 -118
  101. data/lib/javascripts/pagy-module.d.ts +0 -30
  102. data/lib/javascripts/pagy-module.js +0 -117
  103. data/lib/javascripts/pagy.js +0 -1
  104. data/lib/locales/ar.yml +0 -26
  105. data/lib/locales/bg.yml +0 -22
  106. data/lib/locales/bs.yml +0 -24
  107. data/lib/locales/ca.yml +0 -22
  108. data/lib/locales/cs.yml +0 -22
  109. data/lib/locales/da.yml +0 -22
  110. data/lib/locales/de.yml +0 -22
  111. data/lib/locales/en.yml +0 -22
  112. data/lib/locales/es.yml +0 -22
  113. data/lib/locales/fr.yml +0 -22
  114. data/lib/locales/hr.yml +0 -24
  115. data/lib/locales/id.yml +0 -20
  116. data/lib/locales/it.yml +0 -22
  117. data/lib/locales/ja.yml +0 -20
  118. data/lib/locales/km.yml +0 -19
  119. data/lib/locales/ko.yml +0 -20
  120. data/lib/locales/nb.yml +0 -22
  121. data/lib/locales/nl.yml +0 -22
  122. data/lib/locales/pl.yml +0 -24
  123. data/lib/locales/pt-BR.yml +0 -22
  124. data/lib/locales/pt.yml +0 -22
  125. data/lib/locales/ru.yml +0 -24
  126. data/lib/locales/sr.yml +0 -23
  127. data/lib/locales/sv-SE.yml +0 -23
  128. data/lib/locales/sv.yml +0 -23
  129. data/lib/locales/sw.yml +0 -22
  130. data/lib/locales/ta.yml +0 -22
  131. data/lib/locales/tr.yml +0 -20
  132. data/lib/locales/uk.yml +0 -24
  133. data/lib/locales/zh-CN.yml +0 -20
  134. data/lib/locales/zh-HK.yml +0 -20
  135. data/lib/locales/zh-TW.yml +0 -20
  136. data/lib/pagy/calendar/month_mixin.rb +0 -49
  137. data/lib/pagy/extras/navs.rb +0 -63
  138. data/lib/pagy/extras/support.rb +0 -54
  139. data/lib/templates/bootstrap_nav.html.erb +0 -24
  140. data/lib/templates/bootstrap_nav.html.haml +0 -34
  141. data/lib/templates/bootstrap_nav.html.slim +0 -34
  142. data/lib/templates/bulma_nav.html.erb +0 -24
  143. data/lib/templates/bulma_nav.html.haml +0 -32
  144. data/lib/templates/bulma_nav.html.slim +0 -32
  145. data/lib/templates/foundation_nav.html.erb +0 -24
  146. data/lib/templates/foundation_nav.html.haml +0 -34
  147. data/lib/templates/foundation_nav.html.slim +0 -34
  148. data/lib/templates/nav.html.erb +0 -22
  149. data/lib/templates/nav.html.haml +0 -30
  150. data/lib/templates/nav.html.slim +0 -29
  151. data/lib/templates/uikit_nav.html.erb +0 -15
  152. data/lib/templates/uikit_nav.html.haml +0 -28
  153. data/lib/templates/uikit_nav.html.slim +0 -28
@@ -1,49 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Pagy
4
- class Calendar
5
- # Mixin for month based unit periods
6
- # It is used for month and quarter, but you could use it to implement less common unit of 6, 4, 2 months
7
- # (see the https://ddnexus.github.io/pagy/api/calendar#custom-units sections for details).
8
- # The including class must set the MONTHS duration for the unit and the usual DEFAULT.
9
- module MonthMixin
10
- protected
11
-
12
- # Setup the calendar variables
13
- def setup_unit_vars
14
- super
15
- @months = self.class::MONTHS # number of months in the unit
16
- @initial = unit_starting_time_for(@starting)
17
- @final = add_months_to(unit_starting_time_for(@ending), @months)
18
- @pages = @last = (months_in(@final) - months_in(@initial)) / @months
19
- @from = starting_time_for(@page)
20
- @to = add_months_to(@from, @months)
21
- end
22
-
23
- # Starting time for the page
24
- def starting_time_for(page)
25
- add_months_to(@initial, offset_units_for(page) * @months)
26
- end
27
-
28
- private
29
-
30
- # Unit starting time for time
31
- def unit_starting_time_for(time)
32
- # remove 1 month for 0-11 calculations and add it back for 1-12 conversion
33
- starting_month = (@months * ((time.month - 1) / @months)) + 1
34
- new_time(time.year, starting_month)
35
- end
36
-
37
- # Number of months in time
38
- def months_in(time)
39
- (time.year * 12) + time.month
40
- end
41
-
42
- # Add months to time
43
- def add_months_to(time, months)
44
- months += months_in(time) - 1 # remove 1 month for 0-11 calculations
45
- new_time(months / 12, (months % 12) + 1) # add 1 month back for 1-12 conversion
46
- end
47
- end
48
- end
49
- end
@@ -1,63 +0,0 @@
1
- # See the Pagy documentation: https://ddnexus.github.io/pagy/extras/navs
2
- # frozen_string_literal: true
3
-
4
- require 'pagy/extras/frontend_helpers'
5
-
6
- class Pagy # :nodoc:
7
- # Frontend modules are specially optimized for performance.
8
- # The resulting code may not look very elegant, but produces the best benchmarks
9
- module NavsExtra
10
- # Javascript pagination: it returns a nav and a JSON tag used by the pagy.js file
11
- def pagy_nav_js(pagy, pagy_id: nil, link_extra: '', **vars)
12
- sequels = pagy.sequels(**vars)
13
- p_id = %( id="#{pagy_id}") if pagy_id
14
- link = pagy_link_proc(pagy, link_extra: link_extra)
15
- tags = { 'before' => pagy_nav_prev_html(pagy, link),
16
- 'link' => %(<span class="page">#{link.call(PAGE_PLACEHOLDER, LABEL_PLACEHOLDER)}</span> ),
17
- 'active' => %(<span class="page active">#{LABEL_PLACEHOLDER}</span> ),
18
- 'gap' => %(<span class="page gap">#{pagy_t 'pagy.nav.gap'}</span> ),
19
- 'after' => pagy_nav_next_html(pagy, link) }
20
-
21
- %(<nav#{p_id} class="#{'pagy-rjs ' if sequels.size > 1}pagy-nav-js pagination" aria-label="pager" #{
22
- pagy_json_attr(pagy, :nav, tags, sequels, pagy.label_sequels(sequels))}></nav>)
23
- end
24
-
25
- # Javascript combo pagination: it returns a nav and a JSON tag used by the pagy.js file
26
- def pagy_combo_nav_js(pagy, pagy_id: nil, link_extra: '')
27
- p_id = %( id="#{pagy_id}") if pagy_id
28
- link = pagy_link_proc(pagy, link_extra: link_extra)
29
- p_page = pagy.page
30
- p_pages = pagy.pages
31
- input = %(<input type="number" min="1" max="#{p_pages}" value="#{
32
- p_page}" style="padding: 0; text-align: center; width: #{p_pages.to_s.length + 1}rem;">)
33
-
34
- %(<nav#{p_id} class="pagy-combo-nav-js pagination" aria-label="pager" #{
35
- pagy_json_attr pagy, :combo, pagy_marked_link(link)}>#{
36
- pagy_nav_prev_html pagy, link
37
- }<span class="pagy-combo-input" style="margin: 0 0.6rem;">#{
38
- pagy_t 'pagy.combo_nav_js', page_input: input, count: p_page, pages: p_pages
39
- }</span> #{
40
- pagy_nav_next_html pagy, link
41
- }</nav>)
42
- end
43
-
44
- private
45
-
46
- def pagy_nav_prev_html(pagy, link)
47
- if (p_prev = pagy.prev)
48
- %(<span class="page prev">#{link.call p_prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"'}</span> )
49
- else
50
- %(<span class="page prev disabled">#{pagy_t 'pagy.nav.prev'}</span> )
51
- end
52
- end
53
-
54
- def pagy_nav_next_html(pagy, link)
55
- if (p_next = pagy.next)
56
- %(<span class="page next">#{link.call p_next, pagy_t('pagy.nav.next'), 'aria-label="next"'}</span>)
57
- else
58
- %(<span class="page next disabled">#{pagy_t 'pagy.nav.next'}</span>)
59
- end
60
- end
61
- end
62
- Frontend.prepend NavsExtra
63
- end
@@ -1,54 +0,0 @@
1
- # See the Pagy documentation: https://ddnexus.github.io/pagy/extras/support
2
- # frozen_string_literal: true
3
-
4
- class Pagy # :nodoc:
5
- # Extra support for features like: incremental, auto-incremental and infinite pagination
6
- module SupportExtra
7
- # Return the previous page URL string or nil
8
- def pagy_prev_url(pagy)
9
- pagy_url_for(pagy, pagy.prev) if pagy.prev
10
- end
11
-
12
- # Return the next page URL string or nil
13
- def pagy_next_url(pagy)
14
- pagy_url_for(pagy, pagy.next) if pagy.next
15
- end
16
-
17
- # Return the HTML string for the previous page link
18
- def pagy_prev_link(pagy, text: pagy_t('pagy.nav.prev'), link_extra: '')
19
- if pagy.prev
20
- %(<span class="page prev"><a href="#{
21
- pagy_url_for(pagy, pagy.prev)
22
- }" rel="prev" aria-label="previous" #{
23
- pagy.vars[:link_extra]
24
- } #{link_extra}>#{text}</a></span>)
25
- else
26
- %(<span class="page prev disabled">#{text}</span>)
27
- end
28
- end
29
-
30
- # Return the HTML string for the next page link
31
- def pagy_next_link(pagy, text: pagy_t('pagy.nav.next'), link_extra: '')
32
- if pagy.next
33
- %(<span class="page next"><a href="#{
34
- pagy_url_for(pagy, pagy.next)
35
- }" rel="next" aria-label="next" #{
36
- pagy.vars[:link_extra]
37
- } #{link_extra}>#{text}</a></span>)
38
- else
39
- %(<span class="page next disabled">#{text}</span>)
40
- end
41
- end
42
-
43
- # Return the HTML link tag for the previous page or nil
44
- def pagy_prev_link_tag(pagy)
45
- %(<link href="#{pagy_url_for(pagy, pagy.prev)}" rel="prev"/>) if pagy.prev
46
- end
47
-
48
- # Return the HTML link tag for the next page or nil
49
- def pagy_next_link_tag(pagy)
50
- %(<link href="#{pagy_url_for(pagy, pagy.next)}" rel="next"/>) if pagy.next
51
- end
52
- end
53
- Frontend.prepend SupportExtra
54
- end
@@ -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 aria-label="pager" 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{"aria-label" => "pager", :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" aria-label="pager"
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 aria-label="pager" 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{"aria-label" => "pager", :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" aria-label="pager"
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')