2023-04-06 17:54:08 +02:00
|
|
|
{% import "includes/macros" as macros %}
|
|
|
|
|
2023-04-03 16:11:26 +02:00
|
|
|
{% extends "base" %}
|
|
|
|
|
|
|
|
{% block content %}
|
2023-04-07 08:57:18 +02:00
|
|
|
<div class="max-w-screen-xl w-full grid sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
|
|
{% if flash %}
|
2023-04-07 09:57:38 +02:00
|
|
|
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }}
|
2023-04-07 08:57:18 +02:00
|
|
|
{% endif %}
|
2023-04-05 22:35:52 +02:00
|
|
|
|
2023-04-07 09:44:08 +02:00
|
|
|
<h1 class="h1 sm:col-span-2 lg:col-span-3">Ausfahrten</h1>
|
2023-04-06 09:30:43 +02:00
|
|
|
|
2023-04-07 12:37:33 +02:00
|
|
|
{% if loggedin_user.is_cox %}
|
|
|
|
<div class="sm:col-span-2 lg:col-span-3 bg-primary-100 rounded-md p-3 grid md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-2">
|
|
|
|
<button type="button" title="Toggle View" class="group btn btn-primary" id="filterdays-js" aria-pressed="false">
|
|
|
|
{% include "includes/funnel-icon" %}
|
|
|
|
Tage mit Ausfahrten
|
|
|
|
</button>
|
|
|
|
<button type="button" title="Toggle View" class="group btn btn-primary" id="filtertrips-js" aria-pressed="false">
|
|
|
|
{% include "includes/funnel-icon" %}
|
|
|
|
Steuerleute gesucht
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
2023-04-07 08:57:18 +02:00
|
|
|
{% for day in days %}
|
2023-04-07 12:37:33 +02:00
|
|
|
{% set amount_trips = day.planned_events | length + day.trips | length %}
|
|
|
|
<div class="bg-white p-3 rounded-md flex justify-between flex-col" data-trips="{{ amount_trips }}">
|
2023-04-07 08:57:18 +02:00
|
|
|
<div>
|
2023-04-07 21:30:55 +02:00
|
|
|
<h2 class="text-lg text-primary-950 font-bold uppercase tracking-wide">{{ day.day| date(format="%d.%m.%Y") }} <small class="inline-block ml-1">{{ day.day | date(format="%A", locale="de_AT") }}</small></h2>
|
2023-04-05 22:35:52 +02:00
|
|
|
|
2023-04-07 08:57:18 +02:00
|
|
|
{% if day.planned_events | length > 0 %}
|
|
|
|
<div class="grid grid-cols-1 gap-3 divide-y mb-3">
|
|
|
|
{% for planned_event in day.planned_events %}
|
|
|
|
<div class="pt-2" data-coxneeded="{{ planned_event.cox_needed }}">
|
|
|
|
<div class="flex justify-between items-center">
|
|
|
|
<div>
|
|
|
|
<strong class="text-primary-900">{{ planned_event.planned_starting_time }} Uhr</strong> <small
|
|
|
|
class="text-gray-600">({{ planned_event.name }})</small><br />
|
|
|
|
<a href="#" data-sidebar="true" data-trigger="detailEvent{{ planned_event.id }}"
|
2023-04-07 09:44:08 +02:00
|
|
|
class="inline-block mr-3 link-primary">Details</a>
|
2023-04-06 17:54:08 +02:00
|
|
|
</div>
|
2023-04-07 08:57:18 +02:00
|
|
|
<div class="text-right grid gap-2">
|
|
|
|
{% set_global cur_user_participates = false %}
|
|
|
|
{% for rower in planned_event.rower%}
|
|
|
|
{% if rower.name == loggedin_user.name %}
|
|
|
|
{% set_global cur_user_participates = true %}
|
2023-04-06 19:53:22 +02:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2023-04-07 08:57:18 +02:00
|
|
|
{% if cur_user_participates %}
|
2023-04-07 09:44:08 +02:00
|
|
|
<a href="/remove/{{ planned_event.trip_details_id }}" class="btn btn-attention btn-fw">Abmelden</a>
|
2023-04-07 08:57:18 +02:00
|
|
|
{% endif %}
|
|
|
|
{% if planned_event.max_people > planned_event.rower | length %}
|
|
|
|
{% if cur_user_participates == false %}
|
2023-04-07 09:44:08 +02:00
|
|
|
<a href="/join/{{ planned_event.trip_details_id }}" class="btn btn-primary btn-fw">Mitrudern</a>
|
2023-04-06 17:54:08 +02:00
|
|
|
{% endif %}
|
2023-04-07 08:57:18 +02:00
|
|
|
{% 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 %}
|
2023-04-07 09:44:08 +02:00
|
|
|
<a href="/cox/remove/{{ planned_event.id }}" class="block btn btn-attention btn-fw">
|
|
|
|
{% include "includes/cox-icon" %}
|
2023-04-07 08:57:18 +02:00
|
|
|
Abmelden
|
|
|
|
</a>
|
|
|
|
{% else %}
|
2023-04-07 09:44:08 +02:00
|
|
|
<a href="/cox/join/{{ planned_event.id }}" class="block btn btn-dark btn-fw">
|
|
|
|
{% include "includes/cox-icon" %}
|
2023-04-07 08:57:18 +02:00
|
|
|
Steuern
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2023-04-06 17:54:08 +02:00
|
|
|
|
2023-04-07 08:57:18 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="sidebar slide-in from-right" id="detailEvent{{ planned_event.id }}" aria-modal="false">
|
|
|
|
<div class="bg-primary-900 text-white px-2 py-3 flex justify-between sidebar-header">
|
|
|
|
<div class="ps-1">
|
|
|
|
<strong>{{ planned_event.planned_starting_time }} Uhr</strong> ({{ planned_event.name }})
|
|
|
|
{% if planned_event.notes %}
|
|
|
|
<small class="block">{{ planned_event.notes }}</small>
|
2023-04-06 17:54:08 +02:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
2023-04-07 08:57:18 +02:00
|
|
|
<div>
|
|
|
|
<button type="button" title="Details schließen" class="sidebar-close border-0 bg-primary-600 text-black"
|
|
|
|
data-trigger="detailEvent{{ planned_event.id }}">
|
|
|
|
x
|
|
|
|
</button>
|
|
|
|
</div>
|
2023-04-06 17:54:08 +02:00
|
|
|
</div>
|
2023-04-07 08:57:18 +02:00
|
|
|
<div class="px-2 pt-2" style="margin-top: 63px; margin-bottom: 157px">
|
2023-04-07 10:39:15 +02:00
|
|
|
{# --- START List Coxes --- #}
|
2023-04-07 08:57:18 +02:00
|
|
|
{% if planned_event.planned_amount_cox > 0 %}
|
2023-04-07 10:39:15 +02:00
|
|
|
{% set amount_cur_cox = planned_event.cox | length %}
|
|
|
|
{{ macros::box(participants=planned_event.cox, empty_seats=planned_event.planned_amount_cox - amount_cur_cox, header='Steuerleute werden benötigt', text='Keine Steuerleute angemeldet') }}
|
2023-04-07 08:57:18 +02:00
|
|
|
{% endif %}
|
2023-04-07 10:39:15 +02:00
|
|
|
{# --- END List Coxes --- #}
|
|
|
|
|
|
|
|
{# --- START List Rowers --- #}
|
2023-04-07 08:57:18 +02:00
|
|
|
{% if planned_event.max_people > 0 %}
|
2023-04-07 10:39:15 +02:00
|
|
|
{% set amount_cur_rower = planned_event.rower | length %}
|
|
|
|
{{ macros::box(participants=planned_event.rower, empty_seats=planned_event.max_people - amount_cur_rower, bg='primary-100', color='black') }}
|
2023-04-07 08:57:18 +02:00
|
|
|
{% endif %}
|
2023-04-07 10:39:15 +02:00
|
|
|
{# --- END List Rowers --- #}
|
|
|
|
|
2023-04-07 08:57:18 +02:00
|
|
|
{% if planned_event.allow_guests %}
|
2023-04-07 10:39:15 +02:00
|
|
|
<div class="text-primary-900 bg-primary-50 text-center p-1 mb-4">Gäste sind erlaubt</div>
|
2023-04-07 08:57:18 +02:00
|
|
|
{% endif %}
|
|
|
|
|
2023-04-07 10:39:15 +02:00
|
|
|
{# --- START Delete Btn --- #}
|
2023-04-07 08:57:18 +02:00
|
|
|
{% if loggedin_user.is_admin %}
|
2023-04-07 10:39:15 +02:00
|
|
|
<div class="text-right">
|
|
|
|
<a href="/admin/planned-event/{{ planned_event.id }}/delete" class="inline-block btn btn-alert">
|
|
|
|
{% include "includes/delete-icon" %}
|
|
|
|
Termin löschen
|
|
|
|
</a>
|
|
|
|
</div>
|
2023-04-07 08:57:18 +02:00
|
|
|
{% endif %}
|
2023-04-07 10:39:15 +02:00
|
|
|
{# --- END Delete Btn --- #}
|
2023-04-06 13:15:40 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-04-07 08:57:18 +02:00
|
|
|
<div class="sidebar-overlay" data-trigger="detailEvent{{ planned_event.id }}"></div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2023-04-06 17:54:08 +02:00
|
|
|
</div>
|
2023-04-07 08:57:18 +02:00
|
|
|
{% endif %}
|
2023-04-05 22:35:52 +02:00
|
|
|
|
2023-04-06 13:15:40 +02:00
|
|
|
|
2023-04-07 08:57:18 +02:00
|
|
|
{% if day.trips | length > 0 %}
|
|
|
|
<div class="grid grid-cols-1 gap-3 divide-y mb-3">
|
|
|
|
{% for trip in day.trips %}
|
2023-04-07 12:37:33 +02:00
|
|
|
<div class="pt-2" data-coxneeded="false">
|
2023-04-07 08:57:18 +02:00
|
|
|
<div class="flex justify-between items-center">
|
|
|
|
<div>
|
|
|
|
<strong class="text-primary-900">{{ trip.planned_starting_time }} Uhr</strong> <small
|
|
|
|
class="text-gray-600">({{ trip.cox_name }})</small><br />
|
|
|
|
<a href="#" data-sidebar="true" data-trigger="detailTrip{{ trip.trip_details_id }}"
|
2023-04-07 09:44:08 +02:00
|
|
|
class="inline-block link-primary mr-3">Details</a>
|
2023-04-07 08:57:18 +02:00
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
{% 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 %}
|
|
|
|
<a href="/remove/{{ trip.trip_details_id }}"
|
|
|
|
class="inline-block rounded-md bg-[#f43f5e] px-3 py-2 text-sm font-semibold text-white hover:bg-[#ff0000] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ff0000] cursor-pointer">Abmelden</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if trip.max_people > trip.rower | length and trip.cox_id != loggedin_user.id and cur_user_participates
|
|
|
|
== false%}
|
|
|
|
<a href="/join/{{ trip.trip_details_id }}"
|
|
|
|
class="inline-block rounded-md bg-primary-600 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer">Mitrudern</a>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="sidebar slide-in from-right" id="detailTrip{{ trip.trip_details_id }}" aria-modal="false">
|
2023-04-06 13:15:40 +02:00
|
|
|
<div class="bg-primary-900 text-white px-2 py-3 flex justify-between sidebar-header">
|
2023-04-07 08:57:18 +02:00
|
|
|
<div class="ps-1">
|
|
|
|
<strong>{{ trip.planned_starting_time }} Uhr</strong> ({{ trip.cox_name }})
|
|
|
|
{% if trip.notes %}
|
|
|
|
<small class="block">{{ trip.notes }}</small>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<button type="button" title="Details schließen" class="sidebar-close border-0 bg-primary-600 text-black"
|
|
|
|
data-trigger="detailTrip{{ trip.trip_details_id }}">
|
|
|
|
x
|
2023-04-06 13:15:40 +02:00
|
|
|
</button>
|
2023-04-07 08:57:18 +02:00
|
|
|
</div>
|
2023-04-06 13:15:40 +02:00
|
|
|
</div>
|
|
|
|
<div class="px-2 pt-2" style="margin-top: 63px; margin-bottom: 157px">
|
2023-04-07 08:57:18 +02:00
|
|
|
{% if trip.max_people > 0 %}
|
2023-04-07 21:30:55 +02:00
|
|
|
{% set amount_cur_rower = trip.rower | length %}
|
|
|
|
{{ macros::box(participants=trip.rower, empty_seats=trip.max_people - amount_cur_rower, bg='primary-100', color='black') }}
|
|
|
|
{% if trip.cox_id == loggedin_user.id %}
|
|
|
|
<div>
|
|
|
|
<h3 class="text-lg text-primary-950 font-bold uppercase tracking-wide">Edit trip</h3>
|
|
|
|
<form action="/cox/trip/{{ trip.id }}" method="post" class="grid gap-3">
|
|
|
|
{{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=trip.max_people) }}
|
|
|
|
{{ macros::input(label='Anmerkungen', name='notes', type='input', required=true, value=trip.notes) }}
|
|
|
|
<input value="Bearbeiten" class="btn btn-primary" type="submit" />
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{% if trip.rower | length == 0 %}
|
|
|
|
<div class="text-right mt-6">
|
|
|
|
<a href="/cox/remove/trip/{{ trip.id }}" class="inline-block btn btn-alert">
|
|
|
|
{% include "includes/delete-icon" %}
|
|
|
|
Termin löschen
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2023-04-07 08:57:18 +02:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="sidebar-overlay" data-trigger="detailTrip{{ trip.trip_details_id }}"></div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
{% if loggedin_user.is_admin %}
|
2023-04-07 11:35:39 +02:00
|
|
|
<a href="#" data-sidebar="true" data-trigger="addTrip"
|
|
|
|
data-header="<strong>Event</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen"
|
|
|
|
data-day="{{ day.day }}"
|
|
|
|
data-form="#addEventForm"
|
2023-04-07 09:44:08 +02:00
|
|
|
class="inline-block link-dark mr-3">Event hinzufügen</a>
|
2023-04-05 22:35:52 +02:00
|
|
|
{% endif %}
|
|
|
|
|
2023-04-06 09:30:43 +02:00
|
|
|
{% if loggedin_user.is_cox%}
|
2023-04-07 11:35:39 +02:00
|
|
|
<a href="#" data-sidebar="true" data-trigger="addTrip"
|
|
|
|
data-header="<strong>Ausfahrt</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen"
|
|
|
|
data-day="{{ day.day }}"
|
|
|
|
data-form="#addTripForm"
|
2023-04-07 09:44:08 +02:00
|
|
|
class="inline-block link-primary">Ausfahrt hinzufügen</a>
|
2023-04-06 09:30:43 +02:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
2023-04-07 08:57:18 +02:00
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2023-04-05 22:35:52 +02:00
|
|
|
</div>
|
2023-04-07 11:35:39 +02:00
|
|
|
|
|
|
|
{# --- START Add Trip Sidebar --- #}
|
|
|
|
<div class="sidebar slide-in from-right" id="addTrip" aria-modal="false">
|
|
|
|
<div class="bg-primary-900 text-white px-2 py-3 flex justify-between sidebar-header">
|
|
|
|
<div>
|
|
|
|
<span class="ps-1 header-js">
|
|
|
|
Überschrift (wird ersetzt)
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<button type="button" title="Ausfahrt erstellen schließen" class="sidebar-close border-0 bg-primary-600 text-black"
|
|
|
|
data-trigger="addTrip">
|
|
|
|
x
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class="form-js px-2 pt-2" style="margin-top: 63px; margin-bottom: 157px">
|
|
|
|
Formular wird ersetzt
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="sidebar-overlay" data-trigger="addTrip"></div>
|
|
|
|
{# --- END Add Trip Sidebar --- #}
|
|
|
|
|
|
|
|
{# --- START Form Add Trip --- #}
|
2023-04-07 11:39:23 +02:00
|
|
|
<div class="hidden">
|
|
|
|
<form action="/cox/trip" method="post" class="grid gap-3" id="addTripForm">
|
|
|
|
<input class="day-js" type="hidden" name="day" value="" />
|
|
|
|
{{ 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') }}
|
|
|
|
<input value="Erstellen" class="w-full btn btn-primary" type="submit" />
|
|
|
|
</form>
|
|
|
|
</div>
|
2023-04-07 11:35:39 +02:00
|
|
|
{# --- END Form Add Trip --- #}
|
|
|
|
|
|
|
|
{# --- START Form Add Event --- #}
|
2023-04-07 11:39:23 +02:00
|
|
|
<div class="hidden">
|
|
|
|
<form action="/admin/planned-event" method="post" class="grid gap-3" id="addEventForm">
|
|
|
|
<input class="day-js" type="hidden" name="day" value="" />
|
2023-04-07 21:30:55 +02:00
|
|
|
{{ macros::input(label='Titel (z.B. Firmenrudern)', name='name', type='input', required=true) }}
|
|
|
|
{{ macros::input(label='Startzeit', name='planned_starting_time', type='input', required=true) }}
|
2023-04-07 11:39:23 +02:00
|
|
|
{{ 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') }}
|
2023-04-07 21:30:55 +02:00
|
|
|
{{ macros::input(label='Anmerkungen', name='notes', type='input') }}
|
2023-04-07 11:39:23 +02:00
|
|
|
<input value="Erstellen" class="w-full btn btn-primary" type="submit" />
|
|
|
|
</form>
|
|
|
|
</div>
|
2023-04-07 11:35:39 +02:00
|
|
|
{# --- END Form Add Event --- #}
|
|
|
|
|
2023-04-07 11:16:39 +02:00
|
|
|
{% endblock content %}
|