mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Link order from change pages, compat for old logs
This commit is contained in:
@@ -11,6 +11,12 @@
|
|||||||
{% blocktrans trimmed with code=order.code %}
|
{% blocktrans trimmed with code=order.code %}
|
||||||
Change order: {{ code }}
|
Change order: {{ code }}
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
|
<a class="btn btn-link btn-lg"
|
||||||
|
href="{% url "control:event.order" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}">
|
||||||
|
{% blocktrans trimmed with order=order.code %}
|
||||||
|
Back to order {{ order }}
|
||||||
|
{% endblocktrans %}
|
||||||
|
</a>
|
||||||
</h1>
|
</h1>
|
||||||
<p>
|
<p>
|
||||||
{% blocktrans trimmed %}
|
{% blocktrans trimmed %}
|
||||||
|
|||||||
@@ -7,6 +7,12 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>
|
<h1>
|
||||||
{% trans "Change contact information" %}
|
{% trans "Change contact information" %}
|
||||||
|
<a class="btn btn-link btn-lg"
|
||||||
|
href="{% url "control:event.order" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}">
|
||||||
|
{% blocktrans trimmed with order=order.code %}
|
||||||
|
Back to order {{ order }}
|
||||||
|
{% endblocktrans %}
|
||||||
|
</a>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<form method="post" class="form-horizontal" href="">
|
<form method="post" class="form-horizontal" href="">
|
||||||
|
|||||||
@@ -7,14 +7,22 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>
|
<h1>
|
||||||
{% trans "Change locale information" %}
|
{% trans "Change locale information" %}
|
||||||
|
<a class="btn btn-link btn-lg"
|
||||||
|
href="{% url "control:event.order" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}">
|
||||||
|
{% blocktrans trimmed with order=order.code %}
|
||||||
|
Back to order {{ order }}
|
||||||
|
{% endblocktrans %}
|
||||||
|
</a>
|
||||||
</h1>
|
</h1>
|
||||||
<p>
|
<p>
|
||||||
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 %}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<form method="post" class="form-horizontal" href="">
|
<form method="post" class="form-horizontal" href="">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<input type="hidden" name="status" value="c" />
|
<input type="hidden" name="status" value="c"/>
|
||||||
{% bootstrap_form form layout='horizontal' %}
|
{% bootstrap_form form layout='horizontal' %}
|
||||||
<div class="form-group submit-group">
|
<div class="form-group submit-group">
|
||||||
<a class="btn btn-default btn-lg"
|
<a class="btn btn-default btn-lg"
|
||||||
|
|||||||
@@ -7,6 +7,12 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>
|
<h1>
|
||||||
{% trans "Extend payment term" %}
|
{% trans "Extend payment term" %}
|
||||||
|
<a class="btn btn-link btn-lg"
|
||||||
|
href="{% url "control:event.order" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}">
|
||||||
|
{% blocktrans trimmed with order=order.code %}
|
||||||
|
Back to order {{ order }}
|
||||||
|
{% endblocktrans %}
|
||||||
|
</a>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<form method="post" class="form-horizontal" href="">
|
<form method="post" class="form-horizontal" href="">
|
||||||
|
|||||||
@@ -3,7 +3,15 @@
|
|||||||
{% load bootstrap3 %}
|
{% load bootstrap3 %}
|
||||||
{% block title %}{% trans "Email history" %}{% endblock %}
|
{% block title %}{% trans "Email history" %}{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{% trans "Email history" %}</h1>
|
<h1>
|
||||||
|
{% trans "Email history" %}
|
||||||
|
<a class="btn btn-link btn-lg"
|
||||||
|
href="{% url "control:event.order" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}">
|
||||||
|
{% blocktrans trimmed with order=order.code %}
|
||||||
|
Back to order {{ order }}
|
||||||
|
{% endblocktrans %}
|
||||||
|
</a>
|
||||||
|
</h1>
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
{% trans "Includes sent custom and mass emails history only." %}
|
{% trans "Includes sent custom and mass emails history only." %}
|
||||||
</div>
|
</div>
|
||||||
@@ -12,22 +20,41 @@
|
|||||||
{% for log in logs %}
|
{% for log in logs %}
|
||||||
<li class="list-group-item logentry">
|
<li class="list-group-item logentry">
|
||||||
<p class="meta">
|
<p class="meta">
|
||||||
<span class="fa fa-clock-o"></span> {{ log.datetime|date:"SHORT_DATETIME_FORMAT" }}
|
<span class="fa fa-fw fa-clock-o"></span> {{ log.datetime|date:"SHORT_DATETIME_FORMAT" }}
|
||||||
{% if log.user %}
|
{% if log.user %}
|
||||||
<br/><span class="fa fa-user"></span> {{ log.user.get_full_name }}
|
<br/><span class="fa fa-fw fa-user"></span> {{ log.user.get_full_name }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if log.display %}
|
{% if log.display %}
|
||||||
<br/><span class="fa fa-comment-o"></span> {{ log.display }}
|
<br/><span class="fa fa-fw fa-comment-o"></span> {{ log.display }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
{% if log.parsed_data.subject.items %}
|
||||||
<strong>{% trans "Subject:" %}
|
<div class="alert alert-info">
|
||||||
{{ log.parsed_data.subject }}</strong>
|
{% blocktrans trimmed %}
|
||||||
|
This email has been sent with an older version of pretix. We are therefore not able to
|
||||||
|
display it here accurately.
|
||||||
|
{% endblocktrans %}
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
<strong>{% trans "Subject:" %}
|
||||||
|
{% for k, v in log.parsed_data.subject.items %}
|
||||||
|
{% if k == order.locale %}
|
||||||
|
{{ v }}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</strong>
|
||||||
|
</p>
|
||||||
|
<pre>{% for k, v in log.parsed_data.message.items %}{% if k == order.locale %}{{ v }}{% endif %}{% endfor %}</pre>
|
||||||
|
{% else %}
|
||||||
|
<p>
|
||||||
|
<strong>{% trans "Subject:" %}
|
||||||
|
{{ log.parsed_data.subject }}</strong>
|
||||||
|
</p>
|
||||||
<pre>{{ log.parsed_data.message }}</pre>
|
<pre>{{ log.parsed_data.message }}</pre>
|
||||||
</p>
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% include "pretixcontrol/pagination.html" %}
|
{% include "pretixcontrol/pagination.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -6,6 +6,12 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>
|
<h1>
|
||||||
{% trans "Refund order" %}
|
{% trans "Refund order" %}
|
||||||
|
<a class="btn btn-link btn-lg"
|
||||||
|
href="{% url "control:event.order" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}">
|
||||||
|
{% blocktrans trimmed with order=order.code %}
|
||||||
|
Back to order {{ order }}
|
||||||
|
{% endblocktrans %}
|
||||||
|
</a>
|
||||||
</h1>
|
</h1>
|
||||||
<p>{% blocktrans trimmed %}
|
<p>{% blocktrans trimmed %}
|
||||||
Do you really want to refund this order? You cannot revert this action.
|
Do you really want to refund this order? You cannot revert this action.
|
||||||
|
|||||||
@@ -3,7 +3,15 @@
|
|||||||
{% load bootstrap3 %}
|
{% load bootstrap3 %}
|
||||||
{% block title %}{% trans "Send email" %}{% endblock %}
|
{% block title %}{% trans "Send email" %}{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{% trans "Send email" %}</h1>
|
<h1>
|
||||||
|
{% trans "Send email" %}
|
||||||
|
<a class="btn btn-link btn-lg"
|
||||||
|
href="{% url "control:event.order" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}">
|
||||||
|
{% blocktrans trimmed with order=order.code %}
|
||||||
|
Back to order {{ order }}
|
||||||
|
{% endblocktrans %}
|
||||||
|
</a>
|
||||||
|
</h1>
|
||||||
{% block inner %}
|
{% block inner %}
|
||||||
<form class="form-horizontal" method="post" action="">
|
<form class="form-horizontal" method="post" action="">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
@@ -34,4 +42,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -609,7 +609,27 @@ class OrderLocaleChange(OrderView):
|
|||||||
return self.get(*args, **kwargs)
|
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'
|
template_name = 'pretixcontrol/order/sendmail.html'
|
||||||
permission = 'can_change_orders'
|
permission = 'can_change_orders'
|
||||||
form_class = OrderMailForm
|
form_class = OrderMailForm
|
||||||
@@ -700,7 +720,7 @@ class OrderSendMail(EventPermissionRequiredMixin, FormView):
|
|||||||
return ctx
|
return ctx
|
||||||
|
|
||||||
|
|
||||||
class OrderEmailHistory(EventPermissionRequiredMixin, ListView):
|
class OrderEmailHistory(EventPermissionRequiredMixin, OrderViewMixin, ListView):
|
||||||
template_name = 'pretixcontrol/order/mail_history.html'
|
template_name = 'pretixcontrol/order/mail_history.html'
|
||||||
permission = 'can_view_orders'
|
permission = 'can_view_orders'
|
||||||
model = LogEntry
|
model = LogEntry
|
||||||
@@ -713,7 +733,10 @@ class OrderEmailHistory(EventPermissionRequiredMixin, ListView):
|
|||||||
code=self.kwargs['code'].upper()
|
code=self.kwargs['code'].upper()
|
||||||
).first()
|
).first()
|
||||||
qs = order.all_logentries()
|
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
|
return qs
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user