From 40021a447d9a6444205c82b2bdcd924e0586a07f Mon Sep 17 00:00:00 2001 From: Christian Heller <c.heller@plomlompom.de> Date: Sun, 24 Dec 2023 01:44:50 +0100 Subject: [PATCH] Improve todo accounting. --- todo_templates/day.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/todo_templates/day.html b/todo_templates/day.html index 5c63670..a6ad249 100644 --- a/todo_templates/day.html +++ b/todo_templates/day.html @@ -47,7 +47,7 @@ comment: <input name="day_comment" value="{{ db.selected_day.comment|e }}"> {% else %} <td class="checkbox"><input name="choose" type="checkbox" value="{{ uuid }}"</td> <td class="checkbox"><input name="done" type="checkbox" value="{{ uuid }}"></td> -<td class="number"><input name="day_weight" type="number" step=0.1 size=8 placeholder={{ t.current_default_weight }} ></td> +<td class="number"><input class="day_weight_input" name="day_weight" type="number" step=0.1 size=8 placeholder={{ t.current_default_weight }} ></td> <td></td> <td></td> <td></td> @@ -58,6 +58,7 @@ comment: <input name="day_comment" value="{{ db.selected_day.comment|e }}"> </table> <input type="submit" value="update"> </form> +{% include 'watch_form.html' %} <script> var day_weight_inputs = document.getElementsByClassName("day_weight_input"); for (let i = 0; i < day_weight_inputs.length; i++) { @@ -72,9 +73,9 @@ for (let i = 0; i < day_weight_inputs.length; i++) { input.value = parseFloat(input.placeholder); } input.value = parseFloat(input.value).toFixed(1); + formHasChanged = true; }; input.insertAdjacentElement('afterend', button); } </script> -{% include 'watch_form.html' %} {% endblock %} -- 2.30.2