Merge branch 'main' of gitlab.com:PhilippHofer/rot

This commit is contained in:
philipp 2023-04-06 08:06:58 +02:00
commit 37e54c13d5

View File

@ -2,122 +2,127 @@
{% block content %} {% block content %}
{% if loggedin_user %} <div class="max-w-screen-lg w-full grid gap-4">
Hi {{ loggedin_user.name }}. <a href="/auth/logout">LOGOUT</a> {% if loggedin_user %}
Hi {{ loggedin_user.name }}. <a href="/auth/logout">LOGOUT</a>
{% if loggedin_user.is_admin %} {% if loggedin_user.is_admin %}
<a href="/admin/user">USER</a> <a href="/admin/user">USER</a>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if flash %} {% if flash %}
{% if flash.0 == "success" %} {% if flash.0 == "success" %}
<div class="row"> <div class="row">
<div class="one-column p-1 text-white bg-green mb-3 light text-center"> <div class="one-column p-1 text-white bg-green mb-3 light text-center">
{{ flash.1 }} {{ flash.1 }}
</div>
</div> </div>
</div> {% endif %}
{% endif %} {% if flash.0 == "error" %}
{% if flash.0 == "error" %} <div class="row">
<div class="row"> <div class="one-column p-1 text-white bg-red mb-3 bold text-center">
<div class="one-column p-1 text-white bg-red mb-3 bold text-center"> {{ flash.1 }}
{{ flash.1 }} </div>
</div> </div>
</div> {% endif %}
{% endif %}
<h1 class="text-center text-3xl uppercase tracking-wide font-bold text-primary-900">Ausfahrten</h1>
{% for day in days %}
<div class="bg-white p-3 rounded-md flex items-end md:items-center justify-between">
<h2>{{ day.day }}</h2>
{% for planned_event in day.planned_events %}
<h3>Planned event '{{ planned_event.name }}'</h3>
Planned amount cox: {{ planned_event.planned_amount_cox }}<br />
Allow guests: {{ planned_event.allow_guests }}<br />
Planned starting time: {{ planned_event.planned_starting_time }}<br />
Max people: {{ planned_event.max_people }}<br />
Notes: {{ planned_event.notes }}<br />
Folgende Steuerpersonen haben sich schon angemeldet:
{% for cox in planned_event.cox %}
{{ cox }}
{% if cox == loggedin_user.name %}
<a href="/cox/remove/{{ planned_event.id }}">ABMELDEN</a>
{% endif %}
{% endfor %}
<br />
Folgende Ruderer haben sich schon angemeldet:
{% for rower in planned_event.rower%}
{{ rower.name }} (angemeldet seit {{ rower.registered_at }})
{% if rower.name == loggedin_user.name %}
<a href="/remove/{{ planned_event.trip_details_id }}">ABMELDEN</a>
{% endif %}
{% endfor %}
{% if planned_event.max_people > planned_event.rower | length %}
<a href="/join/{{ planned_event.trip_details_id }}">MITRUDERN</a>
{% endif %} {% endif %}
{% endif %}
<h1>Ausfahrten</h1>
{% for day in days %}
<h2>{{ day.day }}</h2>
{% for planned_event in day.planned_events %}
<h3>Planned event '{{ planned_event.name }}'</h3>
Planned amount cox: {{ planned_event.planned_amount_cox }}<br />
Allow guests: {{ planned_event.allow_guests }}<br />
Planned starting time: {{ planned_event.planned_starting_time }}<br />
Max people: {{ planned_event.max_people }}<br />
Notes: {{ planned_event.notes }}<br />
Folgende Steuerpersonen haben sich schon angemeldet:
{% for cox in planned_event.cox %}
{{ cox }}
{% if cox == loggedin_user.name %}
<a href="/cox/remove/{{ planned_event.id }}">ABMELDEN</a>
{% endif %}
{% endfor %}
<br />
Folgende Ruderer haben sich schon angemeldet:
{% for rower in planned_event.rower%}
{{ rower.name }} (angemeldet seit {{ rower.registered_at }})
{% if rower.name == loggedin_user.name %}
<a href="/remove/{{ planned_event.trip_details_id }}">ABMELDEN</a>
{% endif %}
{% endfor %}
{% if planned_event.max_people > planned_event.rower | length %}
<a href="/join/{{ planned_event.trip_details_id }}">MITRUDERN</a>
{% endif %}
{% if loggedin_user.is_cox %} {% if loggedin_user.is_cox %}
<a href="/cox/join/{{ planned_event.id }}">STEUERN</a> <a href="/cox/join/{{ planned_event.id }}">STEUERN</a>
{% endif %} {% endif %}
{% if loggedin_user.is_admin %} {% if loggedin_user.is_admin %}
<a href="/admin/planned-event/{{ planned_event.id }}/delete">DELETE</a> <a href="/admin/planned-event/{{ planned_event.id }}/delete">DELETE</a>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% for trip in day.trips %} {% for trip in day.trips %}
<h3>Ausfahrt von {{ trip.cox_name }}</h3> <h3>Ausfahrt von {{ trip.cox_name }}</h3>
Planned starting time: {{ trip.planned_starting_time }}<br /> Planned starting time: {{ trip.planned_starting_time }}<br />
Max people: {{ trip.max_people }}<br /> Max people: {{ trip.max_people }}<br />
Notes: {{ trip.notes }}<br /> Notes: {{ trip.notes }}<br />
Folgende Ruderer haben sich schon angemeldet: Folgende Ruderer haben sich schon angemeldet:
{% for rower in trip.rower %} {% for rower in trip.rower %}
{{ rower.name }} (angemeldet seit {{ rower.registered_at }}) {{ rower.name }} (angemeldet seit {{ rower.registered_at }})
{% if rower.name == loggedin_user.name %} {% if rower.name == loggedin_user.name %}
<a href="/remove/{{ trip.trip_details_id }}">ABMELDEN</a> <a href="/remove/{{ trip.trip_details_id }}">ABMELDEN</a>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if trip.max_people > trip.rower | length and trip.cox_id != loggedin_user.id %} {% if trip.max_people > trip.rower | length and trip.cox_id != loggedin_user.id %}
<a href="/join/{{ trip.trip_details_id }}">MITRUDERN</a> <a href="/join/{{ trip.trip_details_id }}">MITRUDERN</a>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if loggedin_user.is_admin %} {% if loggedin_user.is_admin %}
<h3>Add planned event</h3> <h3>Add planned event</h3>
<form action="/admin/planned-event" method="post"> <form action="/admin/planned-event" method="post">
<input type="hidden" name="day" value="{{ day.day }}" /> <input type="hidden" name="day" value="{{ day.day }}" />
<input type="text" name="name" placeholder="name (e.g. USI)" /> <input type="text" name="name" placeholder="name (e.g. USI)" />
<input type="number" name="planned_amount_cox" placeholder="Anzahl Steuerleute" /> <input type="number" name="planned_amount_cox" placeholder="Anzahl Steuerleute" />
Gäste <input type="checkbox" name="allow_guests" /> Gäste <input type="checkbox" name="allow_guests" />
<input type="text" name="planned_starting_time" placeholder="Startzeit" /> <input type="text" name="planned_starting_time" placeholder="Startzeit" />
<input type="number" name="max_people" placeholder="Anzahl Ruderer" /> <input type="number" name="max_people" placeholder="Anzahl Ruderer" />
<input type="text" name="notes" placeholder="Anmerkungen" /> <input type="text" name="notes" placeholder="Anmerkungen" />
<input type="submit" /> <input type="submit" />
</form> </form>
{% endif %} {% endif %}
{% if loggedin_user.is_cox%} {% if loggedin_user.is_cox%}
<h3>Add trip</h3> <h3>Add trip</h3>
<form action="/cox/trip" method="post"> <form action="/cox/trip" method="post">
<input type="hidden" name="day" value="{{ day.day }}" /> <input type="hidden" name="day" value="{{ day.day }}" />
<input type="text" name="planned_starting_time" placeholder="Startzeit" /> <input type="text" name="planned_starting_time" placeholder="Startzeit" />
<input type="number" name="max_people" placeholder="Anzahl Ruderer" /> <input type="number" name="max_people" placeholder="Anzahl Ruderer" />
<input type="text" name="notes" placeholder="Anmerkungen" /> <input type="text" name="notes" placeholder="Anmerkungen" />
<input type="submit" /> <input type="submit" />
</form> </form>
{% endif %} {% endif %}
<hr/> </div>
{% endfor %} {% endfor %}
</div>
</div>
{% endblock content %} {% endblock content %}