pagy 1.3 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pagy.rb +1 -1
- data/lib/pagy/extras/items.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ded274d1b6929671f79ae2dea4eed1203241a2a5178aa747c39e3ea3d0b86c7a
|
4
|
+
data.tar.gz: 85d3ab91e16da33221568d4d075a9e95040c6739d810558287d19b24bc311169
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84f75a95a68c73ebf85052ea9c21300c249928d5450ff01cb46ae1919d60276b77bb2f73eb6b36f243eac7522406c7837aeaca66983dedb0866b3b6a9dde549e
|
7
|
+
data.tar.gz: 99cf22a77850bc49431c8656ec7c95f218049f00e8cd21862692f32c2516e9bd1f4a827b73804ad66f3ed1f9640a77c5c823b276a4662c804bb507d67fd60484
|
data/lib/pagy.rb
CHANGED
data/lib/pagy/extras/items.rb
CHANGED
@@ -47,10 +47,11 @@ class Pagy
|
|
47
47
|
|
48
48
|
# Return the items selector HTML. For example "Show [20] items per page"
|
49
49
|
def pagy_items_selector(pagy, id=pagy_id)
|
50
|
-
|
50
|
+
p_vars = pagy.vars; p_items = p_vars[:items]; p_vars[:items] = "#{MARKER}-items-"
|
51
51
|
|
52
52
|
html = +%(<span id="#{id}">)
|
53
53
|
html << %(<a href="#{pagy_url_for("#{MARKER}-page-", pagy)}"></a>)
|
54
|
+
p_vars[:items] = p_items # restore the items
|
54
55
|
input = %(<input type="number" min="1" max="#{p_vars[:max_items]}" value="#{p_items}" style="padding: 0; text-align: center; width: #{p_items.to_s.length+1}rem;">)
|
55
56
|
html << %(#{pagy_t('pagy.items', items_input: input, count: p_items)})
|
56
57
|
html << %(</span>#{pagy_json_tag(:items, id, MARKER, pagy.from)})
|
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: 1.3.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-01-
|
11
|
+
date: 2019-01-22 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,
|