diff --git a/src/pretix/presale/templates/pretixpresale/organizers/customer_orders.html b/src/pretix/presale/templates/pretixpresale/organizers/customer_orders.html new file mode 100644 index 0000000000..f0f7c4c385 --- /dev/null +++ b/src/pretix/presale/templates/pretixpresale/organizers/customer_orders.html @@ -0,0 +1,76 @@ +{% extends "pretixpresale/organizers/customer_base.html" %} +{% load i18n %} +{% load eventurl %} +{% load urlreplace %} +{% load money %} +{% load bootstrap3 %} +{% block title %}{% trans "Your account" %}{% endblock %} +{% block inner %} +
+
+

+ {% trans "Orders" %} ({{ page_obj.paginator.count }}) +

+
+
+ {% if orders %} +
    + {% for o in orders %} +
  1. +
    +
    +
    {% trans "Order" %}
    +
    + + + {{ o.code }} + + {% if o.customer_id != customer.pk %} + + {% endif %} + {% include "pretixpresale/event/fragment_order_status.html" with order=o event=o.event %} +
    +
    + {% if o.testmode and False %} +
    {% trans "TEST MODE" %}
    + {% endif %} +
    +
    +
    {% trans "Order total" %}
    +
    {{ o.total|money:o.event.currency }}
    +
    {% trans "Positions" %}
    +
    {% blocktranslate count counter=o.count_positions|default_if_none:0 %}{{ counter }} item{% plural %}{{ counter }} items{% endblocktranslate %} +
    +
    +
    +
    {% trans "Event" %}
    +
    + {{ o.event }} + {% if not o.event.has_subevents and o.event.settings.show_dates_on_frontpage %} +
    {{ o.event.get_date_range_display }} + {% endif %} +
    +
    +
    +
    {% trans "Actions" %}
    +
    + + + {% trans "Details" %} +
    +
    +
    +
  2. + {% endfor %} +
+ {% else %} +

{% trans "You don’t have any orders in your account yet." %}

+ {% endif %} +
+
+ {% include "pretixcontrol/pagination.html" %} +{% endblock %} diff --git a/src/pretix/presale/urls.py b/src/pretix/presale/urls.py index 46ab0c218d..ac99724252 100644 --- a/src/pretix/presale/urls.py +++ b/src/pretix/presale/urls.py @@ -216,7 +216,7 @@ organizer_patterns = [ re_path(r'^account/addresses/(?P\d+)/delete$', pretix.presale.views.customer.AddressDeleteView.as_view(), name='organizer.customer.address.delete'), re_path(r'^account/profiles$', pretix.presale.views.customer.ProfileView.as_view(), name='organizer.customer.profiles'), re_path(r'^account/profiles/(?P\d+)/delete$', pretix.presale.views.customer.ProfileDeleteView.as_view(), name='organizer.customer.profile.delete'), - re_path(r'^account/$', pretix.presale.views.customer.IndexView.as_view(), name='organizer.customer.index'), + re_path(r'^account/$', pretix.presale.views.customer.OrderView.as_view(), name='organizer.customer.index'), #re_path(r'^account/$', pretix.presale.views.customer.ProfileView.as_view(), name='organizer.customer.profile'), re_path(r'^oauth2/v1/authorize$', pretix.presale.views.oidc_op.AuthorizeView.as_view(), diff --git a/src/pretix/presale/views/customer.py b/src/pretix/presale/views/customer.py index 3ead9707d6..57826a05f2 100644 --- a/src/pretix/presale/views/customer.py +++ b/src/pretix/presale/views/customer.py @@ -350,8 +350,8 @@ class CustomerRequiredMixin: return super().dispatch(request, *args, **kwargs) -class IndexView(CustomerRequiredMixin, ListView): - template_name = 'pretixpresale/organizers/customer_profile.html' +class OrderView(CustomerRequiredMixin, ListView): + template_name = 'pretixpresale/organizers/customer_orders.html' context_object_name = 'orders' paginate_by = 20