Sha256: 8f8bb09ecd88493d49f33f3c4d954640ab0bd6b6140352827d90b80be4c98712
Contents?: true
Size: 1.73 KB
Versions: 3
Compression:
Stored size: 1.73 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 ("‹ Prev", "Next ›", "…"). 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="space-x-1 px-2 py-1" role="navigation"> <% if pagy.prev -%> <span><%== link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous" class="text-white bg-indigo-500 rounded-2xl px-3 py-1.5"') %></span> <% else -%> <span class="text-gray-400 bg-gray-100 rounded-2xl px-3 py-1.5 cursor-not-allowed"><%== 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><%== link.call(item, item, 'class="text-gray-400 rounded-full px-2.5 py-1.5 hover:bg-indigo-200 hover:text-indigo-500"') %></span> <% elsif item.is_a?(String) -%> <span class="text-indigo-500 font-semibold px-2.5 py-1.5"><%= item %></span> <% elsif item == :gap -%> <span class="text-gray-400 text-xl px-1.5 py-1.5"><%== pagy_t('pagy.nav.gap') %></span> <% end -%> <% end -%> <% if pagy.next -%> <span><%== link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next" class="text-white bg-indigo-500 rounded-2xl px-3 py-1.5"') %></span> <% else -%> <span class="text-gray-400 bg-gray-100 rounded-2xl px-3 py-1.5 cursor-not-allowed"><%== pagy_t('pagy.nav.next') %></span> <% end -%>
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
madmin-1.2.9 | app/views/madmin/pagy/_nav.html.erb |
madmin-1.2.8 | app/views/madmin/pagy/_nav.html.erb |
madmin-1.2.7 | app/views/madmin/pagy/_nav.html.erb |