pagy 3.8.0 → 4.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/lib/config/pagy.rb +36 -25
- data/lib/javascripts/pagy.js +104 -93
- data/lib/locales/ar.yml +26 -0
- data/lib/locales/bg.yml +2 -2
- data/lib/locales/bs.yml +24 -0
- data/lib/locales/ca.yml +2 -2
- data/lib/locales/cs.yml +22 -0
- data/lib/locales/da.yml +2 -2
- data/lib/locales/de.yml +2 -2
- data/lib/locales/en.yml +2 -2
- data/lib/locales/es.yml +2 -2
- data/lib/locales/fr.yml +2 -2
- data/lib/locales/hr.yml +24 -0
- data/lib/locales/id.yml +2 -2
- data/lib/locales/it.yml +2 -2
- data/lib/locales/ja.yml +2 -2
- data/lib/locales/km.yml +2 -2
- data/lib/locales/ko.yml +2 -2
- data/lib/locales/nb.yml +2 -2
- data/lib/locales/nl.yml +2 -2
- data/lib/locales/pl.yml +2 -2
- data/lib/locales/pt-BR.yml +2 -2
- data/lib/locales/pt.yml +22 -0
- data/lib/locales/ru.yml +2 -2
- data/lib/locales/sr.yml +23 -0
- data/lib/locales/sv-SE.yml +2 -2
- data/lib/locales/sv.yml +2 -2
- data/lib/locales/sw.yml +22 -0
- data/lib/locales/tr.yml +2 -2
- data/lib/locales/uk.yml +24 -0
- data/lib/locales/utils/i18n.rb +3 -11
- data/lib/locales/utils/loader.rb +7 -10
- data/lib/locales/utils/p11n.rb +49 -17
- data/lib/locales/zh-CN.yml +2 -2
- data/lib/locales/zh-HK.yml +2 -2
- data/lib/locales/zh-TW.yml +3 -3
- data/lib/pagy.rb +50 -26
- data/lib/pagy/backend.rb +5 -3
- data/lib/pagy/console.rb +21 -0
- data/lib/pagy/countless.rb +13 -10
- data/lib/pagy/deprecation.rb +27 -0
- data/lib/pagy/exceptions.rb +7 -2
- data/lib/pagy/extras/arel.rb +4 -3
- data/lib/pagy/extras/array.rb +4 -3
- data/lib/pagy/extras/bootstrap.rb +61 -30
- data/lib/pagy/extras/bulma.rb +60 -38
- data/lib/pagy/extras/countless.rb +7 -8
- data/lib/pagy/extras/elasticsearch_rails.rb +28 -17
- data/lib/pagy/extras/foundation.rb +61 -32
- data/lib/pagy/extras/headers.rb +13 -9
- data/lib/pagy/extras/i18n.rb +11 -5
- data/lib/pagy/extras/items.rb +21 -34
- data/lib/pagy/extras/materialize.rb +58 -35
- data/lib/pagy/extras/meilisearch.rb +55 -0
- data/lib/pagy/extras/metadata.rb +27 -21
- data/lib/pagy/extras/navs.rb +44 -20
- data/lib/pagy/extras/overflow.rb +52 -48
- data/lib/pagy/extras/searchkick.rb +27 -16
- data/lib/pagy/extras/semantic.rb +55 -30
- data/lib/pagy/extras/shared.rb +14 -15
- data/lib/pagy/extras/standalone.rb +62 -0
- data/lib/pagy/extras/support.rb +26 -9
- data/lib/pagy/extras/trim.rb +12 -11
- data/lib/pagy/extras/uikit.rb +54 -35
- data/lib/pagy/frontend.rb +64 -32
- metadata +16 -7
- data/lib/locales/README.md +0 -35
- data/lib/pagy/extras/pagy_search.rb +0 -18
- data/pagy.gemspec +0 -16
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: 4.10.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:
|
11
|
+
date: 2021-06-24 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,
|
@@ -22,14 +22,17 @@ files:
|
|
22
22
|
- LICENSE.txt
|
23
23
|
- lib/config/pagy.rb
|
24
24
|
- lib/javascripts/pagy.js
|
25
|
-
- lib/locales/
|
25
|
+
- lib/locales/ar.yml
|
26
26
|
- lib/locales/bg.yml
|
27
|
+
- lib/locales/bs.yml
|
27
28
|
- lib/locales/ca.yml
|
29
|
+
- lib/locales/cs.yml
|
28
30
|
- lib/locales/da.yml
|
29
31
|
- lib/locales/de.yml
|
30
32
|
- lib/locales/en.yml
|
31
33
|
- lib/locales/es.yml
|
32
34
|
- lib/locales/fr.yml
|
35
|
+
- lib/locales/hr.yml
|
33
36
|
- lib/locales/id.yml
|
34
37
|
- lib/locales/it.yml
|
35
38
|
- lib/locales/ja.yml
|
@@ -39,10 +42,14 @@ files:
|
|
39
42
|
- lib/locales/nl.yml
|
40
43
|
- lib/locales/pl.yml
|
41
44
|
- lib/locales/pt-BR.yml
|
45
|
+
- lib/locales/pt.yml
|
42
46
|
- lib/locales/ru.yml
|
47
|
+
- lib/locales/sr.yml
|
43
48
|
- lib/locales/sv-SE.yml
|
44
49
|
- lib/locales/sv.yml
|
50
|
+
- lib/locales/sw.yml
|
45
51
|
- lib/locales/tr.yml
|
52
|
+
- lib/locales/uk.yml
|
46
53
|
- lib/locales/utils/i18n.rb
|
47
54
|
- lib/locales/utils/loader.rb
|
48
55
|
- lib/locales/utils/p11n.rb
|
@@ -51,7 +58,9 @@ files:
|
|
51
58
|
- lib/locales/zh-TW.yml
|
52
59
|
- lib/pagy.rb
|
53
60
|
- lib/pagy/backend.rb
|
61
|
+
- lib/pagy/console.rb
|
54
62
|
- lib/pagy/countless.rb
|
63
|
+
- lib/pagy/deprecation.rb
|
55
64
|
- lib/pagy/exceptions.rb
|
56
65
|
- lib/pagy/extras/arel.rb
|
57
66
|
- lib/pagy/extras/array.rb
|
@@ -64,13 +73,14 @@ files:
|
|
64
73
|
- lib/pagy/extras/i18n.rb
|
65
74
|
- lib/pagy/extras/items.rb
|
66
75
|
- lib/pagy/extras/materialize.rb
|
76
|
+
- lib/pagy/extras/meilisearch.rb
|
67
77
|
- lib/pagy/extras/metadata.rb
|
68
78
|
- lib/pagy/extras/navs.rb
|
69
79
|
- lib/pagy/extras/overflow.rb
|
70
|
-
- lib/pagy/extras/pagy_search.rb
|
71
80
|
- lib/pagy/extras/searchkick.rb
|
72
81
|
- lib/pagy/extras/semantic.rb
|
73
82
|
- lib/pagy/extras/shared.rb
|
83
|
+
- lib/pagy/extras/standalone.rb
|
74
84
|
- lib/pagy/extras/support.rb
|
75
85
|
- lib/pagy/extras/trim.rb
|
76
86
|
- lib/pagy/extras/uikit.rb
|
@@ -90,7 +100,6 @@ files:
|
|
90
100
|
- lib/templates/uikit_nav.html.erb
|
91
101
|
- lib/templates/uikit_nav.html.haml
|
92
102
|
- lib/templates/uikit_nav.html.slim
|
93
|
-
- pagy.gemspec
|
94
103
|
homepage: https://github.com/ddnexus/pagy
|
95
104
|
licenses:
|
96
105
|
- MIT
|
@@ -103,14 +112,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
112
|
requirements:
|
104
113
|
- - ">="
|
105
114
|
- !ruby/object:Gem::Version
|
106
|
-
version: '
|
115
|
+
version: '2.5'
|
107
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
117
|
requirements:
|
109
118
|
- - ">="
|
110
119
|
- !ruby/object:Gem::Version
|
111
120
|
version: '0'
|
112
121
|
requirements: []
|
113
|
-
rubygems_version: 3.
|
122
|
+
rubygems_version: 3.2.15
|
114
123
|
signing_key:
|
115
124
|
specification_version: 4
|
116
125
|
summary: The Ultimate Pagination Ruby Gem
|
data/lib/locales/README.md
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# Pagy locales
|
2
|
-
|
3
|
-
### Please, submit your translation!
|
4
|
-
|
5
|
-
If you find that some translation could be improved, please, create an issue.
|
6
|
-
|
7
|
-
If you are using pagy with some language missing from the dictionary files, please, submit your translation!
|
8
|
-
|
9
|
-
You can create a Pull Request for your language, and get all the help you need to correctly complete it. Here is a check list.
|
10
|
-
|
11
|
-
### Check list for a new dictionary file:
|
12
|
-
|
13
|
-
- [ ] Find the pluralization rule for your language
|
14
|
-
|
15
|
-
- [ ] Find the locale file you need in the [list of pluralizations](https://github.com/svenfuchs/rails-i18n/tree/master/rails/pluralization) and check the pluralization rule in it. For example it is `::RailsI18n::Pluralization::OneOther.with_locale(:en)` for `en.rb`. Note the rule part i.e. `OneOther`. In pagy that translates to the symbol `:one_other`.
|
16
|
-
|
17
|
-
- [ ] If the pluralization rule of your language is not the `:one_other` default, confirm that the [p11n.rb](https://github.com/ddnexus/pagy/blob/master/lib/locales/utils/p11n.rb) file already defines the pluralization rule of your dictionary file:
|
18
|
-
|
19
|
-
- [ ] If the rule is not defined, you can either: a) Add the rule as a new rule/lambda entry in the `p11n` variable hash and relative tests or b) Just create an issue requesting the addition to the rule/lambda entry and tests.
|
20
|
-
|
21
|
-
- [ ] Add your language to the `plurals` hash in the file.
|
22
|
-
|
23
|
-
- [ ] add/edit the first line comment in the language rule in your dictionary file (e.g. `# :one_other pluralization ...`
|
24
|
-
|
25
|
-
- [ ] The mandatory pluralized entry in the dictionary file is the `item_name`. Please, provide all the plurals needed by your language. E.g. if your language uses the `:east_slavic` you should provide the plurals for `one`, `few`, `many` and `other`, if it uses `:one_other`, you should provide `one` and `other` plurals. If it uses `:other` you should only provide a single value. Look into other dictionary files to get some example. Ask if in doubt.
|
26
|
-
|
27
|
-
- [ ] The other entries in the dictionary file don't need any plural variant in most languages since the pluralization of the `item_name` in the sentence is enough. However, in some language, a whole sentence might need to be written in different ways for different counts. In that case you should add the different plurals for the sentence and the `count` will trigger the one that applies.
|
28
|
-
|
29
|
-
Feel free to ask for help in your Pull Request.
|
30
|
-
|
31
|
-
### Useful Links
|
32
|
-
|
33
|
-
* [Pagy I18n Documentation](https://ddnexus.github.io/pagy/api/frontend#i18n)
|
34
|
-
* [I18n Extra](https://ddnexus.github.io/pagy/extras/i18n)
|
35
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# Support module to capture search calls
|
2
|
-
# encoding: utf-8
|
3
|
-
# frozen_string_literal: true
|
4
|
-
|
5
|
-
class Pagy
|
6
|
-
module Search
|
7
|
-
# returns an array used to delay the call of #search
|
8
|
-
# after the pagination variables are merged to the options
|
9
|
-
# it also pushes to the same array an eventually called method and arguments
|
10
|
-
# the last search argument must be a hash option
|
11
|
-
def pagy_search(*search_args, &block)
|
12
|
-
search_args << {} unless search_args[-1].is_a?(Hash)
|
13
|
-
[self, search_args, block].tap do |args|
|
14
|
-
args.define_singleton_method(:method_missing){|*a| args += a}
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
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
|