Pagination in all ListViews

This commit is contained in:
Raphael Michel
2015-05-24 14:07:51 +02:00
parent 14d1a12a91
commit 79dfe7a084
12 changed files with 42 additions and 26 deletions

View File

@@ -24,4 +24,5 @@
{% endfor %}
</tbody>
</table>
{% include "pretixcontrol/pagination.html" %}
{% endblock %}

View File

@@ -27,4 +27,5 @@
{% endfor %}
</tbody>
</table>
{% include "pretixcontrol/pagination.html" %}
{% endblock %}

View File

@@ -24,4 +24,5 @@
{% endfor %}
</tbody>
</table>
{% include "pretixcontrol/pagination.html" %}
{% endblock %}

View File

@@ -24,4 +24,5 @@
{% endfor %}
</tbody>
</table>
{% include "pretixcontrol/pagination.html" %}
{% endblock %}

View File

@@ -26,4 +26,5 @@
{% endfor %}
</tbody>
</table>
{% include "pretixcontrol/pagination.html" %}
{% endblock %}

View File

@@ -36,4 +36,5 @@
{% endfor %}
</tbody>
</table>
{% include "pretixcontrol/pagination.html" %}
{% endblock %}

View File

@@ -27,29 +27,5 @@
{% endfor %}
</tbody>
</table>
{% if is_paginated %}
<nav class="text-center">
<ul class="pagination">
{% if page_obj.has_previous %}
<li>
<a href="?page={{ page_obj.previous_page_number }}">
<span>&laquo;</span>
</a>
</li>
{% endif %}
<li class="page-current"><a>
{% blocktrans trimmed with page=page_obj.number of=page_obj.paginator.num_pages %}
Page {{ page }} of {{ of }}
{% endblocktrans %}
</a></li>
{% if page_obj.has_next %}
<li>
<a href="?page={{ page_obj.next_page_number }}">
<span>&raquo;</span>
</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}
{% include "pretixcontrol/pagination.html" %}
{% endblock %}

View File

@@ -5,7 +5,7 @@
<h1>{% trans "Organizers" %}</h1>
<p>{% trans "The list below shows all organizer accounts you have administrative access to." %}</p>
{% if request.user.is_superuser %}
<a href="{% url "control:organizers.add" %}" class="btn btn-primary">
<a href="{% url "control:organizers.add" %}" class="btn btn-default">
<span class="fa fa-plus"></span>
{% trans "Create a new organizer" %}
</a>
@@ -26,4 +26,5 @@
{% endfor %}
</tbody>
</table>
{% include "pretixcontrol/pagination.html" %}
{% endblock %}

View File

@@ -0,0 +1,26 @@
{% load i18n %}
{% if is_paginated %}
<nav class="text-center">
<ul class="pagination">
{% if page_obj.has_previous %}
<li>
<a href="?page={{ page_obj.previous_page_number }}">
<span>&laquo;</span>
</a>
</li>
{% endif %}
<li class="page-current"><a>
{% blocktrans trimmed with page=page_obj.number of=page_obj.paginator.num_pages %}
Page {{ page }} of {{ of }}
{% endblocktrans %}
</a></li>
{% if page_obj.has_next %}
<li>
<a href="?page={{ page_obj.next_page_number }}">
<span>&raquo;</span>
</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}