diff --git a/src/backoffice/static/js/ticket_scan.js b/src/backoffice/static/js/ticket_scan.js new file mode 100644 index 00000000..d88243d3 --- /dev/null +++ b/src/backoffice/static/js/ticket_scan.js @@ -0,0 +1,39 @@ +document.addEventListener("DOMContentLoaded", () => { + "use strict"; + + const search_form = document.getElementById("search_form"); + const ticket_token_input = document.getElementById("ticket_token_input"); + const scan_again = document.getElementById("scan_again"); + + const check_in_input = document.getElementById("check_in_input"); + const hand_out_badge_input = document.getElementById("hand_out_badge_input"); + const check_in_form = document.getElementById("check_in_form"); + + search_form.onsubmit = submit; + + function submit(e) { + e.preventDefault(); + + if (ticket_token_input.value === "#clear") { + window.location.replace(window.location.pathname); + } else if (ticket_token_input.value === "#check-in") { + check_in_input.checked = true; + check_in_form.submit(); + } else if (ticket_token_input.value === "#hand-out-badge") { + hand_out_badge_input.checked = true; + check_in_form.submit(); + } else if (ticket_token_input.value.length === 65) { + search_form.submit(); + } else { + scan_again.removeAttribute("hidden"); + } + } + + document.addEventListener("keydown", event => { + if (event.key === "#") { + ticket_token_input.value = ""; + ticket_token_input.focus(); + } + }); + +}); diff --git a/src/backoffice/templates/badge_handout.html b/src/backoffice/templates/badge_handout.html index 722f9795..c92ed64b 100644 --- a/src/backoffice/templates/badge_handout.html +++ b/src/backoffice/templates/badge_handout.html @@ -13,7 +13,7 @@ Use this view to hand out badges to participants. Use the search field to search for username, email, products, order ID, ticket UUID, etc. To check in participants go to the Ticket Checkin view instead. To hand out merchandise and other products go to the Hand Out Products view instead.
Use this view to mark products such as merchandise, cabins, fridges and so on as handed out.
- - -Use this view to check-in tickets when participants arrive.
- - -Use this view to mark badges as handed out.
+ ++ Use this to get scan tickets +
{% endif %} diff --git a/src/backoffice/templates/product_handout.html b/src/backoffice/templates/product_handout.html index 677ff974..a8db0054 100644 --- a/src/backoffice/templates/product_handout.html +++ b/src/backoffice/templates/product_handout.html @@ -13,7 +13,7 @@ Use this view to hand out products to participants. Use the search field to search for username, email, products, order ID etc. To check in participants go to the Ticket Checkin view instead. To hand out badges go to the Badge Handout view instead.+ Type: + | + {{ ticket.ticket_type }} + + |
+ Used?: + | + {{ ticket.used }} + + {% if ticket.ticket_type.includes_badge %} + |
+ Badge handed out?: + | + {{ ticket.badge_handed_out }} + {% endif %} + + {% if ticket.product %} + |
+ Product: + | + {{ ticket.product }} + |
+ Order: + | + {{ ticket.order }} + {% endif %} + + {% if ticket.sponsor %} + |
+ Sponsor + | + {{ ticket.sponsor }} + {% endif %} + + + |