{% macro new(only_ones, allow_any_shipmaster, shipmaster) %}
{% if not only_ones %} {{ 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 %} {% if allow_any_shipmaster %} {% else %} {% endif %} {% if not only_ones %} {{ macros::checkbox(label='shipmaster_only_steering', name='shipmaster_only_steering') }} {% endif %} Departure: Arrival: Destination: {% for distance in distances %} {{ macros::input(label="Distanz", name="distance_in_km", type="number", min=0) }} {{ macros::input(label="Kommentar", name="comments", type="text") }} {{ macros::select(data=logtypes, select_name='logtype', default="Normal") }} {% if not only_ones %} {{ log::rower_select(id="newrower", selected=[]) }} {% endif %}
{% endmacro new %} {% macro show(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 %} {% macro home(log, only_ones) %}
Destination: {{ macros::input(label="Distanz", name="distance_in_km", id="distance_in_km_home", type="number", min=0, value=log.distance_in_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) }} {% if not only_ones %} {{ log::rower_select(id="rowers"~log.id, selected=log.rowers, amount_seats=log.boat.amount_seats) }} {% endif %}
{% endmacro home %} {% macro rower_select(id, selected, amount_seats='') %} /{{amount_seats}} Ruderer ausgewählt {% endmacro rower_select %}