From d5c16ad7a03cdc12679b0a538eafccf0b4997f22 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 27 Jul 2023 13:07:00 +0200 Subject: [PATCH] allow non-cox to (only) use 1x --- templates/includes/forms/log.html.tera | 68 ++++++++++++++++++++------ templates/includes/macros.html.tera | 2 + 2 files changed, 54 insertions(+), 16 deletions(-) diff --git a/templates/includes/forms/log.html.tera b/templates/includes/forms/log.html.tera index 4f44ace..361eea7 100644 --- a/templates/includes/forms/log.html.tera +++ b/templates/includes/forms/log.html.tera @@ -1,6 +1,12 @@ {% macro new() %}
- {{ macros::select(data=boats, select_name='boat_id', display=["name", " (","amount_seats", " x)"], extras=["default_shipmaster_only_steering", "amount_seats"]) }} + {% if loggedin_user.is_cox %} + {{ macros::select(data=boats, select_name='boat_id', display=["name", " (","amount_seats", " x)"], extras=["default_shipmaster_only_steering", "amount_seats"]) }} + {% else %} + {% set ones = boats | filter(attribute="amount_seats", value=1) %} + {{ macros::select(data=ones, select_name='boat_id', display=["name", " (","amount_seats", " x)"], extras=["default_shipmaster_only_steering", "amount_seats"]) }} + + {% endif %} - {{ macros::select(data=coxes, select_name='shipmaster', selected_id=loggedin_user.id) }} - {{ macros::checkbox(label='shipmaster_only_steering', name='shipmaster_only_steering') }} + {% if loggedin_user.is_cox %} + + {% else %} + + {% endif %} + {% if loggedin_user.is_cox %} + {{ macros::checkbox(label='shipmaster_only_steering', name='shipmaster_only_steering') }} + {% endif %} Departure: Arrival: Destination: