mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Improve performance of global order search
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
{% load i18n %}
|
||||
{% load urlreplace %}
|
||||
<nav class="text-center pagination-container">
|
||||
<ul class="pagination">
|
||||
{% if is_paginated %}
|
||||
{% if page_obj.has_previous %}
|
||||
<li>
|
||||
<a href="?{% url_replace request '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 count=page_obj.paginator.count %}
|
||||
Page {{ page }}
|
||||
{% endblocktrans %}
|
||||
</a></li>
|
||||
{% if page_obj.has_next %}
|
||||
<li>
|
||||
<a href="?{% url_replace request 'page' page_obj.next_page_number %}">
|
||||
<span>»</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if page_obj.paginator.count > 1 %}
|
||||
<li class="page-current"><a>
|
||||
{% blocktrans trimmed with count=page_obj.paginator.count %}
|
||||
{{ count }} elements
|
||||
{% endblocktrans %}
|
||||
</a></li>
|
||||
{% 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>
|
||||
@@ -47,9 +47,6 @@
|
||||
<th class="text-right">{% trans "Order total" %}
|
||||
<a href="?{% url_replace request 'ordering' '-total' %}"><i class="fa fa-caret-down"></i></a>
|
||||
<a href="?{% url_replace request 'ordering' 'total' %}"><i class="fa fa-caret-up"></i></a></th>
|
||||
<th class="text-right">{% trans "Positions" %}
|
||||
<a href="?{% url_replace request 'ordering' '-pcnt' %}"><i class="fa fa-caret-down"></i></a>
|
||||
<a href="?{% url_replace request 'ordering' 'pcnt' %}"><i class="fa fa-caret-up"></i></a></th>
|
||||
<th class="text-right">{% trans "Status" %}
|
||||
<a href="?{% url_replace request 'ordering' '-status' %}"><i class="fa fa-caret-down"></i></a>
|
||||
<a href="?{% url_replace request 'ordering' 'status' %}"><i class="fa fa-caret-up"></i></a></th>
|
||||
@@ -74,7 +71,6 @@
|
||||
</td>
|
||||
<td>{{ o.datetime|date:"SHORT_DATETIME_FORMAT" }}</td>
|
||||
<td class="text-right">{{ o.total|floatformat:2 }} {{ o.event.currency }}</td>
|
||||
<td class="text-right">{{ o.pcnt }}</td>
|
||||
<td class="text-right">{% include "pretixcontrol/orders/fragment_order_status.html" with order=o %}</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
@@ -87,5 +83,5 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% include "pretixcontrol/pagination.html" %}
|
||||
{% include "pretixcontrol/pagination_huge.html" %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user