From f392e83af39539735dfe912debcc434869bc860f Mon Sep 17 00:00:00 2001 From: Marie Birner Date: Sat, 23 Sep 2023 23:23:42 +0200 Subject: [PATCH] [TASK] select boat on click --- frontend/main.ts | 4 ++++ templates/includes/forms/log.html.tera | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/main.ts b/frontend/main.ts index be953be..5321d27 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -42,6 +42,10 @@ function initBoatActions() { const rowers = Number(select.dataset.seats) - 1; choiceObjects['newrower'].config.maxItemCount = rowers; choiceObjects['newrower'].removeActiveItems(rowers); + let boatSelect = document.querySelector('#boat_id'); + if(boatSelect && select.dataset.id) { + boatSelect.value = select.dataset.id; + } (rowers === 0 ? choiceObjects['newrower'].disable() : choiceObjects['newrower'].enable()); } }); diff --git a/templates/includes/forms/log.html.tera b/templates/includes/forms/log.html.tera index 71ba728..a22dd8d 100644 --- a/templates/includes/forms/log.html.tera +++ b/templates/includes/forms/log.html.tera @@ -13,7 +13,7 @@ {{ amount_seats }}x {% for boat in grouped_boats %} -
+
{{ boat.name }} {% if boat.owner %}