pagy-extras 0.1.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 +7 -0
- data/LICENSE.txt +21 -0
- data/lib/javascripts/pagy-compact.js +15 -0
- data/lib/javascripts/pagy-responsive.js +24 -0
- data/lib/pagy-extras.rb +12 -0
- data/lib/pagy-extras/bootstrap.rb +25 -0
- data/lib/pagy-extras/compact.rb +51 -0
- data/lib/pagy-extras/responsive.rb +60 -0
- data/lib/templates/nav_bootstrap.html.erb +24 -0
- data/lib/templates/nav_bootstrap.html.haml +34 -0
- data/lib/templates/nav_bootstrap.html.slim +34 -0
- data/pagy-extras.gemspec +26 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e8559ae8ed8572a4a9bc2d6c021a073cb80ed844710735b3aea1ad5792ef139f
|
4
|
+
data.tar.gz: bca19b74ca938d5bfa5a7f1e6f6b7dfc9d127ec84702464c2fad33e508a676d4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 03f6a0ec22f9008eac34d6e057235bf823695a4b22110f1c3e916a018f0d3de5d70d2f3693c06b6705f2676e31c7e9e7f33eab6727c0f8a3bdaa239891771f5a
|
7
|
+
data.tar.gz: 362938896a1418e460b6b2a7338523257965650a970f0dd0343a2d6c189c921ebe952317b42e4de374d7d7c65bc00edbe49ef088d7215b021ed4bdd24738dae2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017-2018 Domizio Demichelis
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
function PagyCompact(id, marker, page){
|
2
|
+
var pagyNav = document.getElementById('pagy-nav-'+id),
|
3
|
+
input = pagyNav.getElementsByTagName('input')[0],
|
4
|
+
link = pagyNav.getElementsByTagName('a')[0];
|
5
|
+
|
6
|
+
this.go = function(){
|
7
|
+
if (page !== input.value) {
|
8
|
+
var href = link.getAttribute('href').replace(marker, input.value);
|
9
|
+
link.setAttribute('href', href);
|
10
|
+
link.click();
|
11
|
+
}
|
12
|
+
};
|
13
|
+
|
14
|
+
input.addEventListener("focusout", this.go);
|
15
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
function PagyResponsive(id, items, widths, series){
|
2
|
+
var pagyNav = document.getElementById('pagy-nav-'+id),
|
3
|
+
pagyBox = pagyNav.firstChild || pagyNav,
|
4
|
+
pagyParent = pagyNav.parentElement,
|
5
|
+
lastWidth = undefined;
|
6
|
+
|
7
|
+
this.render = function(){
|
8
|
+
var parentWidth = parseInt(pagyParent.clientWidth),
|
9
|
+
width = widths.find(function(w){return parentWidth > w});
|
10
|
+
if (width !== lastWidth) {
|
11
|
+
while (pagyBox.firstChild) { pagyBox.removeChild(pagyBox.firstChild) }
|
12
|
+
var tags = items['prev'];
|
13
|
+
series[width].forEach(function(item){tags += items[item]});
|
14
|
+
tags += items['next'];
|
15
|
+
pagyBox.insertAdjacentHTML('beforeend', tags);
|
16
|
+
lastWidth = width;
|
17
|
+
}
|
18
|
+
};
|
19
|
+
|
20
|
+
if (window.attachEvent) { window.attachEvent('onresize', this.render) }
|
21
|
+
else if (window.addEventListener) { window.addEventListener('resize', this.render, true) }
|
22
|
+
|
23
|
+
this.render();
|
24
|
+
};
|
data/lib/pagy-extras.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# See the Pagy Extras documentation: https://ddnexus.github.io/pagy/pagy-extras
|
2
|
+
|
3
|
+
require 'pagy'
|
4
|
+
|
5
|
+
module Pagy
|
6
|
+
def self.extras_root; Pathname.new(__FILE__).dirname end
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'pagy-extras/bootstrap'
|
10
|
+
require 'pagy-extras/compact'
|
11
|
+
require 'pagy-extras/responsive'
|
12
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# See the Pagy Extras documentation: https://ddnexus.github.io/pagy/pagy-extras
|
2
|
+
|
3
|
+
class Pagy
|
4
|
+
module Frontend
|
5
|
+
|
6
|
+
# Pagination for bootstrap: it returns the html with the series of links to the pages
|
7
|
+
def pagy_nav_bootstrap(pagy)
|
8
|
+
tags = ''; link = pagy_link_proc(pagy, 'class="page-link"'.freeze)
|
9
|
+
|
10
|
+
tags << (pagy.prev ? %(<li class="page-item prev">#{link.call pagy.prev, pagy_t('pagy.nav.prev'.freeze), 'aria-label="previous"'.freeze}</li>)
|
11
|
+
: %(<li class="page-item prev disabled"><a href="#" class="page-link">#{pagy_t('pagy.nav.prev'.freeze)}</a></li>))
|
12
|
+
pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
|
13
|
+
tags << if item.is_a?(Integer); %(<li class="page-item">#{link.call item}</li>) # page link
|
14
|
+
elsif item.is_a?(String) ; %(<li class="page-item active">#{link.call item}</li>) # active page
|
15
|
+
elsif item == :gap ; %(<li class="page-item gap disabled"><a href="#" class="page-link">#{pagy_t('pagy.nav.gap'.freeze)}</a></li>) # page gap
|
16
|
+
end
|
17
|
+
end
|
18
|
+
tags << (pagy.next ? %(<li class="page-item next">#{link.call pagy.next, pagy_t('pagy.nav.next'.freeze), 'aria-label="next"'.freeze}</li>)
|
19
|
+
: %(<li class="page-item next disabled"><a href="#" class="page-link">#{pagy_t('pagy.nav.next'.freeze)}</a></li>))
|
20
|
+
%(<nav class="pagy-nav-boostrap pagination" role="navigation" aria-label="pager"><ul class="pagination">#{tags}</ul></nav>)
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# See the Pagy Extras documentation: https://ddnexus.github.io/pagy/pagy-extras
|
2
|
+
|
3
|
+
class Pagy
|
4
|
+
|
5
|
+
module Frontend
|
6
|
+
|
7
|
+
# Generic compact pagination: it returns the html with the series of links to the pages
|
8
|
+
# we use a numeric input tag to set the page and the PagyCompact javascript to navigate
|
9
|
+
def pagy_nav_compact(pagy, id=caller(1,1)[0].hash)
|
10
|
+
tags = ''; link = pagy_link_proc(pagy)
|
11
|
+
|
12
|
+
tags << %(<nav id="pagy-nav-#{id}" class="pagy-nav-compact pagination" role="navigation" aria-label="pager">)
|
13
|
+
|
14
|
+
tags << link.call(MARKER, '', %(style="display: none;" ))
|
15
|
+
tags << (pagy.prev ? %(<span class="page prev">#{link.call pagy.prev, pagy_t('pagy.nav.prev'.freeze), 'aria-label="previous"'.freeze}</span> )
|
16
|
+
: %(<span class="page prev disabled">#{pagy_t('pagy.nav.prev'.freeze)}</span> ))
|
17
|
+
|
18
|
+
input = %(<input type="number" min="1" max="#{pagy.last}" value="#{pagy.page}" style="padding: 0; text-align: center; width: #{pagy.pages.to_s.length+1}rem;">)
|
19
|
+
tags << %(<span class="pagy-compact-input" style="margin: 0 0.6rem;">#{pagy_t('pagy.compact.page'.freeze)} #{input} #{pagy_t('pagy.compact.of'.freeze)} #{pagy.pages}</span> )
|
20
|
+
|
21
|
+
tags << (pagy.next ? %(<span class="page next">#{link.call pagy.next, pagy_t('pagy.nav.next'.freeze), 'aria-label="next"'.freeze}</span>)
|
22
|
+
: %(<span class="page next disabled">#{pagy_t('pagy.nav.next'.freeze)}</span>))
|
23
|
+
|
24
|
+
tags << %(</nav><script>PagyCompact('#{id}', '#{MARKER}', '#{pagy.page}');</script>)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Compact pagination for bootstrap: it returns the html with the series of links to the pages
|
28
|
+
# we use a numeric input tag to set the page and the PagyCompact javascript to navigate
|
29
|
+
def pagy_nav_bootstrap_compact(pagy, id=caller(1,1)[0].hash)
|
30
|
+
tags = ''; link = pagy_link_proc(pagy, 'class="btn btn-primary"')
|
31
|
+
|
32
|
+
tags << %(<nav id="pagy-nav-#{id}" class="pagy-nav-bootstrap-compact pagination" role="navigation" aria-label="pager">)
|
33
|
+
|
34
|
+
tags << link.call(MARKER, '', %(style="display: none;" ))
|
35
|
+
|
36
|
+
tags << %(<div class="btn-group" role="group">)
|
37
|
+
tags << (pagy.prev ? link.call(pagy.prev, pagy_t('pagy.nav.prev'.freeze), 'aria-label="previous"'.freeze)
|
38
|
+
: %(<a class="btn btn-primary disabled" href="#">#{pagy_t('pagy.nav.prev'.freeze)}</a>))
|
39
|
+
|
40
|
+
input = %(<input type="number" min="1" max="#{pagy.last}" value="#{pagy.page}" style="padding: 0; border: none; text-align: center; width: #{pagy.pages.to_s.length+1}rem;">)
|
41
|
+
tags << %(<button type="button" class="pagy-compact-input btn btn-primary disabled">#{pagy_t('pagy.compact.page'.freeze)} #{input} #{pagy_t('pagy.compact.of'.freeze)} #{pagy.pages}</button>)
|
42
|
+
|
43
|
+
tags << (pagy.next ? link.call(pagy.next, pagy_t('pagy.nav.next'.freeze), 'aria-label="next"'.freeze)
|
44
|
+
: %(<a class="btn btn-primary disabled" href="#">#{pagy_t('pagy.nav.next'.freeze)}</a>))
|
45
|
+
|
46
|
+
tags << %(</div></nav><script>PagyCompact('#{id}', '#{MARKER}', '#{pagy.page}');</script>)
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# See the Pagy Extras documentation: https://ddnexus.github.io/pagy/pagy-extras
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
class Pagy
|
6
|
+
|
7
|
+
VARS[:breakpoints] = { 0 => [1,4,4,1] }
|
8
|
+
|
9
|
+
def responsive
|
10
|
+
@responsive ||= {items: [], series: {}, widths:[]}.tap do |r|
|
11
|
+
@vars[:breakpoints].key?(0) || raise(ArgumentError, "expected :breakpoints to contain the 0 size; got #{@vars[:breakpoint].inspect}")
|
12
|
+
@vars[:breakpoints].each {|width, size| r[:items] |= r[:series][width] = series(size)}
|
13
|
+
r[:widths] = r[:series].keys.sort!{|a,b| b <=> a}
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
module Frontend
|
19
|
+
|
20
|
+
# Generic responsive pagination: it returns the html with the series of links to the pages
|
21
|
+
# we build the tags as a json object string and render them with the PagyResponsive javascript
|
22
|
+
def pagy_nav_responsive(pagy, id=caller(1,1)[0].hash)
|
23
|
+
tags = '{'; link = pagy_link_proc(pagy); responsive = pagy.responsive
|
24
|
+
|
25
|
+
tags << (pagy.prev ? %('prev':'<span class="page prev">#{link.call pagy.prev, pagy_t('pagy.nav.prev'.freeze), 'aria-label="previous"'.freeze}</span> ',)
|
26
|
+
: %('prev':'<span class="page prev disabled">#{pagy_t('pagy.nav.prev'.freeze)}</span> ',))
|
27
|
+
responsive[:items].each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
|
28
|
+
tags << if item.is_a?(Integer); %('#{item}':'<span class="page">#{link.call item}</span> ',) # page link
|
29
|
+
elsif item.is_a?(String) ; %('#{item}':'<span class="page active">#{item}</span> ',) # current page
|
30
|
+
elsif item == :gap ; %('#{item}':'<span class="page gap">#{pagy_t('pagy.nav.gap'.freeze)}</span> ',) # page gap
|
31
|
+
end
|
32
|
+
end
|
33
|
+
tags << (pagy.next ? %('next':'<span class="page next">#{link.call pagy.next, pagy_t('pagy.nav.next'.freeze), 'aria-label="next"'.freeze}</span>'})
|
34
|
+
: %('next':'<span class="page next disabled">#{pagy_t('pagy.nav.next'.freeze)}</span>'}))
|
35
|
+
script = %(<script>PagyResponsive('#{id}', #{tags}, #{responsive[:widths].to_json}, #{responsive[:series].to_json});</script>)
|
36
|
+
%(<nav id="pagy-nav-#{id}" class="pagy-nav-responsive pagination" role="navigation" aria-label="pager"></nav>#{script})
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
# Responsive pagination for bootstrap: it returns the html with the series of links to the pages
|
41
|
+
# we build the tags as a json object string and render them with the PagyResponsive javascript
|
42
|
+
def pagy_nav_bootstrap_responsive(pagy, id=caller(1,1)[0].hash)
|
43
|
+
tags = '{'; link = pagy_link_proc(pagy, 'class="page-link"'.freeze); responsive = pagy.responsive
|
44
|
+
|
45
|
+
tags << (pagy.prev ? %('prev':'<li class="page-item prev">#{link.call pagy.prev, pagy_t('pagy.nav.prev'.freeze), 'aria-label="previous"'.freeze}</li>',)
|
46
|
+
: %('prev':'<li class="page-item prev disabled"><a href="#" class="page-link">#{pagy_t('pagy.nav.prev'.freeze)}</a></li>',))
|
47
|
+
responsive[:items].each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
|
48
|
+
tags << if item.is_a?(Integer); %('#{item}':'<li class="page-item">#{link.call item}</li>',) # page link
|
49
|
+
elsif item.is_a?(String) ; %('#{item}':'<li class="page-item active">#{link.call item}</li>',) # active page
|
50
|
+
elsif item == :gap ; %('#{item}':'<li class="page-item gap disabled"><a href="#" class="page-link">#{pagy_t('pagy.nav.gap'.freeze)}</a></li>',) # page gap
|
51
|
+
end
|
52
|
+
end
|
53
|
+
tags << (pagy.next ? %('next':'<li class="page-item next">#{link.call pagy.next, pagy_t('pagy.nav.next'.freeze), 'aria-label="next"'.freeze}</li>'})
|
54
|
+
: %('next':'<li class="page-item next disabled"><a href="#" class="page-link">#{pagy_t('pagy.nav.next'.freeze)}</a></li>'}))
|
55
|
+
script = %(<script>PagyResponsive('#{id}', #{tags}, #{responsive[:widths].to_json}, #{responsive[:series].to_json});</script>)
|
56
|
+
%(<nav id="pagy-nav-#{id}" class="pagy-nav-bootstrap-responsive pagination" role="navigation" aria-label="pager"><ul class="pagination"></ul></nav>#{script})
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
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 ("‹ Prev", "Next ›", "…").
|
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, 'class="page-link"') -%>
|
9
|
+
<%# -%><nav aria-label="pager" class="pagy-nav-bootstrap pagination" role="navigation">
|
10
|
+
<%# -%> <ul class="pagination">
|
11
|
+
<% if pagy.prev -%> <li class="page-item prev"><%== link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"') %></li>
|
12
|
+
<% else -%> <li class="page-item prev disabled"><a href="#" class="page-link"><%== pagy_t('pagy.nav.prev') %></a></li>
|
13
|
+
<% end -%>
|
14
|
+
<% pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] -%>
|
15
|
+
<% if item.is_a?(Integer) -%> <li class="page-item"><%== link.call(item) %></li>
|
16
|
+
<% elsif item.is_a?(String) -%> <li class="page-item active"><%== link.call(item) %></li>
|
17
|
+
<% elsif item == :gap -%> <li class="page-item disabled gap"><a href="#" class="page-link"><%== pagy_t('pagy.nav.gap') %></a></li>
|
18
|
+
<% end -%>
|
19
|
+
<% end -%>
|
20
|
+
<% if pagy.next -%> <li class="page-item next"><%== link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"') %></li>
|
21
|
+
<% else -%> <li class="page-item next disabled"><a href="#" class="page-link"><%== pagy_t('pagy.nav.next') %></a></li>
|
22
|
+
<% end -%>
|
23
|
+
<%# -%> </ul>
|
24
|
+
<%# -%></nav>
|
@@ -0,0 +1,34 @@
|
|
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 ("‹ Prev", "Next ›", "…").
|
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, 'class="page-link"')
|
8
|
+
|
9
|
+
%nav.pagy-nav-bootstrap.pagination{"aria-label" => "pager", :role => "navigation"}
|
10
|
+
|
11
|
+
%ul.pagination
|
12
|
+
|
13
|
+
- if pagy.prev
|
14
|
+
%li.page-item.prev!= link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"')
|
15
|
+
- else
|
16
|
+
%li.page-item.prev.disabled
|
17
|
+
%a.page-link{:href => '#'}!= pagy_t('pagy.nav.prev')
|
18
|
+
|
19
|
+
- pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
|
20
|
+
- if item.is_a?(Integer) # page link
|
21
|
+
%li.page-item!= link.call(item)
|
22
|
+
|
23
|
+
- elsif item.is_a?(String) # current page
|
24
|
+
%li.page-item.active!= link.call(item)
|
25
|
+
|
26
|
+
- elsif item == :gap # page gap
|
27
|
+
%li.page-item.disabled.gap
|
28
|
+
%a.page-link{:href => "#"}!= pagy_t('pagy.nav.gap')
|
29
|
+
|
30
|
+
- if pagy.next
|
31
|
+
%li.page-item.next!= link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"')
|
32
|
+
- else
|
33
|
+
%li.page-item.next.disabled
|
34
|
+
%a.page-link{:href => '#'}!= pagy_t('pagy.nav.next')
|
@@ -0,0 +1,34 @@
|
|
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 ("‹ Prev", "Next ›", "…").
|
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, 'class="page-link"')
|
8
|
+
|
9
|
+
nav.pagy-nav-bootstrap.pagination role="navigation" aria-label="pager"
|
10
|
+
|
11
|
+
ul.pagination
|
12
|
+
|
13
|
+
- if pagy.prev
|
14
|
+
li.page-item.prev == link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"')
|
15
|
+
- else
|
16
|
+
li.page-item.prev.disabled
|
17
|
+
a.page-link href="#" == pagy_t('pagy.nav.prev')
|
18
|
+
|
19
|
+
- pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
|
20
|
+
- if item.is_a?(Integer) # page link
|
21
|
+
li.page-item == link.call(item)
|
22
|
+
|
23
|
+
- elsif item.is_a?(String) # current page
|
24
|
+
li.page-item.active == link.call(item)
|
25
|
+
|
26
|
+
- elsif item == :gap # page gap
|
27
|
+
li.page-item.disabled.gap
|
28
|
+
a.page-link href="#" == pagy_t('pagy.nav.gap')
|
29
|
+
|
30
|
+
- if pagy.next
|
31
|
+
li.page-item.next == link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"')
|
32
|
+
- else
|
33
|
+
li.page-item.next.disabled
|
34
|
+
a.page-link href="#" == pagy_t('pagy.nav.next')
|
data/pagy-extras.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'date'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = 'pagy-extras'
|
8
|
+
s.version = '0.1.0'
|
9
|
+
s.authors = ['Domizio Demichelis']
|
10
|
+
s.email = ['dd.nexus@gmail.com']
|
11
|
+
s.date = Date.today.to_s
|
12
|
+
|
13
|
+
s.summary = 'Pagy extra features'
|
14
|
+
s.description = 'Pagy extra features: bootstrap, responsive, compact, ...'
|
15
|
+
s.homepage = 'https://github.com/ddnexus/pagy-extras'
|
16
|
+
s.license = 'MIT'
|
17
|
+
s.require_paths = ['lib']
|
18
|
+
|
19
|
+
s.files = `git ls-files -z`.split("\x0").select{|f| f.start_with?('lib', 'pagy-extras.gemspec', 'LICENSE') }
|
20
|
+
|
21
|
+
|
22
|
+
s.add_dependency 'pagy', '~> 0.6.0'
|
23
|
+
|
24
|
+
s.add_development_dependency 'bundler', '~> 1.16'
|
25
|
+
s.add_development_dependency 'rake', '~> 10.0'
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pagy-extras
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Domizio Demichelis
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-04-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pagy
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.6.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.6.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.16'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.16'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
description: 'Pagy extra features: bootstrap, responsive, compact, ...'
|
56
|
+
email:
|
57
|
+
- dd.nexus@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- LICENSE.txt
|
63
|
+
- lib/javascripts/pagy-compact.js
|
64
|
+
- lib/javascripts/pagy-responsive.js
|
65
|
+
- lib/pagy-extras.rb
|
66
|
+
- lib/pagy-extras/bootstrap.rb
|
67
|
+
- lib/pagy-extras/compact.rb
|
68
|
+
- lib/pagy-extras/responsive.rb
|
69
|
+
- lib/templates/nav_bootstrap.html.erb
|
70
|
+
- lib/templates/nav_bootstrap.html.haml
|
71
|
+
- lib/templates/nav_bootstrap.html.slim
|
72
|
+
- pagy-extras.gemspec
|
73
|
+
homepage: https://github.com/ddnexus/pagy-extras
|
74
|
+
licenses:
|
75
|
+
- MIT
|
76
|
+
metadata: {}
|
77
|
+
post_install_message:
|
78
|
+
rdoc_options: []
|
79
|
+
require_paths:
|
80
|
+
- lib
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
requirements: []
|
92
|
+
rubyforge_project:
|
93
|
+
rubygems_version: 2.7.4
|
94
|
+
signing_key:
|
95
|
+
specification_version: 4
|
96
|
+
summary: Pagy extra features
|
97
|
+
test_files: []
|