# See the Pagy documentation: https://ddnexus.github.io/pagy/extras/materialize # frozen_string_literal: true require 'pagy/extras/shared' class Pagy module Frontend # Pagination for materialize: it returns the html with the series of links to the pages def pagy_materialize_nav(pagy) link = pagy_link_proc(pagy) html = +%() end # Javascript pagination for materialize: it returns a nav and a JSON tag used by the Pagy.nav javascript def pagy_materialize_nav_js(pagy, id=pagy_id) link = pagy_link_proc(pagy) tags = { 'before' => %() } html = %() html << pagy_json_tag(pagy, :nav, id, tags, pagy.sequels) end # Javascript combo pagination for materialize: it returns a nav and a JSON tag used by the Pagy.combo_nav javascript def pagy_materialize_combo_nav_js(pagy, id=pagy_id) link = pagy_link_proc(pagy) p_page = pagy.page p_pages = pagy.pages style = ' style="vertical-align: middle;"' input = %() %(