# See the Pagy documentation: https://ddnexus.github.io/pagy/extras/bulma # frozen_string_literal: true require 'pagy/extras/shared' class Pagy module Frontend # Pagination for Bulma: it returns the html with the series of links to the pages def pagy_bulma_nav(pagy) html, link, p_prev, p_next = +'', pagy_link_proc(pagy), pagy.prev, pagy.next html << (p_prev ? link.call(p_prev, pagy_t('pagy.nav.prev'), 'class="pagination-previous" aria-label="previous page"') : %(#{pagy_t('pagy.nav.prev')})) html << (p_next ? link.call(p_next, pagy_t('pagy.nav.next'), 'class="pagination-next" aria-label="next page"') : %(#{pagy_t('pagy.nav.next')})) html << '