forked from CGM_Public/pretix_original
Show seat in web and PDF check-in list
This commit is contained in:
@@ -705,6 +705,8 @@ class CheckInFilterForm(FilterForm):
|
||||
'-timestamp': (FixedOrderBy(F('last_checked_in'), nulls_last=True, descending=True), '-order__code'),
|
||||
'item': ('item__name', 'variation__value', 'order__code'),
|
||||
'-item': ('-item__name', '-variation__value', '-order__code'),
|
||||
'seat': ('seat__sorting_rank', 'seat__guid'),
|
||||
'-seat': ('-seat__sorting_rank', '-seat__guid'),
|
||||
'name': {'_order': F('display_name').asc(nulls_first=True),
|
||||
'display_name': Coalesce('attendee_name_cached', 'addon_to__attendee_name_cached')},
|
||||
'-name': {'_order': F('display_name').desc(nulls_last=True),
|
||||
|
||||
@@ -66,6 +66,10 @@
|
||||
<a href="?{% url_replace request 'ordering' 'code'%}"><i class="fa fa-caret-up"></i></a></th>
|
||||
<th>{% trans "Item" %} <a href="?{% url_replace request 'ordering' '-item'%}"><i class="fa fa-caret-down"></i></a>
|
||||
<a href="?{% url_replace request 'ordering' 'item'%}"><i class="fa fa-caret-up"></i></a></th>
|
||||
{% if seats %}
|
||||
<th>{% trans "Seat" %} <a href="?{% url_replace request 'ordering' '-seat'%}"><i class="fa fa-caret-down"></i></a>
|
||||
<a href="?{% url_replace request 'ordering' 'seat'%}"><i class="fa fa-caret-up"></i></a></th>
|
||||
{% endif %}
|
||||
<th>{% trans "Email" %} <a href="?{% url_replace request 'ordering' '-email'%}"><i class="fa fa-caret-down"></i></a>
|
||||
<a href="?{% url_replace request 'ordering' 'email'%}"><i class="fa fa-caret-up"></i></a></th>
|
||||
<th>{% trans "Name" %} <a href="?{% url_replace request 'ordering' '-name'%}"><i class="fa fa-caret-down"></i></a>
|
||||
@@ -95,6 +99,9 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ e.item }}{% if e.variation %} – {{ e.variation }}{% endif %}</td>
|
||||
{% if seats %}
|
||||
<td>{{ e.seat }}</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
{% if e.addon_to and e.addon_to.attendee_email %}
|
||||
{{ e.addon_to.attendee_email }}
|
||||
|
||||
@@ -115,7 +115,9 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if not v.is_active %}<del>{% endif %}
|
||||
<strong><a href="{% url "control:event.voucher" organizer=request.event.organizer.slug event=request.event.slug voucher=v.id %}">{{ v.code }}</a></strong>
|
||||
{% if not v.is_active %}</del>{% endif %}
|
||||
</td>
|
||||
<td>{{ v.redeemed }} / {{ v.max_usages }}</td>
|
||||
<td>{{ v.valid_until|date }}</td>
|
||||
|
||||
@@ -68,6 +68,7 @@ class CheckInListShow(EventPermissionRequiredMixin, PaginationMixin, ListView):
|
||||
def get_context_data(self, **kwargs):
|
||||
ctx = super().get_context_data(**kwargs)
|
||||
ctx['checkinlist'] = self.list
|
||||
ctx['seats'] = self.list.subevent.seating_plan if self.list.subevent else self.request.event.seating_plan
|
||||
ctx['filter_form'] = self.filter_form
|
||||
for e in ctx['entries']:
|
||||
if e.last_checked_in:
|
||||
|
||||
@@ -103,7 +103,7 @@ class CheckInListMixin(BaseExporter):
|
||||
)
|
||||
).prefetch_related(
|
||||
'answers', 'answers__question', 'addon_to__answers', 'addon_to__answers__question'
|
||||
).select_related('order', 'item', 'variation', 'addon_to', 'order__invoice_address', 'voucher')
|
||||
).select_related('order', 'item', 'variation', 'addon_to', 'order__invoice_address', 'voucher', 'seat')
|
||||
|
||||
if not cl.all_products:
|
||||
qs = qs.filter(item__in=cl.limit_products.values_list('id', flat=True))
|
||||
@@ -259,6 +259,7 @@ class PDFCheckinList(ReportlabExportMixin, CheckInListMixin, BaseExporter):
|
||||
op.order.code,
|
||||
Paragraph(name, self.get_style()),
|
||||
Paragraph(str(op.item) + (" – " + str(op.variation.value) if op.variation else "") + "<br/>" +
|
||||
((str(op.seat) + " / ") if op.seat else None) +
|
||||
money_filter(op.price, self.event.currency), self.get_style()),
|
||||
]
|
||||
acache = {}
|
||||
|
||||
Reference in New Issue
Block a user