mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Order email history: Record more information about attachments (Z#23185463) (#4914)
This commit is contained in:
@@ -51,6 +51,41 @@
|
||||
{{ log.parsed_data.subject }}</strong>
|
||||
</p>
|
||||
<pre>{{ log.parsed_data.message }}</pre>
|
||||
<ul class="list-unstyled">
|
||||
{% if log.parsed_data.attach_tickets %}
|
||||
<li><span class="fa fa-files-o fa-fw"></span> {% trans "Tickets" %}</li>
|
||||
{% endif %}
|
||||
{% if log.parsed_data.attach_ical %}
|
||||
<li><span class="fa fa-calendar-o fa-fw"></span> {% trans "Calendar invite" %}</li>
|
||||
{% endif %}
|
||||
{% if log.parsed_data.invoices %}
|
||||
{% for i in log.parsed_invoices %}
|
||||
<li>
|
||||
<span class="fa fa-file-o fa-fw"></span>
|
||||
<a href="{% url "control:event.invoice.download" invoice=i.pk event=request.event.slug organizer=request.event.organizer.slug %}" target="_blank">
|
||||
{% if i.is_cancellation %}{% trans "Cancellation" context "invoice" %}{% else %}{% trans "Invoice" %}{% endif %}
|
||||
{{ i.number }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if log.parsed_data.attach_other_files %}
|
||||
{% for f in log.parsed_other_files %}
|
||||
<li>
|
||||
<span class="fa fa-file-o fa-fw"></span>
|
||||
{{ f }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if log.parsed_data.attach_cached_files %}
|
||||
{% for f in log.parsed_data.attach_cached_files %}
|
||||
<li>
|
||||
<span class="fa fa-file-o fa-fw"></span>
|
||||
{{ f }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
@@ -135,6 +135,7 @@ from pretix.control.views import PaginationMixin
|
||||
from pretix.helpers import OF_SELF
|
||||
from pretix.helpers.compat import CompatDeleteView
|
||||
from pretix.helpers.format import SafeFormatter, format_map
|
||||
from pretix.helpers.hierarkey import clean_filename
|
||||
from pretix.helpers.safedownload import check_token
|
||||
from pretix.presale.signals import question_form_fields
|
||||
|
||||
@@ -2461,6 +2462,20 @@ class OrderEmailHistory(EventPermissionRequiredMixin, OrderViewMixin, ListView):
|
||||
)
|
||||
return qs
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
ctx = super().get_context_data(**kwargs)
|
||||
for l in ctx["logs"]:
|
||||
if l.parsed_data.get("invoices"):
|
||||
l.parsed_invoices = Invoice.objects.filter(
|
||||
event=self.request.event,
|
||||
pk__in=l.parsed_data["invoices"],
|
||||
)
|
||||
if l.parsed_data.get("attach_other_files"):
|
||||
l.parsed_other_files = [
|
||||
clean_filename(os.path.basename(f)) for f in l.parsed_data["attach_other_files"]
|
||||
]
|
||||
return ctx
|
||||
|
||||
|
||||
class AnswerDownload(EventPermissionRequiredMixin, OrderViewMixin, ListView):
|
||||
permission = 'can_view_orders'
|
||||
|
||||
Reference in New Issue
Block a user