diff --git a/src/pretix/control/templates/pretixcontrol/order/change.html b/src/pretix/control/templates/pretixcontrol/order/change.html index e342a4956..2cbf430d8 100644 --- a/src/pretix/control/templates/pretixcontrol/order/change.html +++ b/src/pretix/control/templates/pretixcontrol/order/change.html @@ -11,6 +11,12 @@ {% blocktrans trimmed with code=order.code %} Change order: {{ code }} {% endblocktrans %} + + {% blocktrans trimmed with order=order.code %} + Back to order {{ order }} + {% endblocktrans %} +

{% blocktrans trimmed %} diff --git a/src/pretix/control/templates/pretixcontrol/order/change_contact.html b/src/pretix/control/templates/pretixcontrol/order/change_contact.html index 3036862a1..7b24302f2 100644 --- a/src/pretix/control/templates/pretixcontrol/order/change_contact.html +++ b/src/pretix/control/templates/pretixcontrol/order/change_contact.html @@ -7,6 +7,12 @@ {% block content %}

{% trans "Change contact information" %} + + {% blocktrans trimmed with order=order.code %} + Back to order {{ order }} + {% endblocktrans %} +

diff --git a/src/pretix/control/templates/pretixcontrol/order/change_locale.html b/src/pretix/control/templates/pretixcontrol/order/change_locale.html index 84f8b2c88..7a8de2840 100644 --- a/src/pretix/control/templates/pretixcontrol/order/change_locale.html +++ b/src/pretix/control/templates/pretixcontrol/order/change_locale.html @@ -7,14 +7,22 @@ {% block content %}

{% trans "Change locale information" %} + + {% blocktrans trimmed with order=order.code %} + Back to order {{ order }} + {% endblocktrans %} +

- This language will be used whenever emails are sent to the users. + {% blocktrans trimmed %} + This language will be used whenever emails are sent to the users. + {% endblocktrans %}

{% csrf_token %} - + {% bootstrap_form form layout='horizontal' %}
{% trans "Extend payment term" %} + + {% blocktrans trimmed with order=order.code %} + Back to order {{ order }} + {% endblocktrans %} + diff --git a/src/pretix/control/templates/pretixcontrol/order/mail_history.html b/src/pretix/control/templates/pretixcontrol/order/mail_history.html index 1d0d1d84c..b81f97db8 100644 --- a/src/pretix/control/templates/pretixcontrol/order/mail_history.html +++ b/src/pretix/control/templates/pretixcontrol/order/mail_history.html @@ -3,7 +3,15 @@ {% load bootstrap3 %} {% block title %}{% trans "Email history" %}{% endblock %} {% block content %} -

{% trans "Email history" %}

+

+ {% trans "Email history" %} + + {% blocktrans trimmed with order=order.code %} + Back to order {{ order }} + {% endblocktrans %} + +

{% trans "Includes sent custom and mass emails history only." %}
@@ -12,22 +20,41 @@ {% for log in logs %}
  • - {{ log.datetime|date:"SHORT_DATETIME_FORMAT" }} + {{ log.datetime|date:"SHORT_DATETIME_FORMAT" }} {% if log.user %} -
    {{ log.user.get_full_name }} +
    {{ log.user.get_full_name }} {% endif %} {% if log.display %} -
    {{ log.display }} +
    {{ log.display }} {% endif %}

    -

    - {% trans "Subject:" %} - {{ log.parsed_data.subject }} + {% if log.parsed_data.subject.items %} +

    + {% blocktrans trimmed %} + This email has been sent with an older version of pretix. We are therefore not able to + display it here accurately. + {% endblocktrans %} +
    +

    + {% trans "Subject:" %} + {% for k, v in log.parsed_data.subject.items %} + {% if k == order.locale %} + {{ v }} + {% endif %} + {% endfor %} + +

    +
    {% for k, v in log.parsed_data.message.items %}{% if k == order.locale %}{{ v }}{% endif %}{% endfor %}
    + {% else %} +

    + {% trans "Subject:" %} + {{ log.parsed_data.subject }} +

    {{ log.parsed_data.message }}
    -

    + {% endif %}
  • {% endfor %}
    {% include "pretixcontrol/pagination.html" %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/pretix/control/templates/pretixcontrol/order/refund.html b/src/pretix/control/templates/pretixcontrol/order/refund.html index 3474113ee..66e4431cb 100644 --- a/src/pretix/control/templates/pretixcontrol/order/refund.html +++ b/src/pretix/control/templates/pretixcontrol/order/refund.html @@ -6,6 +6,12 @@ {% block content %}

    {% trans "Refund order" %} + + {% blocktrans trimmed with order=order.code %} + Back to order {{ order }} + {% endblocktrans %} +

    {% blocktrans trimmed %} Do you really want to refund this order? You cannot revert this action. diff --git a/src/pretix/control/templates/pretixcontrol/order/sendmail.html b/src/pretix/control/templates/pretixcontrol/order/sendmail.html index 7f0d5842e..06d33a0d5 100644 --- a/src/pretix/control/templates/pretixcontrol/order/sendmail.html +++ b/src/pretix/control/templates/pretixcontrol/order/sendmail.html @@ -3,7 +3,15 @@ {% load bootstrap3 %} {% block title %}{% trans "Send email" %}{% endblock %} {% block content %} -

    {% trans "Send email" %}

    +

    + {% trans "Send email" %} + + {% blocktrans trimmed with order=order.code %} + Back to order {{ order }} + {% endblocktrans %} + +

    {% block inner %} {% csrf_token %} @@ -34,4 +42,4 @@
    {% endblock %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/pretix/control/views/orders.py b/src/pretix/control/views/orders.py index 5d979dfb4..b3b0582b1 100644 --- a/src/pretix/control/views/orders.py +++ b/src/pretix/control/views/orders.py @@ -609,7 +609,27 @@ class OrderLocaleChange(OrderView): return self.get(*args, **kwargs) -class OrderSendMail(EventPermissionRequiredMixin, FormView): +class OrderViewMixin: + def get_object(self, queryset=None): + try: + return Order.objects.get( + event=self.request.event, + code=self.kwargs['code'].upper() + ) + except Order.DoesNotExist: + raise Http404() + + @cached_property + def order(self): + return self.get_object() + + def get_context_data(self, **kwargs): + ctx = super().get_context_data(**kwargs) + ctx['order'] = self.order + return ctx + + +class OrderSendMail(EventPermissionRequiredMixin, OrderViewMixin, FormView): template_name = 'pretixcontrol/order/sendmail.html' permission = 'can_change_orders' form_class = OrderMailForm @@ -700,7 +720,7 @@ class OrderSendMail(EventPermissionRequiredMixin, FormView): return ctx -class OrderEmailHistory(EventPermissionRequiredMixin, ListView): +class OrderEmailHistory(EventPermissionRequiredMixin, OrderViewMixin, ListView): template_name = 'pretixcontrol/order/mail_history.html' permission = 'can_view_orders' model = LogEntry @@ -713,7 +733,10 @@ class OrderEmailHistory(EventPermissionRequiredMixin, ListView): code=self.kwargs['code'].upper() ).first() qs = order.all_logentries() - qs = qs.filter(Q(action_type="pretix.plugins.sendmail.order.email.sent") | Q(action_type="pretix.event.order.mail_sent")) + qs = qs.filter( + Q(action_type="pretix.plugins.sendmail.order.email.sent") + | Q(action_type="pretix.event.order.mail_sent") + ) return qs