Gallery-Archivist/archivist/apps/templates/includes/pageination.html

91 lines
3.6 KiB
HTML
Raw Normal View History

2024-05-23 22:57:43 +02:00
<!-- Pagination -->
<div class="row justify-content-center">
<div class="col">
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center">
2024-05-23 22:57:43 +02:00
{% if page_obj.has_previous %}
<li class="page-item">
<a class="page-link" href="?{{ request.GET.urlencode }}&page=1" aria-label="First">
2024-05-23 22:57:43 +02:00
«
</a>
</li>
<li class="page-item">
<a class="page-link" href="?{{ request.GET.urlencode }}&page={{ page_obj.previous_page_number }}" aria-label="Previous">
2024-05-23 22:57:43 +02:00
<span aria-hidden="true">
</span>
</a>
</li>
{% else %}
<li class="page-item disabled">
<span class="page-link text-decoration-line-through">
2024-05-23 22:57:43 +02:00
«
</span>
</li>
<li class="page-item disabled">
<span class="page-link text-decoration-line-through">
2024-05-23 22:57:43 +02:00
</span>
</li>
{% endif %}
<li class="page-item disabled">
<span class="page-link text-nowrap">
2024-05-23 22:57:43 +02:00
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
</span>
</li>
{% if page_obj.has_next %}
<li class="page-item">
<a class="page-link" href="?{{ request.GET.urlencode }}&page={{ page_obj.next_page_number }}" aria-label="Next">
2024-05-23 22:57:43 +02:00
<span aria-hidden="true">
</span>
</a>
</li>
<li class="page-item">
<a class="page-link" href="?{{ request.GET.urlencode }}&page={{ page_obj.paginator.num_pages }}" aria-label="Last">
2024-05-23 22:57:43 +02:00
»
</a>
</li>
{% else %}
<li class="page-item disabled">
<span class="page-link text-decoration-line-through">
2024-05-23 22:57:43 +02:00
</span>
</li>
<li class="page-item disabled">
<span class="page-link text-decoration-line-through">
2024-05-23 22:57:43 +02:00
»
</span>
</li>
{% endif %}
</ul>
</nav>
</div>
<!-- Jump-to field -->
<div class="col ">
<form method="get" class="d-flex flex-row flex-nowrap flex-grow-1 justify-content-center ">
{% for key, value in request.GET.items %}
{% if key != "page" %}
<input type="hidden" name="{{ key }}" value="{{ value }}">
{% endif %}
{% endfor %}
<label for="jumpToPage" class="col-auto col-form-label mx-1">Jump to:</label>
<input type="number" name="page" id="jumpToPage" class="form-control mx-1" min="1" max="{{ page_obj.paginator.num_pages }}" value="{{ page_obj.number }}" style="width: 5rem">
<button type="submit" class="btn btn-primary mx-1">Go</button>
2024-05-23 22:57:43 +02:00
</form>
</div>
<!-- Jump to field End -->
</div>
<!-- Pagination End -->