-
Hi, I have a project that uses Pagy <% link = pagy_link_proc(pagy) -%>
<%# -%><nav aria-label="pager" class="flex gap-4 text-lg text-black <%= classes %>" role="navigation">
<% if pagy.prev -%> <div class="flex font-bold"><%= render 'components/icons/arrow_left', classes: "w-6 w-6 mr-4" %> <%== link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'class="" aria-label="previous"') %></div>
<% else -%> <div class="flex text-gray-400 font-bold cursor-not-allowed"><%= render 'components/icons/arrow_left', classes: "w-6 w-6 mr-4" %> <%== pagy_t('pagy.nav.prev') %></div>
<% end -%>
<% pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] -%>
<% if item.is_a?(Integer) -%> <div><%== link.call(item) %></div>
<% elsif item.is_a?(String) -%> <div class="text-ba-blue-500 font-bold current"><%= item %></div>
<% elsif item == :gap -%> <div><%== pagy_t('pagy.nav.gap') %></div>
<% end -%>
<% end -%>
<% if pagy.next -%> <div class="flex font-bold"><%== link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"') %> <%= render 'components/icons/arrow_right', classes: "w-6 w-6 ml-4 " %></div>
<% else -%> <div class="flex text-gray-400 font-bold cursor-not-allowed"><%== pagy_t('pagy.nav.next') %> <%= render 'components/icons/arrow_right', classes: "w-6 w-6 ml-4" %></div>
<% end -%>
<%# -%></nav> However, in Pagy
Is there an example somewhere of how to achieve this in version 8? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
https://ddnexus.github.io/pagy/docs/how-to/#using-your-pagination-templates That change and others are listed in the https://ddnexus.github.io/pagy/changelog/ You will probably also need https://ddnexus.github.io/pagy/docs/api/stylesheets/ |
Beta Was this translation helpful? Give feedback.
https://ddnexus.github.io/pagy/docs/how-to/#using-your-pagination-templates
That change and others are listed in the https://ddnexus.github.io/pagy/changelog/
You will probably also need https://ddnexus.github.io/pagy/docs/api/stylesheets/