Pagination improvements, allow to select page size

This commit is contained in:
Raphael Michel
2017-12-09 19:47:47 +01:00
parent f5bf2ac4ca
commit 9e84e78215
14 changed files with 66 additions and 32 deletions

View File

@@ -68,7 +68,6 @@
</div>
</form>
</div>
{% include "pretixcontrol/pagination.html" %}
<div class="table-responsive">
<table class="table table-condensed table-hover">
<thead>

View File

@@ -1,6 +1,6 @@
{% load i18n %}
{% load urlreplace %}
<nav class="text-center">
<nav class="text-center pagination-container">
<ul class="pagination">
{% if is_paginated %}
{% if page_obj.has_previous %}
@@ -32,4 +32,17 @@
{% endif %}
{% endif %}
</ul>
{% if page_size %}
<div class="clearfix">
<small>
{% trans "Show per page:" %}
</small>
<a href="?{% url_replace request "page_size" "25" "page" "1" %}">
{% if page_size == 25 %}<strong>{% endif %}25{% if page_size == 25 %}</strong>{% endif %}</a> |
<a href="?{% url_replace request "page_size" "50" "page" "1" %}">
{% if page_size == 50 %}<strong>{% endif %}50{% if page_size == 50 %}</strong>{% endif %}</a> |
<a href="?{% url_replace request "page_size" "100" "page" "1" %}">
{% if page_size == 100 %}<strong>{% endif %}100{% if page_size == 100 %}</strong>{% endif %}</a>
</div>
{% endif %}
</nav>