pagy 3.11.0 → 4.3.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/lib/config/pagy.rb +10 -4
- data/lib/javascripts/pagy.js +1 -1
- data/lib/locales/bs.yml +24 -0
- data/lib/locales/hr.yml +24 -0
- data/lib/locales/sr.yml +23 -0
- data/lib/locales/utils/i18n.rb +3 -11
- data/lib/locales/utils/loader.rb +7 -10
- data/lib/locales/utils/p11n.rb +27 -20
- data/lib/pagy.rb +48 -26
- data/lib/pagy/backend.rb +4 -3
- data/lib/pagy/countless.rb +13 -10
- data/lib/pagy/exceptions.rb +8 -5
- data/lib/pagy/extras/arel.rb +3 -3
- data/lib/pagy/extras/array.rb +3 -3
- data/lib/pagy/extras/bootstrap.rb +54 -27
- data/lib/pagy/extras/bulma.rb +52 -34
- data/lib/pagy/extras/countless.rb +5 -7
- data/lib/pagy/extras/elasticsearch_rails.rb +27 -17
- data/lib/pagy/extras/foundation.rb +54 -29
- data/lib/pagy/extras/headers.rb +13 -9
- data/lib/pagy/extras/i18n.rb +8 -11
- data/lib/pagy/extras/items.rb +32 -29
- data/lib/pagy/extras/materialize.rb +50 -32
- data/lib/pagy/extras/metadata.rb +25 -20
- data/lib/pagy/extras/navs.rb +39 -18
- data/lib/pagy/extras/overflow.rb +50 -48
- data/lib/pagy/extras/searchkick.rb +26 -16
- data/lib/pagy/extras/semantic.rb +48 -27
- data/lib/pagy/extras/shared.rb +10 -6
- data/lib/pagy/extras/support.rb +10 -5
- data/lib/pagy/extras/trim.rb +11 -11
- data/lib/pagy/extras/uikit.rb +56 -31
- data/lib/pagy/frontend.rb +47 -29
- metadata +7 -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: 3.
|
4
|
+
version: 4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Domizio Demichelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-20 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,8 +22,8 @@ files:
|
|
22
22
|
- LICENSE.txt
|
23
23
|
- lib/config/pagy.rb
|
24
24
|
- lib/javascripts/pagy.js
|
25
|
-
- lib/locales/README.md
|
26
25
|
- lib/locales/bg.yml
|
26
|
+
- lib/locales/bs.yml
|
27
27
|
- lib/locales/ca.yml
|
28
28
|
- lib/locales/cs.yml
|
29
29
|
- lib/locales/da.yml
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- lib/locales/en.yml
|
32
32
|
- lib/locales/es.yml
|
33
33
|
- lib/locales/fr.yml
|
34
|
+
- lib/locales/hr.yml
|
34
35
|
- lib/locales/id.yml
|
35
36
|
- lib/locales/it.yml
|
36
37
|
- lib/locales/ja.yml
|
@@ -42,6 +43,7 @@ files:
|
|
42
43
|
- lib/locales/pt-BR.yml
|
43
44
|
- lib/locales/pt.yml
|
44
45
|
- lib/locales/ru.yml
|
46
|
+
- lib/locales/sr.yml
|
45
47
|
- lib/locales/sv-SE.yml
|
46
48
|
- lib/locales/sv.yml
|
47
49
|
- lib/locales/sw.yml
|
@@ -70,7 +72,6 @@ files:
|
|
70
72
|
- lib/pagy/extras/metadata.rb
|
71
73
|
- lib/pagy/extras/navs.rb
|
72
74
|
- lib/pagy/extras/overflow.rb
|
73
|
-
- lib/pagy/extras/pagy_search.rb
|
74
75
|
- lib/pagy/extras/searchkick.rb
|
75
76
|
- lib/pagy/extras/semantic.rb
|
76
77
|
- lib/pagy/extras/shared.rb
|
@@ -93,7 +94,6 @@ files:
|
|
93
94
|
- lib/templates/uikit_nav.html.erb
|
94
95
|
- lib/templates/uikit_nav.html.haml
|
95
96
|
- lib/templates/uikit_nav.html.slim
|
96
|
-
- pagy.gemspec
|
97
97
|
homepage: https://github.com/ddnexus/pagy
|
98
98
|
licenses:
|
99
99
|
- MIT
|
@@ -106,14 +106,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
106
106
|
requirements:
|
107
107
|
- - ">="
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
109
|
+
version: '3.0'
|
110
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
111
|
requirements:
|
112
112
|
- - ">="
|
113
113
|
- !ruby/object:Gem::Version
|
114
114
|
version: '0'
|
115
115
|
requirements: []
|
116
|
-
rubygems_version: 3.
|
116
|
+
rubygems_version: 3.2.3
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
119
|
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
|