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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ae08c68923b82d97d99acb79305034829e814b3
4
- data.tar.gz: a7a6db2b0cc626b2e1865fce550d2727c2c7a74b
3
+ metadata.gz: d3fc12377115556fdb3a9be86df4e5eb2cfe21d4
4
+ data.tar.gz: ef305e1e5fa6a9cc15ec4074da033a1c73b639f1
5
5
  SHA512:
6
- metadata.gz: 98eb17c7d34a36a53ee33848d48dabaa30dba6dac2acece12f64f79a05ea0dbe39a6d791146378e9de550f24fa98e15e6fef19123977c17eb42ee8f01fa2a7a6
7
- data.tar.gz: 11f137fc966232478778098121827fb656bcdcbf1f53d9d86a72a4d89705e452f8645929a59a5c4334cf6738e5da36d15be1ea6ed68c1b107e2ed827873c485c
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
- if @options[:foundation].to_i >= 3
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
- tag :li, link(page, page, link_options.merge(:rel => rel_value(page))), :class => ('current' if page == current_page)
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 gap
39
- tag :li, link('…', '#'), :class => 'unavailable'
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
- # def previous_page
43
- # num = @collection.current_page > 1 && @collection.current_page - 1
44
- # previous_or_next_page(num, @options[:previous_label], "prev")
45
- # end
45
+ def gap
46
+ tag :li, link('…', ''), :class => 'unavailable'
47
+ end
46
48
 
47
- # def next_page
48
- # num = @collection.current_page < @collection.total_pages && @collection.current_page + 1
49
- # previous_or_next_page(num, @options[:next_label], "next")
50
- # end
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 previous_or_next_page(page, text, classname)
53
- link_options = @options[:link_options] || {}
54
- tag :li, link(text, page || '#', link_options), :class => [classname[0..3], classname, ('unavailable' unless page)].join(' ')
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
@@ -1,3 +1,3 @@
1
1
  module FoundationPagination
2
- VERSION = "0.3.2"
2
+ VERSION = "5.3.3"
3
3
  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: 0.3.2
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-06 00:00:00.000000000 Z
11
+ date: 2013-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: will_paginate