lib/pagy/extras/bulma.rb in pagy-1.2.1 vs lib/pagy/extras/bulma.rb in pagy-1.3
- old
+ new
@@ -22,15 +22,15 @@
end
end
html << '</ul>'
%(<nav class="pagy-nav-bulma pagy-bulma-nav pagination is-centered" role="navigation" aria-label="pagination">#{html}</nav>)
end
- Pagy.deprecate self, :pagy_nav_bulma, :pagy_bulma_nav
+ deprecate :pagy_nav_bulma, :pagy_bulma_nav
# Compact pagination for Bulma: it returns the html with the series of links to the pages
# we use a numeric input tag to set the page and the Pagy.compact javascript to navigate
- def pagy_bulma_compact_nav(pagy, id=caller(1,1)[0].hash.to_s)
+ def pagy_bulma_compact_nav(pagy, id=pagy_id)
html, link, p_prev, p_next, p_page, p_pages = +'', pagy_link_proc(pagy), pagy.prev, pagy.next, pagy.page, pagy.pages
html << %(<nav id="#{id}" class="pagy-nav-compact-bulma pagy-bulma-compact-nav" role="navigation" aria-label="pagination">)
html << link.call(MARKER, '', 'style="display: none;"')
(html << link.call(1, '', %(style="display: none;"))) if defined?(TRIM)
@@ -41,15 +41,15 @@
html << %(<div class="pagy-compact-input control level is-mobile">#{pagy_t('pagy.compact', page_input: input, count: p_page, pages: p_pages)}</div>)
html << (p_next ? %(<p class="control">#{link.call(p_next, pagy_t('pagy.nav.next'), 'class="button" aria-label="next page"')}</p>)
: %(<p class="control"><a class="button" disabled>#{pagy_t('pagy.nav.next')}</a></p>))
html << %(</div></nav>#{pagy_json_tag(:compact, id, MARKER, p_page, !!defined?(TRIM))})
end
- Pagy.deprecate self, :pagy_nav_compact_bulma, :pagy_bulma_compact_nav
+ deprecate :pagy_nav_compact_bulma, :pagy_bulma_compact_nav
# Responsive pagination for Bulma: it returns the html with the series of links to the pages
# rendered by the Pagy.responsive javascript
- def pagy_bulma_responsive_nav(pagy, id=caller(1,1)[0].hash.to_s)
+ def pagy_bulma_responsive_nav(pagy, id=pagy_id)
tags, link, p_prev, p_next, responsive = {}, pagy_link_proc(pagy), pagy.prev, pagy.next, pagy.responsive
tags['before'] = +(p_prev ? link.call(p_prev, pagy_t('pagy.nav.prev'), 'class="pagination-previous" aria-label="previous page"')
: %(<a class="pagination-previous" disabled>#{pagy_t('pagy.nav.prev')}</a>))
tags['before'] << (p_next ? link.call(p_next, pagy_t('pagy.nav.next'), 'class="pagination-next" aria-label="next page"')
@@ -63,9 +63,9 @@
end
tags['after'] = '</ul>'
script = pagy_json_tag(:responsive, id, tags, responsive[:widths], responsive[:series])
%(<nav id="#{id}" class="pagy-nav-responsive-bulma pagy-bulma-responsive-nav pagination is-centered" role="navigation" aria-label="pagination"></nav>#{script})
end
- Pagy.deprecate self, :pagy_nav_responsive_bulma, :pagy_bulma_responsive_nav
+ deprecate :pagy_nav_responsive_bulma, :pagy_bulma_responsive_nav
end
end