Create paginator component as div and cols.
This commit is contained in:
parent
85f1d433a3
commit
5322f62cdf
29
musician/templates/musician/components/paginator.html
Normal file
29
musician/templates/musician/components/paginator.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
{# <!-- paginator component --> #}
|
||||
<div class="row object-list-paginator">
|
||||
<div class="col-md-4">{{ page_obj.paginator.count }} items in total</div>
|
||||
<div class="col-md-4 text-center">
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="?page=1&per_page={{ page_obj.paginator.per_page }}">«</a>
|
||||
<a href="?page={{ page_obj.previous_page_number }}&per_page={{ page_obj.paginator.per_page }}">‹</a>
|
||||
{% endif %}
|
||||
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
|
||||
{% if page_obj.has_next %}
|
||||
<a href="?page={{ page_obj.next_page_number }}&per_page={{ page_obj.paginator.per_page }}">›</a>
|
||||
<a href="?page={{ page_obj.paginator.num_pages }}&per_page={{ page_obj.paginator.per_page }}">»</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-4 text-right">
|
||||
<form method="get">
|
||||
Showing
|
||||
<select name="{{ per_page_param }}">
|
||||
{% for value in per_page_values %}
|
||||
{% with page_obj.paginator.per_page as per_page %}
|
||||
<option value="{{ value }}" {% if value == per_page %}selected{% endif %}>{{ value }}</option>
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
per page
|
||||
<input type="submit" value="apply" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
|
@ -48,5 +48,5 @@
|
|||
|
||||
{% endfor %}
|
||||
|
||||
{% include "musician/components/table_paginator.html" %}
|
||||
{% include "musician/components/paginator.html" %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue