1
0
Fork 0
mirror of synced 2024-06-29 03:20:58 +12:00

fix public index pagination links and total count

This commit is contained in:
Nick Sweeting 2021-02-15 21:07:12 -05:00
parent 108cb100b3
commit de1a939df4

View file

@ -2,6 +2,11 @@
{% load static %} {% load static %}
{% block body %} {% block body %}
<style>
#table-bookmarks_info {
display: none;
}
</style>
<div id="toolbar"> <div id="toolbar">
<form id="changelist-search" action="{% url 'public-index' %}" method="get"> <form id="changelist-search" action="{% url 'public-index' %}" method="get">
<div> <div>
@ -21,7 +26,7 @@
<thead> <thead>
<tr> <tr>
<th style="width: 100px;">Bookmarked</th> <th style="width: 100px;">Bookmarked</th>
<th style="width: 26vw;">Snapshot ({{object_list|length}})</th> <th style="width: 26vw;">Snapshot ({{page_obj.paginator.count}})</th>
<th style="width: 140px">Files</th> <th style="width: 140px">Files</th>
<th style="width: 16vw;whitespace:nowrap;overflow-x:hidden;">Original URL</th> <th style="width: 16vw;whitespace:nowrap;overflow-x:hidden;">Original URL</th>
</tr> </tr>
@ -33,26 +38,26 @@
</tbody> </tbody>
</table> </table>
<center> <center>
<br/>
Showing {{ page_obj.start_index }}-{{ page_obj.end_index }} of {{ page_obj.paginator.count }} total
<br/>
<span class="step-links"> <span class="step-links">
{% if page_obj.has_previous %} {% if page_obj.has_previous %}
<a href="{% url 'public-index' %}?page=1">&laquo; first</a> <a href="{% url 'public-index' %}?page=1">&laquo; first</a> &nbsp;
<a href="{% url 'public-index' %}?page={{ page_obj.previous_page_number }}">previous</a> <a href="{% url 'public-index' %}?page={{ page_obj.previous_page_number }}">previous</a>
&nbsp;
{% endif %} {% endif %}
<span class="current"> <span class="current">
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}. Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
</span> </span>
{% if page_obj.has_next %} {% if page_obj.has_next %}
<a href="{% url 'public-index' %}?page={{ page_obj.next_page_number }}">next </a> &nbsp;
<a href="{% url 'public-index' %}?page={{ page_obj.next_page_number }}">next </a> &nbsp;
<a href="{% url 'public-index' %}?page={{ page_obj.paginator.num_pages }}">last &raquo;</a> <a href="{% url 'public-index' %}?page={{ page_obj.paginator.num_pages }}">last &raquo;</a>
{% endif %} {% endif %}
</span> </span>
{% if page_obj.has_next %}
<a href="{% url 'public-index' %}?page={{ page_obj.next_page_number }}">next </a>
<a href="{% url 'public-index' %}?page={{ page_obj.paginator.num_pages }}">last &raquo;</a>
{% endif %}
</span> </span>
<br> <br>
</center> </center>