{% import "includes/macros" as macros %} {% extends "base" %} {% block content %}
{% if flash %} {{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} {% endif %}

Ausfahrten

{% for day in days %}

{{ day.day| date(format="%d.%m.%Y") }}

{% if day.planned_events | length > 0 %}
{% for planned_event in day.planned_events %}
{{ planned_event.planned_starting_time }} Uhr ({{ planned_event.name }})
Details
{% set_global cur_user_participates = false %} {% for rower in planned_event.rower%} {% if rower.name == loggedin_user.name %} {% set_global cur_user_participates = true %} {% endif %} {% endfor %} {% if cur_user_participates %} Abmelden {% endif %} {% if planned_event.max_people > planned_event.rower | length %} {% if cur_user_participates == false %} Mitrudern {% endif %} {% endif %} {% if loggedin_user.is_cox %} {% set_global cur_user_participates = false %} {% for cox in planned_event.cox %} {% if cox.name == loggedin_user.name %} {% set_global cur_user_participates = true %} {% endif %} {% endfor %} {% if cur_user_participates %} {% include "includes/cox-icon" %} Abmelden {% else %} {% include "includes/cox-icon" %} Steuern {% endif %} {% endif %}
{% endfor %}
{% endif %} {% if day.trips | length > 0 %}
{% for trip in day.trips %}
{{ trip.planned_starting_time }} Uhr ({{ trip.cox_name }})
Details
{% set_global cur_user_participates = false %} {% for rower in trip.rower %} {% if rower.name == loggedin_user.name %} {% set_global cur_user_participates = true %} {% endif %} {% endfor %} {% if cur_user_participates %} Abmelden {% endif %} {% if trip.max_people > trip.rower | length and trip.cox_id != loggedin_user.id and cur_user_participates == false%} Mitrudern {% endif %}
{% endfor %}
{% endif %}
{% if loggedin_user.is_admin %} Event hinzufügen {% endif %} {% if loggedin_user.is_cox%} Ausfahrt hinzufügen {% endif %}
{% endfor %}
{# --- START Add Trip Sidebar --- #} {# --- END Add Trip Sidebar --- #} {# --- START Form Add Trip --- #}
{{ macros::input(label='Startzeit', name='planned_starting_time', type='input', required=true) }} {{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true) }} {{ macros::input(label='Anmerkungen', name='notes', type='input') }}
{# --- END Form Add Trip --- #} {# --- START Form Add Event --- #}
{{ macros::input(label='Titel (z.B. Firmenrudern)', name='name', type='text', required=true) }} {{ macros::input(label='Startzeit', name='planned_starting_time', type='text', required=true) }} {{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', required=true) }} {{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true) }} {{ macros::checkbox(label='Gäste erlauben', name='max_allow_guestspeople') }} {{ macros::input(label='Anmerkungen', name='notes', type='text') }}
{# --- END Form Add Event --- #} {% endblock content %}