Browse Source

Generisize pagination links

pull/619/head
baarkerlounger 3 years ago
parent
commit
cb1c136c98
  1. 7
      app/views/pagy/_nav.html.erb

7
app/views/pagy/_nav.html.erb

@ -1,11 +1,10 @@
<% link = pagy_link_proc(pagy) -%>
<% if pagy.pages > 1 %>
<nav class="app-pagination" id="pagination-label" aria-label="results navigation">
<ul class="app-pagination__list">
<li class="app-pagination__item app-pagination__item--prev">
<% if pagy.prev %>
<a class="app-pagination__link" href="<%= "/logs?page=#{pagy.prev}" %>">
<a class="app-pagination__link" href="<%= "#{request.path}?page=#{pagy.prev}" %>">
<% end %>
<span class="app-pagination__link-title">
<svg class="app-pagination__icon" xmlns="http://www.w3.org/2000/svg" height="13" width="17">
@ -20,12 +19,12 @@
<% elsif item.is_a?(String) %>
<li class="app-pagination__item app-pagination__item--current"><span class="govuk-visually-hidden">Page </span><%= item %><span class="govuk-visually-hidden"> (current page) </span></li>
<% else %>
<li class="app-pagination__item"><a class="app-pagination__link" href="<%= "/logs?page=#{item}" %>"><span class="govuk-visually-hidden">Page </span><%= item %></a></li>
<li class="app-pagination__item"><a class="app-pagination__link" href="<%= "#{request.path}?page=#{item}" %>"><span class="govuk-visually-hidden">Page </span><%= item %></a></li>
<% end %>
<% end %>
<li class="app-pagination__item app-pagination__item--next">
<% if pagy.next %>
<a class="app-pagination__link" href="<%= "/logs?page=#{pagy.next}" %>">
<a class="app-pagination__link" href="<%= "#{request.path}?page=#{pagy.next}" %>">
<% end %>
Next <span class="govuk-visually-hidden">page</span>
<span class="app-pagination__link-title">

Loading…
Cancel
Save