will_paginate_bootstrp 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 794b24114778af868fdd7f6af1e1f7c734ce5be697f44100090cefd759cade78
4
- data.tar.gz: 1ebfaa5be7611adbed0974895bbbf3ce7fb3a7936f6e0a3921a4cab1b8689dc2
3
+ metadata.gz: d77b811a2039238534164bb4765a8011e0e225a72fae600da86632deaa2ff6f1
4
+ data.tar.gz: df1dd89a5d9b898f15d7bd64817ebf8541bbc342cc429e53692612befbe4065b
5
5
  SHA512:
6
- metadata.gz: 58a3276851db92f0f103cf1b8d44179d9181e2bb36f4b38697177126add5bfdb176df4763cd96a6b8f4f4006614eafd3895902da24b3aa283750ed5f7d0862cb
7
- data.tar.gz: b8c3812de9c3c703a975da5ee304f2a2c609d405359b45e084c7b4dadbc439372a64c1aafcbc3998fc92a42c0c6b220ca91efa1af2137a67eb9f47a5996d070b
6
+ metadata.gz: 34fe16529da58661a9a06d8318259246c0515039d4e7da9925ed42c1781365bd2211da938cbef84327bad786b5054ddd9248ef8e395b7e3822266a213353612e
7
+ data.tar.gz: 33a689d9131c877ad9397500d061e31dfaa0d18ec485a766105e38220d15ded2f7bc8eb7fab0675b39118abc108b7b9a952c92b368417839d19f9be43aa7a66e
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WillPaginateBootstrp
4
- VERSION = '0.2.6'
4
+ VERSION = '0.2.7'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: will_paginate_bootstrp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergii Demianchuk
@@ -32,7 +32,6 @@ extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
34
  - lib/will_paginate_bootstrp.rb
35
- - lib/will_paginate_bootstrp/renderer.rb
36
35
  - lib/will_paginate_bootstrp/version.rb
37
36
  homepage: https://github.com/systemu-net/will_paginate_bootstrp
38
37
  licenses:
@@ -1,60 +0,0 @@
1
- # frozen_string_literal: true
2
- require 'will_paginate/view_helpers/action_view'
3
-
4
- module WillPaginateBootstrp
5
- class Renderer < ::WillPaginate::ActionView::LinkRenderer
6
- ELLIPSIS = "&hellip;" # hellip means horizontal ellipsis and is used to denote … (i.e. three dots)
7
- NEXT_LABEL = "&rarr;" # →
8
- PREVIOUS_LABEL = "&larr;" # ←
9
-
10
- def to_html
11
- html = pagination.map do |item|
12
- item.is_a?(Integer) ?
13
- page_number(item) :
14
- send(item)
15
- end.join(@options[:link_separator])
16
-
17
- tag(:nav, tag(:ul, html, class: @options[:list_classes].join(' ')))
18
- end
19
-
20
- def container_attributes
21
- super.except(*[:link_options])
22
- end
23
-
24
- protected
25
-
26
- def page_number(page)
27
- if page == current_page
28
- tag(:li, tag(:span, page, class: 'page-link'), class: 'page-item active')
29
- else
30
- tag(:li, link(page, page, link_options.merge(class: 'page-link', rel: rel_value(page))), class: 'page-item')
31
- end
32
- end
33
-
34
- def previous_or_next_page(page, text, classname)
35
- if page
36
- tag(:li, link(text, page, link_options.merge(class: classname)), class: 'page-item')
37
- else
38
- tag(:li, tag(:span, text, class: classname), class: 'page-item disabled')
39
- end
40
- end
41
-
42
- def gap
43
- tag(:li, tag(:i, ELLIPSIS, class: 'page-link'), class: 'page-item disabled')
44
- end
45
-
46
- def previous_page
47
- num = @collection.current_page > 1 && @collection.current_page - 1
48
- previous_or_next_page(num, @options[:previous_label], 'page-link')
49
- end
50
-
51
- def next_page
52
- num = @collection.current_page < @collection.total_pages && @collection.current_page + 1
53
- previous_or_next_page(num, @options[:next_label], 'page-link')
54
- end
55
-
56
- def link_options
57
- @options[:link_options] || {}
58
- end
59
- end
60
- end