Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiate live-in vehicle tickets from parking tickets #1331

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/common/receipt.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ def render_receipt(user, png=False, pdf=False):

admissions = purchases.filter(ProductGroup.type == "admissions").all()

vehicle_tickets = purchases.filter(
ProductGroup.type.in_(["parking", "campervan"])
).all()
parking_tickets = purchases.filter(ProductGroup.type == "parking").all()
campervan_tickets = purchases.filter(ProductGroup.type == "campervan").all()

tees = purchases.filter(ProductGroup.type == "tees").all()
hires = purchases.filter(ProductGroup.type == "hire").all()
Expand All @@ -49,7 +48,8 @@ def render_receipt(user, png=False, pdf=False):
format_inline_qr=format_inline_qr,
format_inline_barcode=format_inline_barcode,
admissions=admissions,
vehicle_tickets=vehicle_tickets,
parking_tickets=parking_tickets,
campervan_tickets=campervan_tickets,
transferred_tickets=transferred_tickets,
tees=tees,
hires=hires,
Expand Down
40 changes: 40 additions & 0 deletions templates/receipt-campervan.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{% from '_receipthelpers.html' import render_header, render_barcode with context %}

{% for ticket in campervan_tickets %}
{{ render_header(ticket.owner) }}
<h3>Live-in vehicle ticket {{ loop.index }}</h3>
<div class="vehicle-tickets">
{# TODO: This wording needs amending! https://github.com/emfcamp/Website/issues/1193 #}
<p>Please put this on your dashboard before arriving at EMF.
Volunteers at the <b>main access gate</b> will check it on your arrival.
They will show you where to park and unload your stuff.</p>
<p>For details on getting to the site, please visit
<a href="https://wiki.emfcamp.org/wiki/Travel">our wiki page</a>.</p>
<p style="padding-bottom: 14px">If you fill in your number below we will try to contact you about
your vehicle in case of emergency.</p>

<div>&nbsp;</div>
<div>&nbsp;</div>

{{ render_barcode(ticket.owner) }}

<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>

<h4>Your ticket details</h4>
<div class="product">{{ ticket.product.display_name }}</div>

<div>&nbsp;</div>

<table style="height: 70px; width: 100%"><tr>
<td style="width: 300px; font-size: 30pt">Phone number</td>
<td style="border: 0.7mm solid black"></td>
</tr></table>
</div>

{% if not loop.last %}
<div class="nextpage"></div>
{% endif %}
{% endfor %}

2 changes: 1 addition & 1 deletion templates/receipt-parking.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% from '_receipthelpers.html' import render_header, render_barcode with context %}

{% for ticket in vehicle_tickets %}
{% for ticket in parking_tickets %}
{{ render_header(ticket.owner) }}
<h3>Parking ticket {{ loop.index }}</h3>
<div class="vehicle-tickets">
Expand Down
12 changes: 10 additions & 2 deletions templates/receipt.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,22 @@ <h4>Your hired items</h4>

</div>

{% if vehicle_tickets %}
{% if parking_tickets %}
<div class="nextpage"></div>
{% endif %}

{% endif %}

{% if vehicle_tickets %}
{% if parking_tickets %}
{% include 'receipt-parking.html' %}

{% if campervan_tickets %}
<div class="nextpage"></div>
{% endif %}
{% endif %}

{% if campervan_tickets %}
{% include 'receipt-campervan.html' %}
{% endif %}
</div>
{% endblock %}
Expand Down
Loading