pagy 3.8.2 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/apps/calendar.ru +737 -0
- data/apps/demo.ru +449 -0
- data/apps/index.rb +7 -0
- data/apps/keyset_ar.ru +228 -0
- data/apps/keyset_s.ru +220 -0
- data/apps/rails.ru +217 -0
- data/apps/repro.ru +182 -0
- data/bin/pagy +98 -0
- data/config/pagy.rb +220 -0
- data/javascripts/pagy.d.ts +5 -0
- data/javascripts/pagy.min.js +4 -0
- data/javascripts/pagy.min.js.map +10 -0
- data/javascripts/pagy.mjs +100 -0
- data/lib/optimist.rb +1022 -0
- data/lib/pagy/b64.rb +33 -0
- data/lib/pagy/backend.rb +30 -19
- data/lib/pagy/calendar/day.rb +41 -0
- data/lib/pagy/calendar/month.rb +42 -0
- data/lib/pagy/calendar/quarter.rb +49 -0
- data/lib/pagy/calendar/unit.rb +103 -0
- data/lib/pagy/calendar/week.rb +39 -0
- data/lib/pagy/calendar/year.rb +35 -0
- data/lib/pagy/calendar.rb +84 -0
- data/lib/pagy/console.rb +23 -0
- data/lib/pagy/countless.rb +27 -22
- data/lib/pagy/exceptions.rb +16 -13
- data/lib/pagy/extras/arel.rb +11 -14
- data/lib/pagy/extras/array.rb +12 -16
- data/lib/pagy/extras/bootstrap.rb +83 -41
- data/lib/pagy/extras/bulma.rb +79 -46
- data/lib/pagy/extras/calendar.rb +79 -0
- data/lib/pagy/extras/countless.rb +20 -25
- data/lib/pagy/extras/elasticsearch_rails.rb +59 -38
- data/lib/pagy/extras/gearbox.rb +55 -0
- data/lib/pagy/extras/headers.rb +38 -23
- data/lib/pagy/extras/i18n.rb +19 -18
- data/lib/pagy/extras/js_tools.rb +70 -0
- data/lib/pagy/extras/jsonapi.rb +88 -0
- data/lib/pagy/extras/keyset.rb +30 -0
- data/lib/pagy/extras/limit.rb +63 -0
- data/lib/pagy/extras/meilisearch.rb +57 -0
- data/lib/pagy/extras/metadata.rb +32 -27
- data/lib/pagy/extras/overflow.rb +61 -53
- data/lib/pagy/extras/pagy.rb +82 -0
- data/lib/pagy/extras/searchkick.rb +52 -41
- data/lib/pagy/extras/size.rb +40 -0
- data/lib/pagy/extras/standalone.rb +60 -0
- data/lib/pagy/extras/trim.rb +19 -13
- data/lib/pagy/frontend.rb +76 -51
- data/lib/pagy/i18n.rb +167 -0
- data/lib/pagy/keyset/active_record.rb +44 -0
- data/lib/pagy/keyset/sequel.rb +57 -0
- data/lib/pagy/keyset.rb +118 -0
- data/lib/pagy/shared_methods.rb +26 -0
- data/lib/pagy/url_helpers.rb +26 -0
- data/lib/pagy.rb +91 -37
- data/locales/ar.yml +29 -0
- data/locales/be.yml +25 -0
- data/locales/bg.yml +21 -0
- data/locales/bs.yml +25 -0
- data/locales/ca.yml +21 -0
- data/locales/ckb.yml +18 -0
- data/locales/cs.yml +23 -0
- data/locales/da.yml +21 -0
- data/locales/de.yml +21 -0
- data/locales/dz.yml +17 -0
- data/locales/en.yml +21 -0
- data/{lib/locales → locales}/es.yml +11 -12
- data/locales/fr.yml +21 -0
- data/locales/hr.yml +25 -0
- data/locales/id.yml +19 -0
- data/locales/it.yml +21 -0
- data/locales/ja.yml +19 -0
- data/locales/km.yml +19 -0
- data/locales/ko.yml +17 -0
- data/locales/nb.yml +21 -0
- data/locales/nl.yml +21 -0
- data/locales/nn.yml +21 -0
- data/locales/pl.yml +25 -0
- data/{lib/locales → locales}/pt-BR.yml +11 -12
- data/locales/pt.yml +21 -0
- data/locales/ru.yml +25 -0
- data/locales/sk.yml +23 -0
- data/locales/sr.yml +25 -0
- data/locales/sv-SE.yml +21 -0
- data/locales/sv.yml +21 -0
- data/locales/sw.yml +25 -0
- data/locales/ta.yml +21 -0
- data/locales/tr.yml +19 -0
- data/locales/uk.yml +25 -0
- data/locales/vi.yml +17 -0
- data/locales/zh-CN.yml +17 -0
- data/locales/zh-HK.yml +17 -0
- data/locales/zh-TW.yml +17 -0
- data/stylesheets/pagy.css +46 -0
- data/stylesheets/pagy.scss +48 -0
- data/stylesheets/pagy.tailwind.css +21 -0
- metadata +95 -67
- data/lib/config/pagy.rb +0 -170
- data/lib/javascripts/pagy.js +0 -106
- data/lib/locales/README.md +0 -35
- data/lib/locales/bg.yml +0 -22
- data/lib/locales/ca.yml +0 -22
- data/lib/locales/da.yml +0 -22
- data/lib/locales/de.yml +0 -22
- data/lib/locales/en.yml +0 -22
- data/lib/locales/fr.yml +0 -22
- data/lib/locales/id.yml +0 -20
- data/lib/locales/it.yml +0 -22
- data/lib/locales/ja.yml +0 -20
- data/lib/locales/km.yml +0 -19
- data/lib/locales/ko.yml +0 -20
- data/lib/locales/nb.yml +0 -22
- data/lib/locales/nl.yml +0 -22
- data/lib/locales/pl.yml +0 -24
- data/lib/locales/ru.yml +0 -24
- data/lib/locales/sv-SE.yml +0 -23
- data/lib/locales/sv.yml +0 -23
- data/lib/locales/tr.yml +0 -20
- data/lib/locales/utils/i18n.rb +0 -25
- data/lib/locales/utils/loader.rb +0 -34
- data/lib/locales/utils/p11n.rb +0 -80
- data/lib/locales/zh-CN.yml +0 -20
- data/lib/locales/zh-HK.yml +0 -20
- data/lib/locales/zh-TW.yml +0 -20
- data/lib/pagy/extras/foundation.rb +0 -57
- data/lib/pagy/extras/items.rb +0 -65
- data/lib/pagy/extras/materialize.rb +0 -59
- data/lib/pagy/extras/navs.rb +0 -38
- data/lib/pagy/extras/pagy_search.rb +0 -18
- data/lib/pagy/extras/semantic.rb +0 -55
- data/lib/pagy/extras/shared.rb +0 -53
- data/lib/pagy/extras/support.rb +0 -29
- data/lib/pagy/extras/uikit.rb +0 -62
- data/lib/templates/bootstrap_nav.html.erb +0 -24
- data/lib/templates/bootstrap_nav.html.haml +0 -34
- data/lib/templates/bootstrap_nav.html.slim +0 -34
- data/lib/templates/bulma_nav.html.erb +0 -24
- data/lib/templates/bulma_nav.html.haml +0 -32
- data/lib/templates/bulma_nav.html.slim +0 -32
- data/lib/templates/foundation_nav.html.erb +0 -24
- data/lib/templates/foundation_nav.html.haml +0 -34
- data/lib/templates/foundation_nav.html.slim +0 -34
- data/lib/templates/nav.html.erb +0 -22
- data/lib/templates/nav.html.haml +0 -30
- data/lib/templates/nav.html.slim +0 -29
- data/lib/templates/uikit_nav.html.erb +0 -15
- data/lib/templates/uikit_nav.html.haml +0 -28
- data/lib/templates/uikit_nav.html.slim +0 -28
- data/pagy.gemspec +0 -16
@@ -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 ("‹ Prev", "Next ›", "…").
|
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, '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 ("‹ Prev", "Next ›", "…").
|
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, '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 ("‹ Prev", "Next ›", "…").
|
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 ("‹ Prev", "Next ›", "…").
|
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 ("‹ Prev", "Next ›", "…").
|
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 ("‹ Prev", "Next ›", "…").
|
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"><%= 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 ("‹ Prev", "Next ›", "…").
|
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
|
-
= 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 ("‹ Prev", "Next ›", "…").
|
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
|
-
= 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')
|
data/lib/templates/nav.html.erb
DELETED
@@ -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 ("‹ Prev", "Next ›", "…").
|
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>
|
data/lib/templates/nav.html.haml
DELETED
@@ -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 ("‹ Prev", "Next ›", "…").
|
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')
|
data/lib/templates/nav.html.slim
DELETED
@@ -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 ("‹ Prev", "Next ›", "…").
|
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><%== 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(p_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!= 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== 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')
|
data/pagy.gemspec
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
lib = File.expand_path('../lib', __FILE__)
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require 'pagy'
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = 'pagy'
|
7
|
-
s.version = Pagy::VERSION
|
8
|
-
s.authors = ['Domizio Demichelis']
|
9
|
-
s.email = ['dd.nexus@gmail.com']
|
10
|
-
s.summary = 'The Ultimate Pagination Ruby Gem'
|
11
|
-
s.description = 'Agnostic pagination in plain ruby: it works with any framework, ORM and DB type, with all kinds of collections, even pre-paginated, scopes, Arrays, JSON data... Easy, powerful, fast and light.'
|
12
|
-
s.homepage = 'https://github.com/ddnexus/pagy'
|
13
|
-
s.license = 'MIT'
|
14
|
-
s.files = `git ls-files -z`.split("\x0").select{|f| f.start_with?('lib', 'pagy.gemspec', 'LICENSE') }
|
15
|
-
s.required_ruby_version = '>= 1.9' # rubocop:disable Gemspec/RequiredRubyVersion
|
16
|
-
end
|