{% macro new(only_ones, allow_any_shipmaster, shipmaster) %}
{{ log::boat_select(only_ones=only_ones) }} {% if allow_any_shipmaster %} {% else %} {% endif %} {% if not only_ones %} {{ macros::checkbox(label='handgesteuert', name='shipmaster_only_steering') }} {% endif %} {% if not only_ones %} {{ log::rower_select(id="newrower", selected=[], class="col-span-2") }} {% endif %}
{{ macros::input(label='Abfahrtszeit', name='departure', type='datetime-local', required=true) }} {{ macros::input(label='Ankunftszeit', name='arrival', type='datetime-local') }}
{% for distance in distances %}
{{ macros::input(label="Distanz", name="distance_in_km", type="number", min=1) }} km
{{ macros::input(label="Kommentar", name="comments", type="text", wrapper_class="col-span-2") }}
{{ macros::select(data=logtypes, select_name='logtype', default="Normal") }}
{% endmacro new %} {% macro show_boats(only_ones) %} {% if only_ones %} {% set_global boats = boats | filter(attribute="amount_seats", value=1) %} {% endif %} {% for amount_seats, grouped_boats in boats | group_by(attribute="amount_seats") %}
{{ amount_seats }}x
{% for boat in grouped_boats %}
{{ boat.name }}
{% endfor %}
{% endfor %} {% endmacro boats %} {% macro boat_select(only_ones) %} {% if not only_ones %} {{ macros::select(data=boats, select_name='boat_id', display=["name", " (","amount_seats", " x)"], extras=["default_shipmaster_only_steering", "amount_seats"], class="col-span-2") }} {% 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"], class="col-span-2") }} {% endif %} {% endmacro boat_select %} {% macro show(log, state, allowed_to_close=false, only_ones) %}
{{ log.departure_timestamp | date(format="%H:%M") }} Uhr ({{ log.boat.name }})
({{ log.boat.name }})" data-body="#log{{ log.id }}" class="inline-block link-primary mr-3"> Details
{% if allowed_to_close and state == "on_water" %} ({{ log.boat.name }})" data-body="#close{{ log.id }}" class="btn btn-dark w-full mt-3"> Beenden {% endif %}
{% endmacro show %} {% macro show_old(log, state, allowed_to_close=false, only_ones) %} Bootsname: {{ log.boat.name }}
Schiffsführer: {{ log.shipmaster_user.name }}
{% if log.shipmaster_only_steering %} Schiffsführer steuert nur {% endif %} Weggefahren: {{ log.departure }}
{% if state == "completed" %} Angekommen: {{ log.arrival}}
{% endif %} {% set amount_rowers = log.rowers | length %} {% set amount_guests = log.boat.amount_seats - amount_rowers -1 %} {% if allowed_to_close and state == "on_water" %} {{ log::home(log=log, only_ones=only_ones) }} {% else %} Ziel: {{ log.destination }}
{% if state == "completed" %} Km: {{ log.distance_in_km }}
{% endif %} {% if log.comments %} Kommentare: {{ log.comments }}
{% endif %} {% if log.logtype %} Logtype: {{ log.logtype }}
{% endif %} {% if amount_guests > 0 or log.rowers | length > 0 %} Ruderer: {% endif %} {% if amount_guests > 0 %} {{ amount_guests }} Gäste (ohne Account) {% endif %} {% for rower in log.rowers %} {{ rower.name }} {% endfor %} {% endif %} {% endmacro show_old %} {% macro home(log, only_ones) %}
{% if not only_ones %} {% endif %}
{{ macros::input(label="Distanz", name="distance_in_km", id="distance_in_km_home", type="number", min=0, value=log.distance_in_km, required=true) }} km
{{ macros::input(label="Kommentar", name="comments", type="text", value=log.comments) }}
{{ macros::select(data=logtypes, select_name='logtype', default="Normal", selected_id=log.logtype) }}
{% endmacro home %} {% macro rower_select(id, selected, amount_seats='', class='') %}
/{{amount_seats}} Ruderer ausgewählt
{% endmacro rower_select %}