nicer sort @ boat reservation
CI/CD Pipeline / test (push) Successful in 33m39s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
2026-06-04 18:25:55 +02:00
parent 0e1973fbac
commit 9dd65a859f
4 changed files with 17 additions and 7 deletions
+12 -2
View File
@@ -73,8 +73,18 @@
class="btn btn-primary w-full col-span-4 m-auto" />
</form>
{% endmacro new %}
{% macro boat_select(id="boat_id") %}
{{ macros::select(label="Boot", data=boats, name="boat_id", required=true, id=id, display=["name", " (","cat",")"], extras=["default_shipmaster_only_steering", "amount_seats", "on_water", "default_destination"], wrapper_class="col-span-4", show_seats=true, nonSelectableDefault=" -- Wähle ein Boot aus ---") }}
{% macro boat_select(id="boat_id", allow_on_water=false, grouped_by_boattype=false) %}
{% if grouped_by_boattype %}
<div class="col-span-4">
<label class="text-sm text-gray-600 dark:text-gray-100">Boot</label>
<select name="boat_id" id="{{ id }}" class="input rounded-md" required>
<option disabled selected value> -- Wähle ein Boot aus ---</option>
{% for cat, g in boats | group_by(attribute="cat") %}<optgroup label="{{ cat }}">{% for b in g %}<option value="{{ b.id }}">{{ b.name }}{% if b.on_water %} (am Wasser){% endif %}</option>{% endfor %}</optgroup>{% endfor %}
</select>
</div>
{% else %}
{{ macros::select(label="Boot", data=boats, name="boat_id", required=true, id=id, display=["name", " (","cat",")"], extras=["default_shipmaster_only_steering", "amount_seats", "on_water", "default_destination"], wrapper_class="col-span-4", show_seats=true, nonSelectableDefault=" -- Wähle ein Boot aus ---", allow_on_water=allow_on_water) }}
{% endif %}
{% endmacro boat_select %}
{% macro rower_select(id, selected, amount_seats='', class='', init='false', cox_on_boat='', steering_person_id='') %}
{#{% if not amount_seats or amount_seats > 1 %}#}