pagy 6.5.0 → 7.0.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/lib/config/pagy.rb +18 -16
- data/lib/javascripts/pagy-dev.js +3 -3
- data/lib/javascripts/pagy-module.js +2 -2
- data/lib/javascripts/pagy.js +1 -1
- data/lib/locales/ar.yml +14 -10
- data/lib/locales/be.yml +11 -10
- data/lib/locales/bg.yml +9 -10
- data/lib/locales/bs.yml +11 -10
- data/lib/locales/ca.yml +11 -10
- data/lib/locales/cs.yml +12 -9
- data/lib/locales/da.yml +11 -10
- data/lib/locales/de.yml +9 -10
- data/lib/locales/en.yml +9 -10
- data/lib/locales/es.yml +9 -10
- data/lib/locales/fr.yml +9 -10
- data/lib/locales/hr.yml +11 -10
- data/lib/locales/id.yml +9 -10
- data/lib/locales/it.yml +9 -10
- data/lib/locales/ja.yml +9 -10
- data/lib/locales/km.yml +9 -9
- data/lib/locales/ko.yml +9 -10
- data/lib/locales/nb.yml +9 -10
- data/lib/locales/nl.yml +9 -10
- data/lib/locales/nn.yml +9 -10
- data/lib/locales/pl.yml +11 -10
- data/lib/locales/pt-BR.yml +9 -10
- data/lib/locales/pt.yml +9 -10
- data/lib/locales/ru.yml +13 -10
- data/lib/locales/sr.yml +11 -9
- data/lib/locales/sv-SE.yml +10 -12
- data/lib/locales/sv.yml +10 -12
- data/lib/locales/sw.yml +11 -10
- data/lib/locales/ta.yml +11 -10
- data/lib/locales/tr.yml +9 -10
- data/lib/locales/uk.yml +11 -10
- data/lib/locales/vi.yml +7 -10
- data/lib/locales/zh-CN.yml +9 -10
- data/lib/locales/zh-HK.yml +9 -10
- data/lib/locales/zh-TW.yml +9 -10
- data/lib/pagy/backend.rb +2 -2
- data/lib/pagy/calendar/day.rb +3 -2
- data/lib/pagy/calendar/helper.rb +3 -7
- data/lib/pagy/calendar/month.rb +3 -2
- data/lib/pagy/calendar/quarter.rb +3 -2
- data/lib/pagy/calendar/year.rb +2 -1
- data/lib/pagy/extras/bootstrap.rb +42 -29
- data/lib/pagy/extras/bulma.rb +40 -31
- data/lib/pagy/extras/calendar.rb +7 -8
- data/lib/pagy/extras/elasticsearch_rails.rb +6 -6
- data/lib/pagy/extras/foundation.rb +44 -31
- data/lib/pagy/extras/frontend_helpers.rb +7 -7
- data/lib/pagy/extras/headers.rb +7 -7
- data/lib/pagy/extras/i18n.rb +4 -4
- data/lib/pagy/extras/items.rb +10 -9
- data/lib/pagy/extras/jsonapi.rb +2 -7
- data/lib/pagy/extras/materialize.rb +41 -29
- data/lib/pagy/extras/meilisearch.rb +7 -7
- data/lib/pagy/extras/metadata.rb +1 -1
- data/lib/pagy/extras/navs.rb +21 -33
- data/lib/pagy/extras/overflow.rb +7 -5
- data/lib/pagy/extras/searchkick.rb +6 -6
- data/lib/pagy/extras/semantic.rb +40 -27
- data/lib/pagy/extras/standalone.rb +4 -7
- data/lib/pagy/extras/support.rb +18 -32
- data/lib/pagy/extras/trim.rb +2 -2
- data/lib/pagy/extras/uikit.rb +43 -30
- data/lib/pagy/frontend.rb +56 -25
- data/lib/pagy/i18n.rb +0 -3
- data/lib/pagy/url_helpers.rb +1 -2
- data/lib/pagy.rb +16 -14
- metadata +6 -22
- data/lib/locales/ckb.yml +0 -20
- 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
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:
|
4
|
+
version: 7.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Domizio Demichelis
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
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:
|
@@ -28,7 +28,6 @@ files:
|
|
28
28
|
- lib/locales/bg.yml
|
29
29
|
- lib/locales/bs.yml
|
30
30
|
- lib/locales/ca.yml
|
31
|
-
- lib/locales/ckb.yml
|
32
31
|
- lib/locales/cs.yml
|
33
32
|
- lib/locales/da.yml
|
34
33
|
- lib/locales/de.yml
|
@@ -99,21 +98,6 @@ files:
|
|
99
98
|
- lib/pagy/frontend.rb
|
100
99
|
- lib/pagy/i18n.rb
|
101
100
|
- 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
|
117
101
|
homepage: https://github.com/ddnexus/pagy
|
118
102
|
licenses:
|
119
103
|
- MIT
|
@@ -124,7 +108,7 @@ metadata:
|
|
124
108
|
bug_tracker_uri: https://github.com/ddnexus/pagy/issues
|
125
109
|
changelog_uri: https://github.com/ddnexus/pagy/blob/master/CHANGELOG.md
|
126
110
|
support: https://github.com/ddnexus/pagy/discussions/categories/q-a
|
127
|
-
post_install_message:
|
111
|
+
post_install_message:
|
128
112
|
rdoc_options: []
|
129
113
|
require_paths:
|
130
114
|
- lib
|
@@ -132,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
132
116
|
requirements:
|
133
117
|
- - ">="
|
134
118
|
- !ruby/object:Gem::Version
|
135
|
-
version: '
|
119
|
+
version: '3.1'
|
136
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
121
|
requirements:
|
138
122
|
- - ">="
|
@@ -140,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
124
|
version: '0'
|
141
125
|
requirements: []
|
142
126
|
rubygems_version: 3.5.3
|
143
|
-
signing_key:
|
127
|
+
signing_key:
|
144
128
|
specification_version: 4
|
145
129
|
summary: The kick-ass pagination ruby gem
|
146
130
|
test_files: []
|
data/lib/locales/ckb.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# :other pluralization (see https://github.com/ddnexus/pagy/blob/master/lib/pagy/i18n.rb)
|
2
|
-
|
3
|
-
ckb:
|
4
|
-
pagy:
|
5
|
-
|
6
|
-
item_name: "بابەت"
|
7
|
-
|
8
|
-
nav:
|
9
|
-
prev: "‹ پاش"
|
10
|
-
next: "پێش ›"
|
11
|
-
gap: "…"
|
12
|
-
|
13
|
-
info:
|
14
|
-
no_items: "هیچ %{item_name}ێک نەدۆزرایەوە"
|
15
|
-
single_page: "پیشاندانی <b>%{count}</b> %{item_name}"
|
16
|
-
multiple_pages: "پشاندانی %{item_name}ی <b>%{from}-%{to}</b> لە کۆی <b>%{count}</b> بە گشتی"
|
17
|
-
|
18
|
-
combo_nav_js: "<label>پەڕی %{page_input} لە %{pages}</label>"
|
19
|
-
|
20
|
-
items_selector_js: "<label>نیشاندانی %{items_input} %{item_name} لە هەر پەڕێک</label>"
|
@@ -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, 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 ("‹ 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, 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 ("‹ 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, 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 ("‹ 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"><%= 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 ("‹ 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
|
-
= 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 ("‹ 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
|
-
= 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')
|
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 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{: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"
|
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')
|