diff --git a/frontend/main.ts b/frontend/main.ts index 625abd6..3d4fcf2 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -35,6 +35,7 @@ interface ChoiceBoatEvent extends Event{ label: string, customProperties: { amount_seats: number, + owner: number, } }; } @@ -55,6 +56,10 @@ function selectBoatChange() { const amount_seats = event.detail.customProperties.amount_seats; setMaxAmountRowers("newrower", amount_seats); + if (event.detail.customProperties.owner){ + choiceObjects["newrower"].setChoiceByValue(event.detail.customProperties.owner+""); + } + const inputElement = document.getElementById("departure") as HTMLInputElement; const now = new Date(); const formattedDateTime = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}T${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`; @@ -201,7 +206,6 @@ function initNewChoice(select: HTMLInputElement) { if (select.dataset && select.dataset.seats) { seats = +select.dataset.seats; } - console.log(seats); let shipmaster = document.querySelector('#shipmaster-'+select.id+'js'); let steering_person = document.querySelector('#steering_person-'+select.id+'js'); diff --git a/templates/includes/macros.html.tera b/templates/includes/macros.html.tera index 1781a53..7d53179 100644 --- a/templates/includes/macros.html.tera +++ b/templates/includes/macros.html.tera @@ -151,7 +151,7 @@ {% endif %} {% for d in data %} -