# See the Pagy documentation: https://ddnexus.github.io/pagy/extras/compact # frozen_string_literal: true class Pagy # Add nav helpers for compact pagination module Frontend # Generic compact pagination: 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_nav_compact(pagy, id=caller(1,1)[0].hash) html, link, p_prev, p_next, p_page, p_pages = +'', pagy_link_proc(pagy), pagy.prev, pagy.next, pagy.page, pagy.pages html << %() end # Compact pagination for bootstrap: 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_nav_compact_bootstrap(pagy, id=caller(1,1)[0].hash) html, link, p_prev, p_next, p_page, p_pages = +'', pagy_link_proc(pagy), pagy.prev, pagy.next, pagy.page, pagy.pages html << %() end end end