{% 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 %} {% if "paid" not in loggedin_user.roles %}
{% endif %}

Ausfahrten

{% include "includes/buttons" %} {% for day in days %} {% set amount_trips = day.planned_events | length + day.trips | length %} {% set_global day_cox_needed = false %} {% if day.planned_events | length > 0 %} {% for planned_event in day.planned_events %} {% if planned_event.cox_needed %} {% set_global day_cox_needed = true %} {% endif %} {% endfor %} {% endif %}

{{ day.day| date(format="%d.%m.%Y") }} {{ day.day | date(format="%A", locale="de_AT") }}

{% if day.planned_events | length > 0 or day.trips | length > 0 %}
{# --- START Events --- #} {% if day.planned_events | length > 0 %} {% for planned_event in day.planned_events | sort(attribute="planned_starting_time") %} {% set amount_cur_cox = planned_event.cox | length %} {% set amount_cox_missing = planned_event.planned_amount_cox - amount_cur_cox %}
{{ planned_event.planned_starting_time }} Uhr ({{ planned_event.name }} {% if planned_event.trip_type %} - {{ planned_event.trip_type.icon | safe }} {{ planned_event.trip_type.name }} {% endif %} )
Details
{# --- START Row Buttons --- #} {% 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 %} {# --- END Row Buttons --- #} {# --- START Cox Buttons --- #} {% if "cox" in loggedin_user.roles %} {% 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 %} {# --- END Cox Buttons --- #}
{# --- START Sidebar Content --- #} {# --- END Sidebar Content --- #}
{% endfor %} {% endif %} {# --- END Events --- #} {# --- START Trips --- #} {% if day.trips | length > 0 %} {% for trip in day.trips | sort(attribute="planned_starting_time") %}
{% if trip.max_people == 0 %} ⚠ {{ trip.planned_starting_time }} Uhr (Absage {{ trip.cox_name -}} {% if trip.trip_type %} - {{ trip.trip_type.icon | safe }}{{ trip.trip_type.name }} {% endif -%} ) {% else %} {{ trip.planned_starting_time }} Uhr ({{ trip.cox_name -}} {% if trip.trip_type %}- {{ trip.trip_type.icon | safe }} {{ trip.trip_type.name }}{% endif -%} ) {% endif %}
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 %}
{# --- START Sidebar Content --- #} {# --- END Sidebar Content --- #}
{% endfor %} {% endif %} {# --- END Trips --- #}
{% endif %}
{# --- START Add Buttons --- #} {% if "planned_event" in loggedin_user.roles or "cox" in loggedin_user.roles %}
{% if "planned_event" in loggedin_user.roles %} {% include "includes/plus-icon" %} Event {% endif %} {% if "cox" in loggedin_user.roles %} {% include "includes/plus-icon" %} Ausfahrt {% endif %}
{% endif %} {# --- END Add Buttons --- #}
{% endfor %}
{% if "cox" in loggedin_user.roles %} {% include "forms/trip" %} {% endif %} {% if "planned_event" in loggedin_user.roles %} {% include "forms/event" %} {% endif %} {% endblock content %}