mirror of
https://github.com/pretix/pretix.git
synced 2025-12-07 22:42:26 +00:00
Sendmail history: Show selected items
This commit is contained in:
@@ -16,10 +16,13 @@
|
||||
{% if log.display %}
|
||||
<br/><span class="fa fa-comment-o fa-fw"></span> {{ log.display }}
|
||||
{% endif %}
|
||||
<br/><span class="fa fa-shopping-cart fa-fw"></span> {% trans "Sent to orders:" %}
|
||||
<br/><span class="fa fa-tag fa-fw"></span> {% trans "Sent to orders:" %}
|
||||
{% for status in log.parsed_data.sendto %}
|
||||
{{ status }}{% if forloop.revcounter > 1 %},{% endif %}
|
||||
{% endfor %}
|
||||
{% if log.pdata.items %}
|
||||
<br/><span class="fa fa-shopping-cart fa-fw"></span> {{ log.pdata.items|join:", " }}
|
||||
{% endif %}
|
||||
{% if log.pdata.subevent_obj %}
|
||||
<br/><span class="fa fa-calendar fa-fw"></span> {{ log.pdata.subevent_obj }}
|
||||
{% endif %}
|
||||
|
||||
@@ -145,12 +145,15 @@ class EmailHistoryView(EventPermissionRequiredMixin, ListView):
|
||||
qs = LogEntry.objects.filter(
|
||||
event=self.request.event,
|
||||
action_type='pretix.plugins.sendmail.sent'
|
||||
)
|
||||
).select_related('event', 'user')
|
||||
return qs
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
ctx = super().get_context_data()
|
||||
|
||||
itemcache = {
|
||||
i.pk: str(i) for i in self.request.event.items.all()
|
||||
}
|
||||
status = dict(Order.STATUS_CHOICE)
|
||||
status['overdue'] = _('pending with payment overdue')
|
||||
status['r'] = status['c']
|
||||
@@ -165,6 +168,9 @@ class EmailHistoryView(EventPermissionRequiredMixin, ListView):
|
||||
log.pdata['sendto'] = [
|
||||
status[s] for s in log.pdata['sendto']
|
||||
]
|
||||
log.pdata['items'] = [
|
||||
itemcache[i['id']] for i in log.pdata.get('items', [])
|
||||
]
|
||||
if log.pdata.get('subevent'):
|
||||
try:
|
||||
log.pdata['subevent_obj'] = self.request.event.subevents.get(pk=log.pdata['subevent']['id'])
|
||||
|
||||
Reference in New Issue
Block a user