From f60c1d180ce095b8f8218186f420f110c6140fe1 Mon Sep 17 00:00:00 2001 From: Midgard Date: Tue, 3 Mar 2020 16:21:01 +0100 Subject: [PATCH] Stub for choice selection --- app/templates/order.html | 44 ++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/app/templates/order.html b/app/templates/order.html index e456ae3..b223ab2 100644 --- a/app/templates/order.html +++ b/app/templates/order.html @@ -54,24 +54,26 @@ - {% if dish and dish.choices %} - {% for (choice_type, choice) in dish.choices %} -
-
- -
- {% endfor %} - {% endif %} +
+ {% if dish and dish.choices %} + {% for (choice_type, choice) in dish.choices %} +
+
+ +
+ {% endfor %} + {% endif %} +
{{ form.comment.label(class='control-label') }}
@@ -202,5 +204,11 @@ var choice = options[index] select.val(choice.value).trigger("change") } + + function updateChoices() { + var dish_id = $("#dish_id").val(); + $("#dish_choices").html("Choices for " + dish_id); + } + $("#dish_id").on("change", updateChoices); {% endblock %}