Merge branch 'master' into ticket-testing

This commit is contained in:
James Polley 2018-04-17 15:54:38 +10:00
commit 4162ba7c3f
No known key found for this signature in database
GPG key ID: ED9F8A8538E21957
5 changed files with 28 additions and 10 deletions

View file

@ -16,7 +16,7 @@
{% for room in timetable.rooms %} {% for room in timetable.rooms %}
{% with room|trackname:timetable.day as track_name %} {% with room|trackname:timetable.day as track_name %}
<th class="track-name">{% if track_name %}<p>{{ track_name }}{% endif %}</th> <th class="track-name">{% if track_name %}<p>{{ track_name }}{% endif %}</th>
{% endwith %} {% endwith %}
{% endfor %} {% endfor %}
</tr> </tr>
{% endif %} {% endif %}
@ -44,6 +44,8 @@
<em>Session chair: <em>Session chair:
{% if not session.chair %} {% if not session.chair %}
<a href="{% url "schedule_session_detail" session.id %}">Volunteer! 🙋</a> <a href="{% url "schedule_session_detail" session.id %}">Volunteer! 🙋</a>
{% else %}
<a href="{% url "schedule_session_detail" session.id %}">{{ session.chair.user.attendee.attendeeprofilebase.attendeeprofile.name }}</a>
{% endif %}</em> {% endif %}</em>
{% endfor %} {% endfor %}
</div> </div>

View file

@ -98,12 +98,16 @@ class CheckIn(models.Model):
self.badge_printed = True self.badge_printed = True
self.save() self.save()
def unset_badge(self):
self.badge_printed = False
self.save()
def mark_schwag_given(self): def mark_schwag_given(self):
self.schwag_given = True self.schwag_given = True
self.save() self.save()
def bulk_mark_given(self): def bulk_mark_given(self):
self.badge_printed = True self.checked_in_bool = True
self.schwag_given = True self.schwag_given = True
self.save() self.save()

View file

@ -68,7 +68,8 @@
<td>{{ attendee.attendeeprofilebase.attendeeprofile.name }}</td> <td>{{ attendee.attendeeprofilebase.attendeeprofile.name }}</td>
<td>{{ attendee.ticket_type }}</td> <td>{{ attendee.ticket_type }}</td>
<td>{{ attendee.user.email }}</td> <td>{{ attendee.user.email }}</td>
<td><a href="{% url 'regidesk:check_in_user_view' attendee.user.checkin.code %}">{{ attendee.user.checkin.code }}</a></td> <td>{% if attendee.user.checkin.code %}
<a href="{% url 'regidesk:check_in_user_view' attendee.user.checkin.code %}">{{ attendee.user.checkin.code }}</a>{% endif %}</td>
<td> <td>
{% if attendee.user.checkin %} {% if attendee.user.checkin %}
{% if attendee.user.checkin.boardingpass %} {% if attendee.user.checkin.boardingpass %}

View file

