mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Pagination in all ListViews
This commit is contained in:
@@ -24,4 +24,5 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% include "pretixcontrol/pagination.html" %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -27,4 +27,5 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% include "pretixcontrol/pagination.html" %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -24,4 +24,5 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% include "pretixcontrol/pagination.html" %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -24,4 +24,5 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% include "pretixcontrol/pagination.html" %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -26,4 +26,5 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% include "pretixcontrol/pagination.html" %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -36,4 +36,5 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% include "pretixcontrol/pagination.html" %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -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>«</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>»</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
{% include "pretixcontrol/pagination.html" %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
26
src/pretix/control/templates/pretixcontrol/pagination.html
Normal file
26
src/pretix/control/templates/pretixcontrol/pagination.html
Normal 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>«</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>»</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
@@ -27,6 +27,7 @@ from . import UpdateView, CreateView
|
||||
class ItemList(ListView):
|
||||
model = Item
|
||||
context_object_name = 'items'
|
||||
paginate_by = 30
|
||||
template_name = 'pretixcontrol/items/index.html'
|
||||
|
||||
def get_queryset(self):
|
||||
@@ -121,6 +122,7 @@ class CategoryCreate(EventPermissionRequiredMixin, CreateView):
|
||||
class CategoryList(ListView):
|
||||
model = ItemCategory
|
||||
context_object_name = 'categories'
|
||||
paginate_by = 30
|
||||
template_name = 'pretixcontrol/items/categories.html'
|
||||
|
||||
def get_queryset(self):
|
||||
@@ -169,6 +171,7 @@ def category_move_down(request, organizer, event, category):
|
||||
class PropertyList(ListView):
|
||||
model = Property
|
||||
context_object_name = 'properties'
|
||||
paginate_by = 30
|
||||
template_name = 'pretixcontrol/items/properties.html'
|
||||
|
||||
def get_queryset(self):
|
||||
@@ -351,6 +354,7 @@ class PropertyDelete(EventPermissionRequiredMixin, DeleteView):
|
||||
class QuestionList(ListView):
|
||||
model = Question
|
||||
context_object_name = 'questions'
|
||||
paginate_by = 30
|
||||
template_name = 'pretixcontrol/items/questions.html'
|
||||
|
||||
def get_queryset(self):
|
||||
@@ -444,6 +448,7 @@ class QuestionCreate(EventPermissionRequiredMixin, CreateView):
|
||||
class QuotaList(ListView):
|
||||
model = Quota
|
||||
context_object_name = 'quotas'
|
||||
paginate_by = 30
|
||||
template_name = 'pretixcontrol/items/quotas.html'
|
||||
|
||||
def get_queryset(self):
|
||||
|
||||
@@ -7,6 +7,7 @@ from pretix.base.models import Event
|
||||
class EventList(ListView):
|
||||
model = Event
|
||||
context_object_name = 'events'
|
||||
paginate_by = 30
|
||||
template_name = 'pretixcontrol/events/index.html'
|
||||
|
||||
def get_queryset(self):
|
||||
|
||||
@@ -13,6 +13,7 @@ class OrganizerList(ListView):
|
||||
model = Organizer
|
||||
context_object_name = 'organizers'
|
||||
template_name = 'pretixcontrol/organizers/index.html'
|
||||
paginate_by = 30
|
||||
|
||||
def get_queryset(self):
|
||||
if self.request.user.is_superuser:
|
||||
|
||||
Reference in New Issue
Block a user