pagy 0.11.2 → 0.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7531e2f202381880d254762b0e9b1e04543dc7271b363a8aae393161f2b4b627
4
- data.tar.gz: f4b1c1705ab3eb631b0fe13fe8b2e8fb4ab88c502a21b5b2518e84463a5cf748
3
+ metadata.gz: 8b8d6cfce02eec245f179798d265ceecf15461806e45d254ad12fbce2472ed92
4
+ data.tar.gz: 11515e85f3c0281155cbaddb1b30e2849da61b7ee469eaab7e82b5809c1bc99c
5
5
  SHA512:
6
- metadata.gz: 2dfea39837561bdb7861b6c3a58d7d370228d310589b187e835ac1fa03eac7ceeb1fa63a17c0060f7d863310629c4759e5629182caaed64d1089f4b86a0b9f2a
7
- data.tar.gz: 585e0dec486e418115cba1b5f7f69043fcc88cafce24cfd0a92d00163121b768bd41bfd70cfd3526d4f80686a85067beb3a8f9e947305a42c2bce8c81406ef0a
6
+ metadata.gz: 2cc64afce98144eaa7d6e289a12b6be726c593d1f0f60f2d32b12123d64c44a51e43b2a5e48a6e33a5630a173a98dd27e27a53cda46c27da48f490ed98c51e09
7
+ data.tar.gz: e213157c371571deb954235a07950144c61f406b7f47c7b99f137b7951bb73f7f978c4606d6d584d7b7f41df8c0bfed95d68720e06aea97b8fb14254ccc3d908
data/lib/locales/pagy.yml CHANGED
@@ -22,5 +22,27 @@ en:
22
22
  items:
23
23
  show: "Show"
24
24
  items: "items per page"
25
+ tr:
26
+ pagy:
27
+ nav:
28
+ prev: "‹ Önceki"
29
+ next: "Sonraki ›"
30
+ gap: "…"
31
+ info:
32
+ single_page:
33
+ zero: "Hiç %{item_name} bulunamadı."
34
+ one: "<b>1</b> %{item_name} gösteriliyor."
35
+ other: "Toplam <b>%{count}</b> %{item_name} gösteriliyor."
36
+ multiple_pages: "<b>%{count}</b> %{item_name} içerisinden <b>%{from}-%{to}</b> kadarı gösteriliyor."
37
+ item_name:
38
+ zero: "kayıt"
39
+ one: "kayıt"
40
+ other: "kayıt"
41
+ compact:
42
+ page: "Sayfa"
43
+ of: "/"
44
+ items:
45
+ show: "Göster"
46
+ items: "sayfa başı"
25
47
 
26
48
  # PR for other languages are very welcome. Thanks!
data/lib/pagy.rb CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  require 'pathname'
5
5
 
6
- class Pagy ; VERSION = '0.11.2'
6
+ class Pagy ; VERSION = '0.12.0'
7
7
 
8
8
  class OutOfRangeError < StandardError; attr_reader :pagy; def initialize(pagy) @pagy = pagy end; end
9
9
 
