will_paginate-foundation 0.3.2 → 5.3.3
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/README.markdown +2 -0
- data/lib/foundation_pagination/foundation_renderer.rb +25 -23
- data/lib/foundation_pagination/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: d3fc12377115556fdb3a9be86df4e5eb2cfe21d4
|
4
|
+
data.tar.gz: ef305e1e5fa6a9cc15ec4074da033a1c73b639f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c134944e8e1fc0e9743594fcb52107875338cea30c30c96c32bcd8d43a386eb5fbc251bf227be74cce3afb0ab0b8884cf7a13ab0963bfbb6408f361f39404522
|
7
|
+
data.tar.gz: c02a23e1132f4ca094a54bbad24f60b9b824fb9398f725ce68b4a95e8a8f4189c9231bd9b37ba73050a91957f16111a2f8c587341f2fb53f43c4875ae845ea89
|
data/README.markdown
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
|
7
7
|
This gem integrates the [Foundation](http://foundation.zurb.com) [pagination component](http://foundation.zurb.com/docs/components/pagination.html) with the [will_paginate](https://github.com/mislav/will_paginate) pagination gem.
|
8
8
|
|
9
|
+
## Supports Foundation 3, 4, 5
|
10
|
+
|
9
11
|
## Install
|
10
12
|
|
11
13
|
* `gem install will_paginate-foundation`, *or*
|
@@ -14,14 +14,7 @@ module FoundationPagination
|
|
14
14
|
end
|
15
15
|
end.join(@options[:link_separator])
|
16
16
|
|
17
|
-
|
18
|
-
tag("ul", list_items, :class => "pagination #{@options[:class]}")
|
19
|
-
else
|
20
|
-
html_container(tag("ul", list_items))
|
21
|
-
end
|
22
|
-
end
|
23
|
-
def html_container(html)
|
24
|
-
tag(:ul, html, container_attributes)
|
17
|
+
tag("ul", list_items, :class => "pagination #{@options[:class]}")
|
25
18
|
end
|
26
19
|
|
27
20
|
def container_attributes
|
@@ -32,27 +25,36 @@ module FoundationPagination
|
|
32
25
|
|
33
26
|
def page_number(page)
|
34
27
|
link_options = @options[:link_options] || {}
|
35
|
-
|
28
|
+
|
29
|
+
if page == current_page
|
30
|
+
tag :li, link(page, ""), :class => ('current')
|
31
|
+
else
|
32
|
+
tag :li, link(page, page, link_options.merge(:rel => rel_value(page)))
|
33
|
+
end
|
36
34
|
end
|
37
35
|
|
38
|
-
def
|
39
|
-
|
36
|
+
def previous_or_next_page(page, text, classname)
|
37
|
+
link_options = @options[:link_options] || {}
|
38
|
+
if page
|
39
|
+
tag :li, link(text, page, link_options), :class => classname
|
40
|
+
else
|
41
|
+
tag :li, link(text, ""), :class => "%s unavailable" % classname
|
42
|
+
end
|
40
43
|
end
|
41
44
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
# end
|
45
|
+
def gap
|
46
|
+
tag :li, link('…', ''), :class => 'unavailable'
|
47
|
+
end
|
46
48
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
49
|
+
def previous_page
|
50
|
+
num = @collection.current_page > 1 && @collection.current_page - 1
|
51
|
+
previous_or_next_page(num, @options[:previous_label], "arrow")
|
52
|
+
end
|
51
53
|
|
52
|
-
def
|
53
|
-
|
54
|
-
|
55
|
-
|
54
|
+
def next_page
|
55
|
+
num = @collection.current_page < @collection.total_pages && @collection.current_page + 1
|
56
|
+
previous_or_next_page(num, @options[:next_label], "arrow")
|
56
57
|
end
|
58
|
+
|
57
59
|
end
|
58
60
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: will_paginate-foundation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Rangel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: will_paginate
|