<% if results.total_pages > 1 %>
  <nav class="text-center" aria-label="Pagination">
    <ul class="pagination">
      <% if results.current_page.to_i != 1 %>
      <li>
        <a href="?<%= pagination_params(results.current_page.to_i - 1) %>" aria-label="Previous">
          <span aria-hidden="true">&laquo;</span>
        </a>
      </li>
      <% end %>
      <% for n in results.pages%>
      <li class="<%= "active" if results.current_page.to_i == n %>">
        <% if n %>
          <a href="?<%= pagination_params(n) %>"><%= n %></a>
        <% else %>
          <a>…</a>
        <% end %>
      </li>
      <% end %>
      <% if results.current_page.to_i != results.total_pages %>
      <li>
        <a href="?<%= pagination_params(results.current_page.to_i + 1) %>" aria-label="Next">
          <span aria-hidden="true">&raquo;</span>
        </a>
      </li>
      <% end %>
    </ul>
  </nav>
<% end %>
