From ecb347c2045f8c7c8b11d51f1d23b986e577db50 Mon Sep 17 00:00:00 2001 From: philipp <philipp@hofer.link> Date: Mon, 19 Aug 2024 14:06:00 +0200 Subject: [PATCH] nag, if a long logentry is entered w/o trip_type; Fixes #448 --- templates/admin/schnupper/index.html.tera | 3 ++- templates/includes/forms/log.html.tera | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/admin/schnupper/index.html.tera b/templates/admin/schnupper/index.html.tera index 755985d..9821a5a 100644 --- a/templates/admin/schnupper/index.html.tera +++ b/templates/admin/schnupper/index.html.tera @@ -13,7 +13,8 @@ <li class="py-1" {% if "paid" in user.roles %}style="background-color: green;"{% endif %}> {{ user.name }} ({{ user.mail }} - {%- if user.notes %} | {{ user.notes }}{% endif -%} + {%- if user.notes %} | {{ user.notes }} + {% endif -%} ) <a class="btn btn-primary" href="/admin/user/move/schnupperant/{{ user.id }}/to/scheckbuch" diff --git a/templates/includes/forms/log.html.tera b/templates/includes/forms/log.html.tera index 9b1e94b..bb5f193 100644 --- a/templates/includes/forms/log.html.tera +++ b/templates/includes/forms/log.html.tera @@ -279,7 +279,8 @@ {% macro home(log) %} <form class="grid grid-cols-1 gap-3" action="/log/{{ log.id }}" - method="post"> + method="post" + onsubmit="var distance = parseFloat(document.getElementById('distance_in_km{{ log.id }}js').value); var logtype = document.getElementById('logtype{{ log.id }}js').value; if (distance > 50 && (!logtype || logtype === 'Normal')) { return confirm('Die eingegebene Distanz beträgt mehr als 50 km und es wurde kein Typ (Wanderfahrt, Regatta, ...) ausgewählt. Wenn es eine Wanderfahrt war, stell dies bitte unter \'Details ändern\' ein. Möchtest du das NICHT tun und den Eintrag OHNE Typ speichern?'); } return true;"> {{ macros::input(label='Ankunftszeit', name='arrival', type='datetime-local', required=true, class="change-id-js rounded-md current-date-time") }} <div> <label for="destination" class="text-sm text-gray-600 dark:text-gray-100">Ziel</label>