@@ -0,0 +1,27 @@
1
+ # See the Pagy documentation: https://ddnexus.github.io/pagy/extras/bulma
2
+ # frozen_string_literal: true
3
+
4
+ class Pagy
5
+ # Add nav helper for Bulma pagination
6
+ module Frontend
7
+
8
+ def pagy_nav_bulma(pagy)
9
+ html, link, p_prev, p_next = +'', pagy_link_proc(pagy), pagy.prev, pagy.next
10
+
11
+ html << (p_prev ? link.call(p_prev, pagy_t('pagy.nav.prev'), 'class="pagination-previous" aria-label="previous page"')
12
+ : %(<a class="pagination-previous" disabled>#{pagy_t('pagy.nav.prev')}</a>))
13
+ html << (p_next ? link.call(p_next, pagy_t('pagy.nav.next'), 'class="pagination-next" aria-label="next page"')
14
+ : %(<a class="pagination-next" disabled>#{pagy_t('pagy.nav.next')}</a>))
15
+ html << '<ul class="pagination-list">'
16
+ pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
17
+ html << if item.is_a?(Integer); %(<li>#{link.call item, item, %(class="pagination-link" aria-label="goto page #{item}") }</li>) # page link
18
+ elsif item.is_a?(String) ; %(<li>#{link.call item, item, %(class="pagination-link is-current" aria-label="page #{item}" aria-current="page")}</li>) # active page
19
+ elsif item == :gap ; %(<li><span class="pagination-ellipsis">#{pagy_t('pagy.nav.gap')}</span></li>) # page gap
20
+ end
21
+ end
22
+ html << '</ul>'
23
+ %(<nav class="pagy-nav-bulma pagination is-centered" role="navigation" aria-label="pagination">#{html}</nav>)
24
+ end
25
+
26
+ end
27
+ end
@@ -38,5 +38,22 @@ class Pagy
38
38
  html << %(</div></nav><script type="application/json" class="pagy-compact-json">["#{id}", "#{MARKER}", "#{p_page}"]</script>)
39
39
  end
40
40
 
41
+ # Compact pagination for Bulma: it returns the html with the series of links to the pages
42
+ # we use a numeric input tag to set the page and the Pagy.compact javascript to navigate
43
+ def pagy_nav_compact_bulma(pagy, id=caller(1,1)[0].hash)
44
+ html, link, p_prev, p_next, p_page, p_pages = +'', pagy_link_proc(pagy), pagy.prev, pagy.next, pagy.page, pagy.pages
45
+
46
+ html << %(<nav id="pagy-nav-#{id}" class="pagy-nav-compact-bulma" role="navigation" aria-label="pagination">)
47
+ html << link.call(MARKER, '', 'style="display: none;"')
48
+ html << %(<div class="field is-grouped is-grouped-centered" role="group">)
49
+ html << (p_prev ? %(<p class="control">#{link.call(p_prev, pagy_t('pagy.nav.prev'), 'class="button" aria-label="previous page"')}</p>)
50
+ : %(<p class="control"><a class="button" disabled>#{pagy_t('pagy.nav.prev')}</a></p>))
51
+ input = %(<input class="input" type="number" min="1" max="#{p_pages}" value="#{p_page}" style="padding: 0; text-align: center; width: #{p_pages.to_s.length+1}rem;">)
52
+ html << %(<div class="pagy-compact-input control level is-mobile">#{pagy_t('pagy.compact.page')}&nbsp;#{input}&nbsp;#{pagy_t('pagy.compact.of')} #{p_pages}</div>)
53
+ html << (p_next ? %(<p class="control">#{link.call(p_next, pagy_t('pagy.nav.next'), 'class="button" aria-label="next page"')}</p>)
54
+ : %(<p class="control"><a class="button" disabled>#{pagy_t('pagy.nav.next')}</a></p>))
55
+ html << %(</div></nav><script type="application/json" class="pagy-compact-json">["#{id}", "#{MARKER}", "#{p_page}"]</script>)
56
+ end
57
+
41
58
  end
42
59
  end
@@ -5,7 +5,7 @@
5
5
  # Extras
6
6
  # See https://ddnexus.github.io/pagy/extras
7
7
 
8
- # Array: Paginate arrays efficiently avoiding expensive array-wrapping and wihout overriding
8
+ # Array: Paginate arrays efficiently avoiding expensive array-wrapping and without overriding
9
9
  # See https://ddnexus.github.io/pagy/extras/array
10
10
  # require 'pagy/extras/array'
11
11
 
@@ -17,10 +17,6 @@
17
17
  # See https://ddnexus.github.io/pagy/extras/compact
18
18
  # require 'pagy/extras/compact'
19
19
 
20
- # I18n: Use the `I18n` gem instead of the pagy implementation
21
- # See https://ddnexus.github.io/pagy/extras/i18n
22
- # require 'pagy/extras/i18n'
23
-
24
20
  # Items: Handle the page :items passed with the params
25
21
  # See https://ddnexus.github.io/pagy/extras/items
26
22
  # require 'pagy/extras/items'
@@ -53,12 +49,19 @@
53
49
  # Pagy::VARS[:item_path] = 'activerecord.models.product' # example
54
50
 
55
51
 
56
- # Pagy::Frontend::I18N Constant
57
- # See https://ddnexus.github.io/pagy/api/frontend#i18n
58
- # Pagy::Frontend::I18N.load(file:'path/to/dictionary.yml', language:'en') # load a custom file
59
- # Pagy::Frontend::I18N[:plural] = -> (count) {(['zero', 'one'][count] || 'other') # default
60
-
61
-
62
52
  # Rails: extras assets path required by compact, items and responsive extras
63
53
  # See https://ddnexus.github.io/pagy/extras
64
54
  # Rails.application.config.assets.paths << Pagy.root.join('pagy', 'extras', 'javascripts')
55
+
56
+
57
+ # I18n: faster internal pagy implementation (does not use the I18n gem)
58
+ # Use only for single language apps that don't need dynamic translation between multiple languages
59
+ # See https://ddnexus.github.io/pagy/api/frontend#i18n
60
+ # Notice: Do not use the following 2 lines if you use the i18n extra below
61
+ # Pagy::Frontend::I18N.load(file:'path/to/dictionary.yml', language:'en') # load a custom file
62
+ # Pagy::Frontend::I18N[:plural] = -> (count) {(['zero', 'one'][count] || 'other')} # default
63
+
64
+ # I18n: Use the `I18n` gem instead of the pagy implementation
65
+ # (slower but allows dynamic translation between multiple languages)
66
+ # See https://ddnexus.github.io/pagy/extras/i18n
67
+ # require 'pagy/extras/i18n'
@@ -2,6 +2,8 @@
2
2
 
3
3
  function Pagy(){}
4
4
 
5
+ Pagy.windowListeners = [];
6
+
5
7
  Pagy.addInputEventListeners = function(input, handler){
6
8
  // select the content on click: easier for typing a number
7
9
  input.addEventListener('click', function(){ this.select() });
@@ -44,30 +46,33 @@ Pagy.items = function(id, marker, from){
44
46
 
45
47
  Pagy.responsive = function(id, tags, widths, series){
46
48
  var pagyNav = document.getElementById('pagy-nav-'+id),
47
- pagyBox = pagyNav.firstChild || pagyNav,
48
49
  pagyParent = pagyNav.parentElement,
49
50
  lastWidth = undefined,
50
51
  render = function(){
51
52
  var parentWidth = parseInt(pagyParent.clientWidth),
52
53
  width = widths.find(function(w){return parentWidth > w});
53
54
  if (width !== lastWidth) {
54
- while (pagyBox.firstChild) { pagyBox.removeChild(pagyBox.firstChild) }
55
- var html = tags['prev'];
55
+ while (pagyNav.firstChild) { pagyNav.removeChild(pagyNav.firstChild) }
56
+ var html = tags['before'];
56
57
  series[width].forEach(function(item){html += tags[item]});
57
- html += tags['next'];
58
- pagyBox.insertAdjacentHTML('beforeend', html);
58
+ html += tags['after'];
59
+ pagyNav.insertAdjacentHTML('beforeend', html);
59
60
  lastWidth = width;
60
61
  }
61
- };
62
- if (window.attachEvent) { window.attachEvent('onresize', render) }
63
- else if (window.addEventListener) { window.addEventListener('resize', render, true) }
62
+ }.bind(this);
63
+ window.addEventListener('resize', render, true);
64
+ Pagy.windowListeners.push(render);
64
65
  render();
65
66
  };
66
67
 
67
68
  Pagy.init = function(){
69
+ // we need to explicitly remove the window listeners because turbolinks persists the window object
70
+ Pagy.windowListeners.forEach(function(l){window.removeEventListener('resize', l, true)});
71
+ Pagy.windowListeners = [];
68
72
  ['compact', 'items', 'responsive'].forEach(function(name){
69
- Array.from(document.getElementsByClassName("pagy-"+name+"-json")).forEach(function(json) {
70
- Pagy[name].apply(null, JSON.parse(json.innerHTML))
71
- })
73
+ var json = document.getElementsByClassName("pagy-"+name+"-json");
74
+ for (var i = 0, len = json.length; i < len; i++) {
75
+ Pagy[name].apply(null, JSON.parse(json[i].innerHTML))
76
+ }
72
77
  })
73
78
  };
@@ -36,16 +36,16 @@ class Pagy
36
36
  def pagy_nav_responsive(pagy, id=caller(1,1)[0].hash)
37
37
  tags, link, p_prev, p_next, responsive = {}, pagy_link_proc(pagy), pagy.prev, pagy.next, pagy.responsive
38
38
 
39
- tags['prev'] = (p_prev ? %(<span class="page prev">#{link.call p_prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"'}</span> )
40
- : %(<span class="page prev disabled">#{pagy_t('pagy.nav.prev')}</span> ))
39
+ tags['before'] = (p_prev ? %(<span class="page prev">#{link.call p_prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"'}</span> )
40
+ : %(<span class="page prev disabled">#{pagy_t('pagy.nav.prev')}</span> ))
41
41
  responsive[:items].each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
42
42
  tags[item.to_s] = if item.is_a?(Integer); %(<span class="page">#{link.call item}</span> ) # page link
43
43
  elsif item.is_a?(String) ; %(<span class="page active">#{item}</span> ) # current page
44
44
  elsif item == :gap ; %(<span class="page gap">#{pagy_t('pagy.nav.gap')}</span> ) # page gap
45
45
  end
46
46
  end
47
- tags['next'] = (p_next ? %(<span class="page next">#{link.call p_next, pagy_t('pagy.nav.next'), 'aria-label="next"'}</span>)
48
- : %(<span class="page next disabled">#{pagy_t('pagy.nav.next')}</span>))
47
+ tags['after'] = (p_next ? %(<span class="page next">#{link.call p_next, pagy_t('pagy.nav.next'), 'aria-label="next"'}</span>)
48
+ : %(<span class="page next disabled">#{pagy_t('pagy.nav.next')}</span>))
49
49
  script = %(<script type="application/json" class="pagy-responsive-json">["#{id}", #{tags.to_json}, #{responsive[:widths].to_json}, #{responsive[:series].to_json}]</script>)
50
50
  %(<nav id="pagy-nav-#{id}" class="pagy-nav-responsive pagination" role="navigation" aria-label="pager"></nav>#{script})
51
51
  end
@@ -55,18 +55,41 @@ class Pagy
55
55
  def pagy_nav_responsive_bootstrap(pagy, id=caller(1,1)[0].hash)
56
56
  tags, link, p_prev, p_next, responsive = {}, pagy_link_proc(pagy, 'class="page-link"'), pagy.prev, pagy.next, pagy.responsive
57
57
 
58
- tags['prev'] = (p_prev ? %(<li class="page-item prev">#{link.call p_prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"'}</li>)
59
- : %(<li class="page-item prev disabled"><a href="#" class="page-link">#{pagy_t('pagy.nav.prev')}</a></li>))
58
+ tags['before'] = +'<ul class="pagination">'
59
+ tags['before'] << (p_prev ? %(<li class="page-item prev">#{link.call p_prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"'}</li>)
60
+ : %(<li class="page-item prev disabled"><a href="#" class="page-link">#{pagy_t('pagy.nav.prev')}</a></li>))
60
61
  responsive[:items].each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
61
62
  tags[item.to_s] = if item.is_a?(Integer); %(<li class="page-item">#{link.call item}</li>) # page link
62
63
  elsif item.is_a?(String) ; %(<li class="page-item active">#{link.call item}</li>) # active page
63
64
  elsif item == :gap ; %(<li class="page-item gap disabled"><a href="#" class="page-link">#{pagy_t('pagy.nav.gap')}</a></li>) # page gap
64
65
  end
65
66
  end
66
- tags['next'] = (p_next ? %(<li class="page-item next">#{link.call p_next, pagy_t('pagy.nav.next'), 'aria-label="next"'}</li>)
67
- : %(<li class="page-item next disabled"><a href="#" class="page-link">#{pagy_t('pagy.nav.next')}</a></li>))
67
+ tags['after'] = +(p_next ? %(<li class="page-item next">#{link.call p_next, pagy_t('pagy.nav.next'), 'aria-label="next"'}</li>)
68
+ : %(<li class="page-item next disabled"><a href="#" class="page-link">#{pagy_t('pagy.nav.next')}</a></li>))
69
+ tags['after'] << '</ul>'
68
70
  script = %(<script type="application/json" class="pagy-responsive-json">["#{id}", #{tags.to_json}, #{responsive[:widths].to_json}, #{responsive[:series].to_json}]</script>)
69
- %(<nav id="pagy-nav-#{id}" class="pagy-nav-responsive-bootstrap pagination" role="navigation" aria-label="pager"><ul class="pagination"></ul></nav>#{script})
71
+ %(<nav id="pagy-nav-#{id}" class="pagy-nav-responsive-bootstrap pagination" role="navigation" aria-label="pager"></nav>#{script})
72
+ end
73
+
74
+ # Responsive pagination for Bulma: it returns the html with the series of links to the pages
75
+ # rendered by the Pagy.responsive javascript
76
+ def pagy_nav_responsive_bulma(pagy, id=caller(1,1)[0].hash)
77
+ tags, link, p_prev, p_next, responsive = {}, pagy_link_proc(pagy), pagy.prev, pagy.next, pagy.responsive
78
+
79
+ tags['before'] = +(p_prev ? link.call(p_prev, pagy_t('pagy.nav.prev'), 'class="pagination-previous" aria-label="previous page"')
80
+ : %(<a class="pagination-previous" disabled>#{pagy_t('pagy.nav.prev')}</a>))
81
+ tags['before'] << (p_next ? link.call(p_next, pagy_t('pagy.nav.next'), 'class="pagination-next" aria-label="next page"')
82
+ : %(<a class="pagination-next" disabled>#{pagy_t('pagy.nav.next')}</a>))
83
+ tags['before'] << '<ul class="pagination-list">'
84
+ responsive[:items].each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
85
+ tags[item.to_s] = if item.is_a?(Integer); %(<li>#{link.call item, item, %(class="pagination-link" aria-label="goto page #{item}")}</li>)
86
+ elsif item.is_a?(String) ; %(<li>#{link.call item, item, %(class="pagination-link is-current" aria-current="page" aria-label="page #{item}")}</li>)
87
+ elsif item == :gap ; %(<li><span class="pagination-ellipsis">#{pagy_t('pagy.nav.gap')}</span></li>)
88
+ end
89
+ end
90
+ tags['after'] = '</ul>'
91
+ script = %(<script type="application/json" class="pagy-responsive-json">["#{id}", #{tags.to_json}, #{responsive[:widths].to_json}, #{responsive[:series].to_json}]</script>)
92
+ %(<nav id="pagy-nav-#{id}" class="pagy-nav-bulma pagination is-centered" role="navigation" aria-label="pagination"></nav>#{script})
70
93
  end
71
94
 
72
95
  end
@@ -0,0 +1,24 @@
1
+ <%#
2
+ This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
3
+ calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
4
+
5
+ The link variable is set to a proc that returns the link tag.
6
+ Usage: link.call( page_number [, text [, extra_attributes_string ]])
7
+ -%>
8
+ <% link = pagy_link_proc(pagy) -%>
9
+ <%# -%><nav class="pagy-nav-bulma pagination is-centered" role="navigation" aria-label="pagination">
10
+ <% if pagy.prev -%> <%== link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'class="pagination-previous" aria-label="previous page"') %>
11
+ <% else -%> <a class="pagination-previous" disabled><%== pagy_t('pagy.nav.prev') %></a>
12
+ <% end -%>
13
+ <% if pagy.next -%> <%== link.call(pagy.next, pagy_t('pagy.nav.next'), 'class="pagination-next" aria-label="next page"') %>
14
+ <% else -%> <a class="pagination-next" disabled><%== pagy_t('pagy.nav.next') %></a>
15
+ <% end -%>
16
+ <%# -%> <ul class="pagination-list">
17
+ <% pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] -%>
18
+ <% if item.is_a?(Integer) -%> <li><%== link.call item, item, %(class="pagination-link" aria-label="goto page #{item}") %></li>
19
+ <% elsif item.is_a?(String) -%> <li><%== link.call item, item, %(class="pagination-link is-current" aria-label="page #{item}" aria-current="page") %></li>
20
+ <% elsif item == :gap -%> <li><span class="pagination-ellipsis"><%== pagy_t('pagy.nav.gap') %></span></li>
21
+ <% end -%>
22
+ <% end -%>
23
+ <%# -%> </ul>
24
+ <%# -%></nav>
@@ -0,0 +1,32 @@
1
+ -# This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
2
+ -# calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
3
+
4
+ -# The link variable is set to a proc that returns the link tag.
5
+ -# Usage: link.call( page_number [, text [, extra_attributes_string ]])
6
+
7
+ - link = pagy_link_proc(pagy)
8
+
9
+ %nav.pagy-nav-bulma.pagination.is-centered{:role => "navigation", "aria-label" => "pagination"}
10
+
11
+ - if pagy.prev
12
+ != link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'class="pagination-previous" aria-label="previous page"')
13
+ - else
14
+ %a.pagination-previous{:disabled => "disabled"}!= pagy_t('pagy.nav.prev')
15
+
16
+ - if pagy.next
17
+ != link.call(pagy.next, pagy_t('pagy.nav.next'), 'class="pagination-next" aria-label="next page"')
18
+ - else
19
+ %a.pagination-next{:disabled => "disabled"}!= pagy_t('pagy.nav.next')
20
+
21
+ %ul.pagination-list
22
+
23
+ - pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
24
+ - if item.is_a?(Integer) # page link
25
+ %li!= link.call item, item, %(class="pagination-link" aria-label="goto page #{item}")
26
+
27
+ - elsif item.is_a?(String) # current page
28
+ %li!= link.call item, item, %(class="pagination-link is-current" aria-label="page #{item}" aria-current="page")
29
+
30
+ - elsif item == :gap # page gap
31
+ %li
32
+ %span.pagination-ellipsis!= pagy_t('pagy.nav.gap')
@@ -0,0 +1,32 @@
1
+ / This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
2
+ / calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
3
+
4
+ / The link variable is set to a proc that returns the link tag.
5
+ / Usage: link.call( page_number [, text [, extra_attributes_string ]])
6
+
7
+ - link = pagy_link_proc(pagy)
8
+
9
+ nav.pagy-nav-bulma.pagination.is-centered role="navigation" aria-label="pagination"
10
+
11
+ - if pagy.prev
12
+ == link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'class="pagination-previous" aria-label="previous page"')
13
+ - else
14
+ a.pagination-previous disabled="disabled" == pagy_t('pagy.nav.prev')
15
+
16
+ - if pagy.next
17
+ == link.call(pagy.next, pagy_t('pagy.nav.next'), 'class="pagination-next" aria-label="next page"')
18
+ - else
19
+ a.pagination-next disabled="disabled" == pagy_t('pagy.nav.next')
20
+
21
+ ul.pagination-list
22
+
23
+ - pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
24
+ - if item.is_a?(Integer) # page link
25
+ li == link.call item, item, %(class="pagination-link" aria-label="goto page #{item}")
26
+
27
+ - elsif item.is_a?(String) # current page
28
+ li == link.call item, item, %(class="pagination-link is-current" aria-label="page #{item}" aria-current="page")
29
+
30
+ - elsif item == :gap # page gap
31
+ li
32
+ span.pagination-ellipsis == pagy_t('pagy.nav.gap')
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: 0.11.2
4
+ version: 0.12.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: 2018-07-01 00:00:00.000000000 Z
11
+ date: 2018-07-09 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,
@@ -27,6 +27,7 @@ files:
27
27
  - lib/pagy/backend.rb
28
28
  - lib/pagy/extras/array.rb
29
29
  - lib/pagy/extras/bootstrap.rb
30
+ - lib/pagy/extras/bulma.rb
30
31
  - lib/pagy/extras/compact.rb
31
32
  - lib/pagy/extras/i18n.rb
32
33
  - lib/pagy/extras/initializer_example.rb
@@ -39,6 +40,9 @@ files:
39
40
  - lib/pagy/extras/templates/nav_bootstrap.html.erb
40
41
  - lib/pagy/extras/templates/nav_bootstrap.html.haml
41
42
  - lib/pagy/extras/templates/nav_bootstrap.html.slim
43
+ - lib/pagy/extras/templates/nav_bulma.html.erb
44
+ - lib/pagy/extras/templates/nav_bulma.html.haml
45
+ - lib/pagy/extras/templates/nav_bulma.html.slim
42
46
  - lib/pagy/frontend.rb
43
47
  - pagy.gemspec
44
48
  homepage: https://github.com/ddnexus/pagy