Improve page numbering
<h4 class="text-muted">Sorry, no results match those criteria. Please try broadening your search.</h4>
{% endif %}
<div id="discover-page-options">
- {% if page_obj.has_previous or page_obj.has_next %}
+ {% if page_obj.has_other_pages %}
+ &laquo;
+
+ {% if page_obj.number != 1 %}
+ <a href="{{ request.get_full_path|clean_pagination_url }}&amp;page=1">First</a>
+ {% else %}
+ First
+ {% endif %}
+ |
{% if page_obj.has_previous %}
- <a href="{{ request.get_full_path|clean_pagination_url }}&amp;page={{ page_obj.previous_page_number }}">
- {% endif %}&laquo; Previous
- {% if page_obj.has_previous %}</a>{% endif %}
+ <a href="{{ request.get_full_path|clean_pagination_url }}&amp;page={{ page_obj.previous_page_number }}">Previous</a>
+ {% else %}
+ Previous
+ {% endif %}
|
{% if page_obj.has_next %}
- <a href="{{ request.get_full_path|clean_pagination_url }}&amp;page={{ page_obj.next_page_number }}">
- {% endif %}Next &raquo;{% if page_obj.has_next %}</a>{% endif %}
+ <a href="{{ request.get_full_path|clean_pagination_url }}&amp;page={{ page_obj.next_page_number }}">Next</a>
+ {% else %}
+ Next
{% endif %}
+ |
+ {% if page_obj.number != page_obj.paginator.num_pages %}
+ <a href="{{ request.get_full_path|clean_pagination_url }}&amp;page={{ page_obj.paginator.num_pages }}">Last</a>
+ {% else %}
+ Last
+ {% endif %}
+
+ &raquo;
+ {% else %}
+ &laquo;results 1 to {{ page_obj.paginator.count }}&raquo;
+ {% endif %}
+
{% if page_obj.has_other_pages %}
- {{ page_obj }} ( results {{ page_obj.start_index }} to {{ page_obj.end_index }} )
+ {{ page_obj }} &lt;results {{ page_obj.start_index }} to {{ page_obj.end_index }} of {{ page_obj.paginator.count }}&gt;
{% endif %}
</div>
