Sha256: 45ddd042da4bb27e5668a18b23fceac1807f69201a14f12cd5af0fcff9f432e2

Contents?: true

Size: 1.46 KB

Versions: 45

Compression:

Stored size: 1.46 KB

Contents

<%#
  This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
  calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").

  The link variable is set to a proc that returns the link tag.
  Usage: link.call( page_number [, text [, extra_attributes_string ]])
-%>
<% link = pagy_link_proc(pagy) -%>
<%#                            -%><nav aria-label="pager" class="pagy_nav agination" role="navigation">
<% if pagy.prev                -%>  <span class="page prev"><%== link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"') %></span>
<% else                        -%>  <span class="page prev disabled"><%== pagy_t('pagy.nav.prev') %></span>
<% end                         -%>
<% pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] -%>
<%   if    item.is_a?(Integer) -%>  <span class="page"><%== link.call(item) %></span>
<%   elsif item.is_a?(String)  -%>  <span class="page current"><%= item %></span>
<%   elsif item == :gap        -%>  <span class="page gap"><%== pagy_t('pagy.nav.gap') %></span>
<%   end                       -%>
<% end                         -%>
<% if pagy.next                -%>  <span class="page next"><%== link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"') %></span>
<% else                        -%>  <span class="page next disabled"><%== pagy_t('pagy.nav.next') %></span>
<% end                         -%>
<%#                            -%></nav>

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
pagy-1.3.2 lib/templates/nav.html.erb
pagy-1.3.1 lib/templates/nav.html.erb
pagy-1.3 lib/templates/nav.html.erb
pagy-1.2.1 lib/templates/nav.html.erb
pagy-1.2.0 lib/templates/nav.html.erb
pagy-1.1.0 lib/templates/nav.html.erb
pagy-1.0.0 lib/templates/nav.html.erb
pagy-0.23.1 lib/templates/nav.html.erb
pagy-0.23.0 lib/templates/nav.html.erb
pagy-0.22.0 lib/templates/nav.html.erb
pagy-0.21.0 lib/templates/nav.html.erb
pagy-0.20.0 lib/templates/nav.html.erb
pagy-0.19.4 lib/templates/nav.html.erb
pagy-0.19.3 lib/templates/nav.html.erb
pagy-0.19.2 lib/templates/nav.html.erb
pagy-0.19.1 lib/templates/nav.html.erb
pagy-0.19.0 lib/templates/nav.html.erb
pagy-0.18.0 lib/templates/nav.html.erb
pagy-0.17.0 lib/pagy/extras/templates/nav.html.erb
pagy-0.16.0 lib/pagy/extras/templates/nav.html.erb