Code paginator style.

This commit is contained in:
Santiago Lamora 2019-12-03 14:07:57 +01:00
parent 78ac35cc6f
commit 50bcd89fcd
1 changed files with 28 additions and 9 deletions

View File

@ -1,17 +1,36 @@
{# <!-- table footer based paginator for ListView --> #} {# <!-- table footer based paginator for ListView --> #}
{% load i18n %}
<tfoot> <tfoot>
<tr> <tr>
<td colspan="2">{{ page_obj.paginator.count }} items in total</td> <td colspan="2">{{ page_obj.paginator.count }} items in total</td>
<td class="text-center"> <td class="text-center">
{% if page_obj.has_previous %} <nav aria-label="Page navigation">
<a href="?page=1&per_page={{ page_obj.paginator.per_page }}">&laquo;</a> <ul class="pagination justify-content-center">
<a href="?page={{ page_obj.previous_page_number }}&per_page={{ page_obj.paginator.per_page }}">&lsaquo;</a> <li class="page-item {{ page_obj.has_previous|yesno:',disabled' }}">
{% endif %} <a class="page-link" {% if page_obj.has_previous %}
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }} href="?page={{ page_obj.previous_page_number }}&per_page={{ page_obj.paginator.per_page }}"
{% if page_obj.has_next %} {% else %} href="#" {% endif %} tabindex="-1">
<a href="?page={{ page_obj.next_page_number }}&per_page={{ page_obj.paginator.per_page }}">&rsaquo;</a> <span aria-hidden="true">&lsaquo;</span>
<a href="?page={{ page_obj.paginator.num_pages }}&per_page={{ page_obj.paginator.per_page }}">&raquo;</a> <span class="sr-only">{% trans "Previous" %}</span>
{% endif %} </a>
</li>
{% for page_number in page_obj.paginator.page_range %}
<li class="page-item {% if page_number == page_obj.number %}active {% endif %}">
<a class="page-link"
href="?page={{ page_number }}&per_page={{ page_obj.paginator.per_page }}">{{ page_number }}</a>
</li>
{% endfor %}
<li class="page-item {{ page_obj.has_next|yesno:',disabled' }}">
<a class="page-link" {% if page_obj.has_next %}
href="?page={{ page_obj.next_page_number }}&per_page={{ page_obj.paginator.per_page }}"
{% else %} href="#" {% endif %}>
<span aria-hidden="true">&rsaquo;</span>
<span class="sr-only">{% trans "Next" %}</span>
</a>
</li>
</ul>
</nav>
</td> </td>
<td colspan="2" class="text-right"> <td colspan="2" class="text-right">
<form method="get"> <form method="get">