pagy 3.4.1 → 3.7.1
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/lib/config/pagy.rb +9 -1
- data/lib/javascripts/pagy.js +1 -1
- data/lib/locales/ca.yml +22 -0
- data/lib/locales/es.yml +1 -1
- data/lib/locales/fr.yml +2 -2
- data/lib/locales/it.yml +22 -0
- data/lib/locales/ko.yml +20 -0
- data/lib/locales/utils/p11n.rb +1 -0
- data/lib/pagy.rb +1 -1
- data/lib/pagy/extras/arel.rb +31 -0
- data/lib/pagy/extras/bootstrap.rb +1 -1
- data/lib/pagy/extras/bulma.rb +2 -2
- data/lib/pagy/extras/elasticsearch_rails.rb +4 -2
- data/lib/pagy/extras/foundation.rb +1 -1
- data/lib/pagy/extras/headers.rb +2 -2
- data/lib/pagy/extras/items.rb +3 -1
- data/lib/pagy/extras/materialize.rb +1 -1
- data/lib/pagy/extras/metadata.rb +37 -0
- data/lib/pagy/extras/navs.rb +1 -1
- data/lib/pagy/extras/semantic.rb +1 -1
- data/lib/pagy/extras/shared.rb +1 -1
- data/lib/pagy/extras/uikit.rb +2 -2
- data/lib/pagy/frontend.rb +4 -2
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bca8f924396671f0dfde589a69a4238032e555835255b6ca3250a831bf29ab9a
|
4
|
+
data.tar.gz: e07da6728acf08ff053807bbc3f9ab2e4617ad4ee0f9046b0208d40575df406f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05756ca7664d6d05e994c423404cb4e41d4be212b116188776b9ecc6fcf59ac51c25c46c02e1577473dbebe7de373e8d871c4fa321ba5b937eeac9d83a4b6936
|
7
|
+
data.tar.gz: 91308521be16051efcb2682d0fa4ae5a87adc497af77993c4674bc97d4371d5c2691c8b04452d7a94564a8b9fb2ed84b64deef7ef88c41b1a7a11ac4a6f6aa08
|
data/lib/config/pagy.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
# Pagy initializer file (3.
|
4
|
+
# Pagy initializer file (3.7.1)
|
5
5
|
# Customize only what you really need and notice that Pagy works also without any of the following lines.
|
6
6
|
# Should you just cherry pick part of this file, please maintain the require-order of the extras
|
7
7
|
|
@@ -89,6 +89,14 @@
|
|
89
89
|
# require 'pagy/extras/overflow'
|
90
90
|
# Pagy::VARS[:overflow] = :empty_page # default (other options: :last_page and :exception)
|
91
91
|
|
92
|
+
# Metadata extra: Provides the pagination metadata to Javascript frameworks like Vue.js, react.js, etc.
|
93
|
+
# See https://ddnexus.github.io/pagy/extras/metadata
|
94
|
+
# you must require the shared internal extra (BEFORE the metadata extra) ONLY if you need also the :sequels
|
95
|
+
# require 'pagy/extras/shared'
|
96
|
+
# require 'pagy/extras/metadata'
|
97
|
+
# For performance reason, you should explicitly set ONLY the metadata you use in the frontend
|
98
|
+
# Pagy::VARS[:metadata] = [:scaffold_url, :count, :page, :prev, :next, :last] # example
|
99
|
+
|
92
100
|
# Trim extra: Remove the page=1 param from links
|
93
101
|
# See https://ddnexus.github.io/pagy/extras/trim
|
94
102
|
# require 'pagy/extras/trim'
|
data/lib/javascripts/pagy.js
CHANGED
data/lib/locales/ca.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# :one_other pluralization (see https://github.com/ddnexus/pagy/blob/master/lib/locales/utils/p11n.rb)
|
2
|
+
|
3
|
+
ca:
|
4
|
+
pagy:
|
5
|
+
|
6
|
+
item_name:
|
7
|
+
one: "element"
|
8
|
+
other: "elements"
|
9
|
+
|
10
|
+
nav:
|
11
|
+
prev: "‹ Anterior"
|
12
|
+
next: "Següent ›"
|
13
|
+
gap: "…"
|
14
|
+
|
15
|
+
info:
|
16
|
+
no_items: "No s'ha trobat cap resultat"
|
17
|
+
single_page: "Mostrant <b>%{count}</b> %{item_name}"
|
18
|
+
multiple_pages: "Mostrant %{item_name} <b>%{from}-%{to}</b> de <b>%{count}</b> en total"
|
19
|
+
|
20
|
+
combo_nav_js: "Pàgina %{page_input} de %{pages}"
|
21
|
+
|
22
|
+
items_selector_js: "Mostra %{items_input} %{item_name} per pàgina"
|
data/lib/locales/es.yml
CHANGED
data/lib/locales/fr.yml
CHANGED
data/lib/locales/it.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# :one_other pluralization (see https://github.com/ddnexus/pagy/blob/master/lib/locales/utils/p11n.rb)
|
2
|
+
|
3
|
+
it:
|
4
|
+
pagy:
|
5
|
+
|
6
|
+
item_name:
|
7
|
+
one: "elemento"
|
8
|
+
other: "elementi"
|
9
|
+
|
10
|
+
nav:
|
11
|
+
prev: "‹ Precedente"
|
12
|
+
next: "Seguente ›"
|
13
|
+
gap: "…"
|
14
|
+
|
15
|
+
info:
|
16
|
+
no_items: "Nessun %{item_name} trovato"
|
17
|
+
single_page: "Visualizzazione di <b>%{count}</b> %{item_name}"
|
18
|
+
multiple_pages: "Visualizzazione %{item_name} <b>%{from}-%{to}</b> di <b>%{count}</b> in totale"
|
19
|
+
|
20
|
+
combo_nav_js: "Pagina %{page_input} di %{pages}"
|
21
|
+
|
22
|
+
items_selector_js: "Mostra %{items_input} %{item_name} per pagina"
|
data/lib/locales/ko.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# :other pluralization (see https://github.com/ddnexus/pagy/blob/master/lib/locales/utils/p11n.rb)
|
2
|
+
|
3
|
+
ko:
|
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: "총 <b>%{count}</b>개의 %{item_name} 중 <b>%{from}-%{to}</b>"
|
17
|
+
|
18
|
+
combo_nav_js: "총 %{pages} 중 %{page_input} 페이지"
|
19
|
+
|
20
|
+
items_selector_js: "페이지 당 %{items_input}개 표시%"
|
data/lib/locales/utils/p11n.rb
CHANGED
@@ -63,6 +63,7 @@ plurals = Hash.new(p11n[:one_other]).tap do |hash|
|
|
63
63
|
hash['id'] = p11n[:other]
|
64
64
|
hash['fr'] = p11n[:one_upto_two_other]
|
65
65
|
hash['ja'] = p11n[:other]
|
66
|
+
hash['ko'] = p11n[:other]
|
66
67
|
hash['pl'] = p11n[:polish]
|
67
68
|
hash['ru'] = p11n[:east_slavic]
|
68
69
|
hash['se'] = p11n[:one_two_other]
|
data/lib/pagy.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
# See the Pagy documentation: https://ddnexus.github.io/pagy/extras/arel
|
2
|
+
# encoding: utf-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
class Pagy
|
6
|
+
module Backend ; private
|
7
|
+
|
8
|
+
def pagy_arel(collection, vars={})
|
9
|
+
pagy = Pagy.new(pagy_arel_get_vars(collection, vars))
|
10
|
+
return pagy, pagy_get_items(collection, pagy)
|
11
|
+
end
|
12
|
+
|
13
|
+
def pagy_arel_get_vars(collection, vars)
|
14
|
+
vars[:count] ||= pagy_arel_count(collection)
|
15
|
+
vars[:page] ||= params[ vars[:page_param] || VARS[:page_param] ]
|
16
|
+
vars
|
17
|
+
end
|
18
|
+
|
19
|
+
def pagy_arel_count(collection)
|
20
|
+
if collection.group_values.empty?
|
21
|
+
# COUNT(*)
|
22
|
+
collection.count(:all)
|
23
|
+
else
|
24
|
+
# COUNT(*) OVER ()
|
25
|
+
sql = Arel.star.count.over(Arel::Nodes::Grouping.new([]))
|
26
|
+
collection.unscope(:order).limit(1).pluck(sql).first.to_i
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
@@ -29,7 +29,7 @@ class Pagy
|
|
29
29
|
link, p_prev, p_next = pagy_link_proc(pagy, 'class="page-link"'), pagy.prev, pagy.next
|
30
30
|
tags = { 'before' => p_prev ? %(<ul class="pagination"><li class="page-item prev">#{link.call p_prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"'}</li>)
|
31
31
|
: %(<ul class="pagination"><li class="page-item prev disabled"><a href="#" class="page-link">#{pagy_t('pagy.nav.prev')}</a></li>),
|
32
|
-
'link' => %(<li class="page-item">#{mark = link.call(
|
32
|
+
'link' => %(<li class="page-item">#{mark = link.call(PAGE_PLACEHOLDER)}</li>),
|
33
33
|
'active' => %(<li class="page-item active">#{mark}</li>),
|
34
34
|
'gap' => %(<li class="page-item gap disabled"><a href="#" class="page-link">#{pagy_t('pagy.nav.gap')}</a></li>),
|
35
35
|
'after' => p_next ? %(<li class="page-item next">#{link.call p_next, pagy_t('pagy.nav.next'), 'aria-label="next"'}</li></ul>)
|
data/lib/pagy/extras/bulma.rb
CHANGED
@@ -34,8 +34,8 @@ class Pagy
|
|
34
34
|
+ (p_next ? link.call(p_next, pagy_t('pagy.nav.next'), 'class="pagination-next" aria-label="next page"')
|
35
35
|
: %(<a class="pagination-next" disabled>#{pagy_t('pagy.nav.next')}</a>)) \
|
36
36
|
+ '<ul class="pagination-list">' ),
|
37
|
-
'link' => %(<li>#{link.call(
|
38
|
-
'active' => %(<li>#{link.call(
|
37
|
+
'link' => %(<li>#{link.call(PAGE_PLACEHOLDER, PAGE_PLACEHOLDER, %(class="pagination-link" aria-label="goto page #{PAGE_PLACEHOLDER}"))}</li>),
|
38
|
+
'active' => %(<li>#{link.call(PAGE_PLACEHOLDER, PAGE_PLACEHOLDER, %(class="pagination-link is-current" aria-current="page" aria-label="page #{PAGE_PLACEHOLDER}"))}</li>),
|
39
39
|
'gap' => %(<li><span class="pagination-ellipsis">#{pagy_t('pagy.nav.gap')}</span></li>),
|
40
40
|
'after' => '</ul>' }
|
41
41
|
%(<nav id="#{id}" class="pagy-bulma-nav-js pagination is-centered" role="navigation" aria-label="pagination"></nav>#{pagy_json_tag(:nav, id, tags, pagy.sequels, defined?(TRIM) && pagy.vars[:page_param])})
|
@@ -13,7 +13,8 @@ class Pagy
|
|
13
13
|
def self.new_from_elasticsearch_rails(response, vars={})
|
14
14
|
vars[:items] = response.search.options[:size] || 10
|
15
15
|
vars[:page] = (response.search.options[:from] || 0) / vars[:items] + 1
|
16
|
-
|
16
|
+
total = response.raw_response['hits']['total']
|
17
|
+
vars[:count] = total.is_a?(Hash) ? total['value'] : total
|
17
18
|
new(vars)
|
18
19
|
end
|
19
20
|
|
@@ -27,7 +28,8 @@ class Pagy
|
|
27
28
|
search_args[-1][:size] = vars[:items]
|
28
29
|
search_args[-1][:from] = vars[:items] * (vars[:page] - 1)
|
29
30
|
response = model.search(*search_args)
|
30
|
-
|
31
|
+
total = response.raw_response['hits']['total']
|
32
|
+
vars[:count] = total.is_a?(Hash) ? total['value'] : total
|
31
33
|
pagy = Pagy.new(vars)
|
32
34
|
# with :last_page overflow we need to re-run the method in order to get the hits
|
33
35
|
if defined?(OVERFLOW) && pagy.overflow? && pagy.vars[:overflow] == :last_page
|
@@ -30,7 +30,7 @@ class Pagy
|
|
30
30
|
tags = { 'before' => ( '<ul class="pagination">' \
|
31
31
|
+ (p_prev ? %(<li class="prev">#{link.call(p_prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"')}</li>)
|
32
32
|
: %(<li class="prev disabled">#{pagy_t('pagy.nav.prev')}</li>)) ),
|
33
|
-
'link' => %(<li>#{link.call(
|
33
|
+
'link' => %(<li>#{link.call(PAGE_PLACEHOLDER)}</li>),
|
34
34
|
'active' => %(<li class="current">#{pagy.page}</li>),
|
35
35
|
'gap' => %(<li class="ellipsis gap" aria-hidden="true"></li>),
|
36
36
|
'after' => ( (p_next ? %(<li class="next">#{link.call(p_next, pagy_t('pagy.nav.next'), 'aria-label="next"')}</li>)
|
data/lib/pagy/extras/headers.rb
CHANGED
@@ -23,8 +23,8 @@ class Pagy
|
|
23
23
|
def pagy_headers_hash(pagy)
|
24
24
|
countless = defined?(Pagy::Countless) && pagy.is_a?(Pagy::Countless)
|
25
25
|
rels = { 'first' => 1, 'prev' => pagy.prev, 'next' => pagy.next }; rels['last'] = pagy.last unless countless
|
26
|
-
url_str = pagy_url_for(
|
27
|
-
hash = { 'Link' => Hash[rels.map{|rel, n|[rel, url_str.sub(
|
26
|
+
url_str = pagy_url_for(PAGE_PLACEHOLDER, pagy, :url)
|
27
|
+
hash = { 'Link' => Hash[rels.map{|rel, n|[rel, url_str.sub(PAGE_PLACEHOLDER, n.to_s)] if n}.compact] }
|
28
28
|
headers = pagy.vars[:headers]
|
29
29
|
hash[headers[:page]] = pagy.page if headers[:page]
|
30
30
|
hash[headers[:items]] = pagy.vars[:items] if headers[:items]
|
data/lib/pagy/extras/items.rb
CHANGED
@@ -10,6 +10,8 @@ class Pagy
|
|
10
10
|
VARS[:items_param] = :items
|
11
11
|
VARS[:max_items] = 100
|
12
12
|
|
13
|
+
ITEMS_PLACEHOLDER = '__pagy_items__'
|
14
|
+
|
13
15
|
# Handle a custom number of :items from params
|
14
16
|
module Backend ; private
|
15
17
|
|
@@ -49,7 +51,7 @@ class Pagy
|
|
49
51
|
def pagy_items_selector_js(pagy, id=pagy_id)
|
50
52
|
p_vars = pagy.vars
|
51
53
|
p_items = p_vars[:items]
|
52
|
-
p_vars[:items] =
|
54
|
+
p_vars[:items] = ITEMS_PLACEHOLDER
|
53
55
|
link = pagy_marked_link(pagy_link_proc(pagy))
|
54
56
|
p_vars[:items] = p_items # restore the items
|
55
57
|
|
@@ -29,7 +29,7 @@ class Pagy
|
|
29
29
|
tags = { 'before' => ( '<ul class="pagination">' \
|
30
30
|
+ (p_prev ? %(<li class="waves-effect prev">#{link.call(p_prev, '<i class="material-icons">chevron_left</i>', 'aria-label="previous"')}</li>)
|
31
31
|
: %(<li class="prev disabled"><a href="#"><i class="material-icons">chevron_left</i></a></li>)) ),
|
32
|
-
'link' => %(<li class="waves-effect">#{mark = link.call(
|
32
|
+
'link' => %(<li class="waves-effect">#{mark = link.call(PAGE_PLACEHOLDER)}</li>),
|
33
33
|
'active' => %(<li class="active">#{mark}</li>),
|
34
34
|
'gap' => %(<li class="gap disabled"><a href="#">#{pagy_t('pagy.nav.gap')}</a></li>),
|
35
35
|
'after' => ( (p_next ? %(<li class="waves-effect next">#{link.call(p_next, '<i class="material-icons">chevron_right</i>', 'aria-label="next"')}</li>)
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# See the Pagy documentation: https://ddnexus.github.io/pagy/extras/metadata
|
2
|
+
# encoding: utf-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
class Pagy
|
6
|
+
# Add a specialized backend method for pagination metadata
|
7
|
+
module Backend ; private
|
8
|
+
|
9
|
+
METADATA = [ :scaffold_url, :first_url, :prev_url, :page_url, :next_url, :last_url,
|
10
|
+
:count, :page, :items, :vars, :pages, :last, :from, :to, :prev, :next, :series ]
|
11
|
+
METADATA << :sequels if VARS.key?(:steps) # :steps gets defined along with the #sequels method
|
12
|
+
|
13
|
+
VARS[:metadata] = METADATA.dup
|
14
|
+
|
15
|
+
include Helpers
|
16
|
+
|
17
|
+
def pagy_metadata(pagy, url=false)
|
18
|
+
names = pagy.vars[:metadata]
|
19
|
+
(unknown = names - METADATA).empty? or raise(VariableError.new(pagy), "unknown metadata #{unknown.inspect}")
|
20
|
+
scaffold_url = pagy_url_for(PAGE_PLACEHOLDER, pagy, url)
|
21
|
+
metadata = {}
|
22
|
+
names.each do |key|
|
23
|
+
metadata[key] = case key
|
24
|
+
when :scaffold_url ; scaffold_url
|
25
|
+
when :first_url ; scaffold_url.sub(PAGE_PLACEHOLDER, 1.to_s)
|
26
|
+
when :prev_url ; scaffold_url.sub(PAGE_PLACEHOLDER, pagy.prev.to_s)
|
27
|
+
when :page_url ; scaffold_url.sub(PAGE_PLACEHOLDER, pagy.page.to_s)
|
28
|
+
when :next_url ; scaffold_url.sub(PAGE_PLACEHOLDER, pagy.next.to_s)
|
29
|
+
when :last_url ; scaffold_url.sub(PAGE_PLACEHOLDER, pagy.last.to_s)
|
30
|
+
else pagy.send(key)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
metadata
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
data/lib/pagy/extras/navs.rb
CHANGED
@@ -12,7 +12,7 @@ class Pagy
|
|
12
12
|
link, p_prev, p_next = pagy_link_proc(pagy), pagy.prev, pagy.next
|
13
13
|
tags = { 'before' => p_prev ? %(<span class="page prev">#{link.call p_prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"'}</span> )
|
14
14
|
: %(<span class="page prev disabled">#{pagy_t('pagy.nav.prev')}</span> ),
|
15
|
-
'link' => %(<span class="page">#{link.call(
|
15
|
+
'link' => %(<span class="page">#{link.call(PAGE_PLACEHOLDER)}</span> ),
|
16
16
|
'active' => %(<span class="page active">#{pagy.page}</span> ),
|
17
17
|
'gap' => %(<span class="page gap">#{pagy_t('pagy.nav.gap')}</span> ),
|
18
18
|
'after' => p_next ? %(<span class="page next">#{link.call p_next, pagy_t('pagy.nav.next'), 'aria-label="next"'}</span>)
|
data/lib/pagy/extras/semantic.rb
CHANGED
@@ -29,7 +29,7 @@ class Pagy
|
|
29
29
|
link, p_prev, p_next = pagy_link_proc(pagy, 'class="item"'), pagy.prev, pagy.next
|
30
30
|
tags = { 'before' => (p_prev ? %(#{link.call(p_prev, '<i class="left small chevron icon"></i>', 'aria-label="previous"')})
|
31
31
|
: %(<div class="item disabled"><i class="left small chevron icon"></i></div>)),
|
32
|
-
'link' => %(#{link.call(
|
32
|
+
'link' => %(#{link.call(PAGE_PLACEHOLDER)}),
|
33
33
|
'active' => %(<a class="item active">#{pagy.page}</a>),
|
34
34
|
'gap' => %(<div class="disabled item">#{pagy_t('pagy.nav.gap')}</div>),
|
35
35
|
'after' => (p_next ? %(#{link.call(p_next, '<i class="right small chevron icon"></i>', 'aria-label="next"')})
|
data/lib/pagy/extras/shared.rb
CHANGED
data/lib/pagy/extras/uikit.rb
CHANGED
@@ -33,8 +33,8 @@ class Pagy
|
|
33
33
|
next_span = "<span uk-pagination-next>#{pagy_t('pagy.nav.next')}</span>"
|
34
34
|
tags = { 'before' => p_prev ? %(<li>#{link.call p_prev, previous_span}</li>)
|
35
35
|
: %(<li class="uk-disabled"><a href="#">#{previous_span}</a></li>),
|
36
|
-
'link' => %(<li>#{link.call(
|
37
|
-
'active' => %(<li class="uk-active"><span>#{
|
36
|
+
'link' => %(<li>#{link.call(PAGE_PLACEHOLDER)}</li>),
|
37
|
+
'active' => %(<li class="uk-active"><span>#{PAGE_PLACEHOLDER}</span></li>),
|
38
38
|
'gap' => %(<li class="uk-disabled"><span>#{pagy_t('pagy.nav.gap')}</span></li>),
|
39
39
|
'after' => p_next ? %(<li>#{link.call p_next, next_span}</li>)
|
40
40
|
: %(<li class="uk-disabled"><a href="#">#{next_span}</a></li>) }
|
data/lib/pagy/frontend.rb
CHANGED
@@ -6,6 +6,8 @@ require 'yaml'
|
|
6
6
|
|
7
7
|
class Pagy
|
8
8
|
|
9
|
+
PAGE_PLACEHOLDER = '__pagy_page__' # string used for search and replace, hardcoded also in the pagy.js file
|
10
|
+
|
9
11
|
# I18n static hash loaded at startup, used as default alternative to the i18n gem.
|
10
12
|
# see https://ddnexus.github.io/pagy/api/frontend#i18n
|
11
13
|
I18n = eval(Pagy.root.join('locales', 'utils', 'i18n.rb').read) #rubocop:disable Security/Eval
|
@@ -28,7 +30,7 @@ class Pagy
|
|
28
30
|
include Helpers
|
29
31
|
|
30
32
|
EMPTY = '' # EMPTY + 'string' is almost as fast as +'string' but is also 1.9 compatible
|
31
|
-
MARK =
|
33
|
+
MARK = PAGE_PLACEHOLDER # backward compatibility in case of helper-overriding in legacy apps
|
32
34
|
|
33
35
|
# Generic pagination: it returns the html with the series of links to the pages
|
34
36
|
def pagy_nav(pagy)
|
@@ -59,7 +61,7 @@ class Pagy
|
|
59
61
|
# Benchmarked on a 20 link nav: it is ~22x faster and uses ~18x less memory than rails' link_to
|
60
62
|
def pagy_link_proc(pagy, link_extra='')
|
61
63
|
p_prev, p_next = pagy.prev, pagy.next
|
62
|
-
a, b = %(<a href="#{pagy_url_for(
|
64
|
+
a, b = %(<a href="#{pagy_url_for(PAGE_PLACEHOLDER, pagy)}" #{pagy.vars[:link_extra]} #{link_extra}).split(PAGE_PLACEHOLDER, 2)
|
63
65
|
lambda {|n, text=n, extra=''| "#{a}#{n}#{b}#{ if n == p_prev ; ' rel="prev"'
|
64
66
|
elsif n == p_next ; ' rel="next"'
|
65
67
|
else '' end } #{extra}>#{text}</a>"}
|
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: 3.
|
4
|
+
version: 3.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Domizio Demichelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'Agnostic pagination in plain ruby: it works with any framework, ORM
|
14
14
|
and DB type, with all kinds of collections, even pre-paginated, scopes, Arrays,
|
@@ -24,12 +24,15 @@ files:
|
|
24
24
|
- lib/javascripts/pagy.js
|
25
25
|
- lib/locales/README.md
|
26
26
|
- lib/locales/bg.yml
|
27
|
+
- lib/locales/ca.yml
|
27
28
|
- lib/locales/de.yml
|
28
29
|
- lib/locales/en.yml
|
29
30
|
- lib/locales/es.yml
|
30
31
|
- lib/locales/fr.yml
|
31
32
|
- lib/locales/id.yml
|
33
|
+
- lib/locales/it.yml
|
32
34
|
- lib/locales/ja.yml
|
35
|
+
- lib/locales/ko.yml
|
33
36
|
- lib/locales/nb.yml
|
34
37
|
- lib/locales/nl.yml
|
35
38
|
- lib/locales/pl.yml
|
@@ -47,6 +50,7 @@ files:
|
|
47
50
|
- lib/pagy/backend.rb
|
48
51
|
- lib/pagy/countless.rb
|
49
52
|
- lib/pagy/exceptions.rb
|
53
|
+
- lib/pagy/extras/arel.rb
|
50
54
|
- lib/pagy/extras/array.rb
|
51
55
|
- lib/pagy/extras/bootstrap.rb
|
52
56
|
- lib/pagy/extras/bulma.rb
|
@@ -57,6 +61,7 @@ files:
|
|
57
61
|
- lib/pagy/extras/i18n.rb
|
58
62
|
- lib/pagy/extras/items.rb
|
59
63
|
- lib/pagy/extras/materialize.rb
|
64
|
+
- lib/pagy/extras/metadata.rb
|
60
65
|
- lib/pagy/extras/navs.rb
|
61
66
|
- lib/pagy/extras/overflow.rb
|
62
67
|
- lib/pagy/extras/pagy_search.rb
|
@@ -102,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
107
|
- !ruby/object:Gem::Version
|
103
108
|
version: '0'
|
104
109
|
requirements: []
|
105
|
-
rubygems_version: 3.0.
|
110
|
+
rubygems_version: 3.0.6
|
106
111
|
signing_key:
|
107
112
|
specification_version: 4
|
108
113
|
summary: The Ultimate Pagination Ruby Gem
|