Sha256: ab6c1ed6d0d82aa38ed4844576cfd2be7989e5367184430d158c0a5aa56be42d

Contents?: true

Size: 1.2 KB

Versions: 3

Compression:

Stored size: 1.2 KB

Contents

<% if collection.total_pages > 1 %>
  <ul class="pager">
    <% if collection.previous_page %>
      <li class="first">
        <%= link_to t('pager.first'), page_path(collection.first_page, options) %>
      </li>
      <li class="previous">
        <%= link_to t('pager.previous'), page_path(collection.previous_page, options), rel: 'prev' %>
      </li>
    <% end %>
    <% if less_pages %>
      <li class="ellipsis">
        &hellip;
      </li>
    <% end %>
    <% pages.each do |page| %>
      <li class="page<%= ' current' if collection.current_page == page %>">
        <%=
          link_to(
            page,
            page_path(page, options),
            rel: (collection.next_page == page ? 'next' : (collection.previous_page == page ? 'prev' : nil))
          )
        %>
      </li>
    <% end %>
    <% if more_pages %>
      <li class="ellipsis">
        &hellip;
      </li>
    <% end %>
    <% if collection.next_page %>
      <li class="next">
        <%= link_to t('pager.next'), page_path(collection.next_page, options), rel: 'next' %>
      </li>
      <li class="last">
        <%= link_to t('pager.last'), page_path(collection.last_page, options) %>
      </li>
    <% end %>
  </ul>
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pagers-5.1.0 app/views/pagers/_main.html.erb
pagers-4.0.0.1 app/views/pagers/_main.html.erb
pagers-4.0.0.0 app/views/pagers/_main.html.erb