Merge branch 'main' of ssh://git.hofer.link:2222/Ruderverein-Donau-Linz/rowt
CI/CD Pipeline / test (push) Successful in 16m57s
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 19:49:24 +02:00
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 %}#}
+2 -2
View File
@@ -274,7 +274,7 @@ function setChoiceByLabel(choicesInstance, label) {
{{ label }}
</label>
{% endmacro checkbox %}
{% macro select(label, data, name='trip_type', default='', id='', selected_id='', display='', extras='', class='', wrapper_class='', required=false, show_seats=false, new_last_entry='', nonSelectableDefault=false, only_ergo=false) %}
{% macro select(label, data, name='trip_type', default='', id='', selected_id='', display='', extras='', class='', wrapper_class='', required=false, show_seats=false, new_last_entry='', nonSelectableDefault=false, only_ergo=false, allow_on_water=false) %}
<div class="{{ wrapper_class }}">
<label for="{{ name }}" class="text-sm text-gray-600 dark:text-gray-100">{{ label }}</label>
{% if display == '' %}
@@ -290,7 +290,7 @@ function setChoiceByLabel(choicesInstance, label) {
<option value="{{ d.id }}"
{% if only_ergo and d.id!=4 %}disabled{% endif %}
{% if d.id == selected_id %}selected{% endif %}
{% if extras != '' %} {% for extra in extras %} {% if extra != 'on_water' and d[extra] %} data- {{ extra }}={{ d[extra] }} {% else %} {% if d[extra] %}disabled{% endif %}
{% if extras != '' %} {% for extra in extras %} {% if extra != 'on_water' and d[extra] %} data- {{ extra }}={{ d[extra] }} {% else %} {% if d[extra] and not allow_on_water %}disabled{% endif %}
{% endif %}
{% endfor %}
{% endif %}