@ -31,6 +31,7 @@
<dt>Spearker Dinner Tickets</dt><dd>{{ speakers_dinner_count }}</dd> <dt>Spearker Dinner Tickets</dt><dd>{{ speakers_dinner_count }}</dd>
<dt>PDNS Tickets</dt><dd>{{ pdns_count }}</dd> <dt>PDNS Tickets</dt><dd>{{ pdns_count }}</dd>
<dt>Over 18 years</dt><dd>{% if user.attendee.attendeeprofilebase.attendeeprofile.of_legal_age %}yes{% else %}<strong class="red">NO</strong>{% endif %}</dd> <dt>Over 18 years</dt><dd>{% if user.attendee.attendeeprofilebase.attendeeprofile.of_legal_age %}yes{% else %}<strong class="red">NO</strong>{% endif %}</dd>
<dt>Username</dt><dd>{{ user.username }}</dd>
</dl> </dl>
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
@ -71,11 +72,15 @@
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>Status</dt><dd>{% if check_in.badge_printed %}Marked{% else %}Not marked{% endif %} as printed</dd> <dt>Status</dt><dd>{% if check_in.badge_printed %}Marked{% else %}Not marked{% endif %} as printed</dd>
</dl> </dl>
<form method="post"> <form method="post" hidden>
<input type="checkbox" name="badge" value="badge" checked hidden> <input type="checkbox" name="badge" value="badge" checked hidden>
<a type="button" class="btn btn-primary" href="badge">Show Badge</a> <a type="button" class="btn btn-primary" href="badge">Show Badge</a>
<input class="btn {% if check_in.badge_printed %}btn-danger{% else %}btn-success{% endif %} pull-right" type="submit" value="Submit"> <input class="btn {% if check_in.badge_printed %}btn-danger{% else %}btn-success{% endif %} pull-right" type="submit" value="Submit">
</form> </form>
<form method="post">
<input type="checkbox" name="unbadge" value="unbadge" checked hidden>
<input class="btn btn-danger pull-right" type="submit" value="Force Reprint">
</form>
</div> </div>
</div> </div>
@ -103,15 +108,16 @@
</div> </div>
</div> </div>
<div class="panel {% if check_in.badge_printed or check_in.schwag_given %}panel-danger{% else %}panel-success{% endif %}"> <div class="panel {% if check_in.checked_in_bool or check_in.schwag_given %}panel-danger{% else %}panel-success{% endif %}">
<div class="panel-heading">Bulk actions</div> <div class="panel-heading">Bulk actions</div>
<div class="panel-body"> <div class="panel-body">
<p>Mark attendee as checked in and schwag given</p>
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>Status</dt><dd>{% if check_in.badge_printed or check_in.schwag_given %}One of the items in bulk action is marked as given already{% else %}Both items are marked as unrecived{% endif %}</dd> <dt>Status</dt><dd>{% if check_in.checked_in_bool or check_in.schwag_given %}One of the items in bulk action is marked as given already{% else %}Both items are marked as unrecived{% endif %}</dd>
</dl> </dl>
<form method="post"> <form method="post">
<input type="checkbox" name="bulk" value="bulk" checked hidden> <input type="checkbox" name="bulk" value="bulk" checked hidden>
<input class="btn {% if check_in.badge_printed or check_in.schwag_given %}btn-danger{% else %}btn-success{% endif %} pull-right" type="submit" value="Submit"> <input class="btn {% if check_in.checked_in_bool or check_in.schwag_given %}btn-danger{% else %}btn-success{% endif %} pull-right" type="submit" value="Submit">
</form> </form>
</div> </div>
</div> </div>

View file

@ -52,7 +52,8 @@ def boardingpass(request):
'default template to use. This page has similar information to ' 'default template to use. This page has similar information to '
'the boarding pass - please check back later.') 'the boarding pass - please check back later.')
return redirect('/tickets/review') return redirect('/tickets/review')
prepare_boarding_pass(request, templates[0]) prepare_boarding_pass(request.user, templates[0])
checkin = CheckIn.objects.get_or_create(user=user)[0]
boardingpass = checkin.boardingpass boardingpass = checkin.boardingpass
qrcode_url = request.build_absolute_uri(reverse("regidesk:checkin_png", args=[checkin.code])) qrcode_url = request.build_absolute_uri(reverse("regidesk:checkin_png", args=[checkin.code]))
@ -81,7 +82,9 @@ def boarding_overview(request, boarding_state="pending"):
price__gte=0 price__gte=0
) )
ticketholders = { ticket.invoice.user: ticket.product.name for ticket in tickets } print(datetime.now())
ticketholders = ( ticket.invoice.user for ticket in tickets )
print(datetime.now())
attendees = people.Attendee.objects.select_related( attendees = people.Attendee.objects.select_related(
"attendeeprofilebase", "attendeeprofilebase",
@ -194,7 +197,7 @@ def prepare_boarding_pass(user, template, attendee=None):
if attendee: if attendee:
user = attendee.user user = attendee.user
else: else:
user = request.user user = user
attendee=user.attendee attendee=user.attendee
checkin = CheckIn.objects.get_or_create(user=user) checkin = CheckIn.objects.get_or_create(user=user)
ctx = { ctx = {
@ -312,6 +315,8 @@ def check_in_overview(request, access_code):
check_in.bulk_mark_given() check_in.bulk_mark_given()
elif 'exception' in request.POST: elif 'exception' in request.POST:
check_in.set_exception(request.POST['exception']) check_in.set_exception(request.POST['exception'])
elif 'unbadge' in request.POST:
check_in.unset_badge()
return redirect(request.path) return redirect(request.path)
ctx = { ctx = {
'check_in': check_in, 'check_in': check_in,