will_paginate-bootstrap4 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -3
- data/config/initializers/will_paginate.rb +8 -7
- data/lib/will_paginate-bootstrap4/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d277a4245b4499ff9406778ae2f94a9bd4295d48
|
4
|
+
data.tar.gz: 5c7f5097b7092b1697de8e1e5655580ad5748769
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4b5ffc629f998af5a86a76fefdcff460cafd39cffa98c2c20a424d589f3109617987d5b1766b47a6b08c333b3ba470b7c95782709de2ea11d79360c9ffa7546
|
7
|
+
data.tar.gz: 31b9ef288aa066b53245a535066889dadd91dddf3c467ba2e56f7cce2c398298287f1d00f6d63661430dd757e357d788b95920bc81686e63f2becd40be3dce8a
|
data/README.md
CHANGED
@@ -17,15 +17,23 @@ Just like you would in the regular [will_paginate][wp]. If you've got a need to
|
|
17
17
|
pass an option like so:
|
18
18
|
|
19
19
|
<%= will_paginate @collection, renderer: WillPaginate::ActionView::BootstrapLinkRenderer %>
|
20
|
-
|
21
|
-
|
20
|
+
|
21
|
+
The following options are available (in addition to the options available in will_paginate):
|
22
|
+
|
23
|
+
:list_classes = ['pagination'] # Array of classes
|
24
|
+
:aria_label = 'Page Navigation' # The aria label to use in the Nav tag
|
25
|
+
|
26
|
+
For example, to place the navigation section to the far right of the page, use this in your view:
|
27
|
+
|
28
|
+
<%= will_paginate @clients, list_classes: %w(pagination justify-content-end) %>
|
29
|
+
|
30
|
+
#### Stylesheets
|
22
31
|
.pagination {
|
23
32
|
margin-top: 10px;
|
24
33
|
align-items: center;
|
25
34
|
justify-content: center;
|
26
35
|
}
|
27
36
|
|
28
|
-
|
29
37
|
Copyright (c) 2016-2017 [Ivan Palamarchuk](https://github.com/delef) released under the MIT license
|
30
38
|
|
31
39
|
[wp]: http://github.com/mislav/will_paginate
|
@@ -8,9 +8,10 @@ module WillPaginate
|
|
8
8
|
|
9
9
|
options = options.symbolize_keys
|
10
10
|
options[:renderer] ||= BootstrapLinkRenderer
|
11
|
-
options[:
|
12
|
-
options[:
|
13
|
-
options[:
|
11
|
+
options[:list_classes] ||= ['pagination']
|
12
|
+
options[:aria_label] ||= 'Page Navigation'
|
13
|
+
options[:previous_label] ||= '«'
|
14
|
+
options[:next_label] ||= '»'
|
14
15
|
|
15
16
|
super(collection, options)
|
16
17
|
end
|
@@ -28,8 +29,8 @@ module WillPaginate
|
|
28
29
|
end
|
29
30
|
end.join(@options[:link_separator])
|
30
31
|
|
31
|
-
list_wrapper = tag :ul, list_items, class:
|
32
|
-
tag :nav, list_wrapper,
|
32
|
+
list_wrapper = tag :ul, list_items, class: @options[:list_classes].join(" ").to_s
|
33
|
+
tag :nav, list_wrapper, 'aria-label': @options[:aria_label]
|
33
34
|
end
|
34
35
|
|
35
36
|
def container_attributes
|
@@ -54,10 +55,10 @@ module WillPaginate
|
|
54
55
|
|
55
56
|
if page
|
56
57
|
link_wrapper = link(text, page, link_options.merge(class: 'page-link'))
|
57
|
-
tag :li, link_wrapper, class: '
|
58
|
+
tag :li, link_wrapper, class: 'page-item'
|
58
59
|
else
|
59
60
|
span_wrapper = tag(:span, text, class: 'page-link')
|
60
|
-
tag :li, span_wrapper, class: '
|
61
|
+
tag :li, span_wrapper, class: 'page-item disabled'
|
61
62
|
end
|
62
63
|
end
|
63
64
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: will_paginate-bootstrap4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Palamarchuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: will_paginate
|