Fix scanning stuff.
This commit is contained in:
parent
470115a0d9
commit
9dd6b0b23c
|
@ -16,10 +16,10 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
|
||||||
if (ticket_token_input.value === "#clear") {
|
if (ticket_token_input.value === "#clear") {
|
||||||
window.location.replace(window.location.pathname);
|
window.location.replace(window.location.pathname);
|
||||||
} else if (ticket_token_input.value === "#check-in") {
|
} else if (ticket_token_input.value === "#checkin") {
|
||||||
check_in_input.checked = true;
|
check_in_input.checked = true;
|
||||||
check_in_form.submit();
|
check_in_form.submit();
|
||||||
} else if (ticket_token_input.value === "#hand-out-badge") {
|
} else if (ticket_token_input.value === "#handoutbadge") {
|
||||||
hand_out_badge_input.checked = true;
|
hand_out_badge_input.checked = true;
|
||||||
check_in_form.submit();
|
check_in_form.submit();
|
||||||
} else if (ticket_token_input.value.length === 65) {
|
} else if (ticket_token_input.value.length === 65) {
|
||||||
|
|
|
@ -97,13 +97,13 @@
|
||||||
|
|
||||||
{% if not ticket.used %}
|
{% if not ticket.used %}
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
{% qr_code "check-in" %}
|
{% qr_code "checkin" %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if ticket.ticket_type.includes_badge and not ticket.badge_handed_out %}
|
{% if ticket.ticket_type.includes_badge and not ticket.badge_handed_out %}
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
{% qr_code "hand-out-badge" %}
|
{% qr_code "handoutbadge" %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,7 +11,7 @@ register = template.Library()
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def qr_code(value):
|
def qr_code(value):
|
||||||
stream = io.BytesIO()
|
stream = io.BytesIO()
|
||||||
img = qrcode.make("#" + value, box_size=7)
|
img = qrcode.make(value, box_size=7)
|
||||||
img.save(stream, "PNG")
|
img.save(stream, "PNG")
|
||||||
data = base64.b64encode(stream.getvalue())
|
data = base64.b64encode(stream.getvalue())
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue