From 70930321eef138dda3e632e1429f96f064b9821a Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 27 Jul 2023 11:25:11 +0200 Subject: [PATCH] fun with js :-) --- templates/includes/forms/log.html.tera | 54 +++++++++++++++++--------- templates/includes/macros.html.tera | 15 ++++++- 2 files changed, 49 insertions(+), 20 deletions(-) diff --git a/templates/includes/forms/log.html.tera b/templates/includes/forms/log.html.tera index 607b34b..c79814e 100644 --- a/templates/includes/forms/log.html.tera +++ b/templates/includes/forms/log.html.tera @@ -1,29 +1,28 @@ {% macro new() %}
- {{ macros::select(data=boats, select_name='boat_id') }} + {{ macros::select(data=boats, select_name='boat_id', display=["name", " (","amount_seats", " x)"], extras=["default_shipmaster_only_steering", "amount_seats"]) }} + {{ macros::select(data=coxes, select_name='shipmaster', selected_id=loggedin_user.id) }} - {{ macros::checkbox(label='shipmaster_only_steering', name='shipmaster_only_steering') }} - Departure: + {{ macros::checkbox(label='shipmaster_only_steering', name='shipmaster_only_steering') }} + Departure: Arrival: - Destination: + + + / Ruderer ausgewählt
+ {% endmacro new %} diff --git a/templates/includes/macros.html.tera b/templates/includes/macros.html.tera index bc24889..fa5bcdd 100644 --- a/templates/includes/macros.html.tera +++ b/templates/includes/macros.html.tera @@ -55,13 +55,24 @@ {% endmacro checkbox %} -{% macro select(data, select_name='trip_type', default='', selected_id='') %} +{% macro select(data, select_name='trip_type', default='', selected_id='', display='', extras='') %} + {% if display == '' %} + {% set display = ["name"] %} + {% endif %} {% endmacro select %}