rowt/templates/index.html.tera

92 lines
3.3 KiB
Plaintext
Raw Normal View History

2023-02-08 16:25:06 +01:00
{% extends "base" %}
{% block content %}
2023-02-09 15:29:44 +01:00
{% for day_with_trip in data %}
{% set day = day_with_trip.day %}
{% set day_string = day.day | date(format="%Y-%m-%d") %}
{% set trips = day_with_trip.trips %}
2023-02-09 17:08:07 +01:00
<h1>{{ day.day | date(format="%d.%m.%Y")}}</h1>
2023-02-08 16:25:06 +01:00
<br />
2023-02-09 15:29:44 +01:00
{% if day.planned_amount_cox > 0%}
2023-02-09 17:08:07 +01:00
{% set cox = trips | filter(attribute="user.is_cox", value=true) %}
{% set amount_cox = cox | length %}
{% set rowers = trips | filter(attribute="user.is_cox", value=false) %}
{% if amount_cox < day.planned_amount_cox %}
{% set cox_left = day.planned_amount_cox - amount_cox %}
Es {{ cox_left | pluralize(singular="wird", plural="werden")}} noch {{ cox_left }} Steuerperson{{ cox_left | pluralize(plural="en")}} gesucht!<br />
{% endif %}
2023-02-09 15:29:44 +01:00
Geplante Abfahrtszeit: {{ day.planned_starting_time }}<br />
2023-02-09 12:16:04 +01:00
2023-02-09 17:08:07 +01:00
{{ trips | length }} angemeldete Person{{ trips | length | pluralize(plural="en") }}: {{ cox | length }} Steuerperson{{ cox | length | pluralize(plural="en") }} ({% for c in cox %}{{ c.user.name }} {% endfor %}), {{ rowers | length }} Ruderer:
2023-02-09 12:16:04 +01:00
<ol>
2023-02-09 17:08:07 +01:00
{% for r in rowers %}
<li>{{ r.user.name }} (angemeldet seit {{ r.trip.created }})</li>
2023-02-09 12:16:04 +01:00
{% endfor %}
</ol>
2023-02-09 17:08:07 +01:00
{% if day.open_registration or user.is_cox %}
2023-02-09 12:16:04 +01:00
<details>
<summary class="button">&plus;</summary>
<form method="post" action="/register">
<input type="hidden" name="_method" value="put" />
<input type="hidden" name="day" value="{{ day_string }}" />
<div class="row">
<div class="six columns">
<label for="name">Name</label>
2023-02-09 15:29:44 +01:00
<input class="u-full-width" type="text" id="name" name="name" value="{{ user.name }}" />
2023-02-09 12:16:04 +01:00
</div>
<div class="six columns">
<input class="button-primary" type="submit" value="Speichern">
</div>
</div>
</form>
</details>
2023-02-08 16:25:06 +01:00
{% else %}
Anmeldung an diesem Tag leider nicht möglich (zB bei USI Kursen)
{% endif %}
{% else %}
(Noch) keine Ausfahrt geplant
2023-02-08 22:02:17 +01:00
{% endif %}
2023-02-09 17:08:07 +01:00
{% if user.is_admin %}
2023-02-08 16:25:06 +01:00
<details>
2023-02-08 22:02:17 +01:00
<summary class="button">&#x270e;</summary>
2023-02-08 16:25:06 +01:00
<form method="post" action="/day">
<input type="hidden" name="_method" value="put" />
2023-02-08 22:02:17 +01:00
<input type="hidden" name="day" value="{{ day_string }}" />
2023-02-08 16:25:06 +01:00
<div class="row">
<div class="three columns">
<label for="planned_amount_cox">Geplante Steuerpersonen</label>
2023-02-09 15:29:44 +01:00
<input class="u-full-width" type="number" id="planned_amount_cox" name="planned_amount_cox" value="{{ day.planned_amount_cox }}">
2023-02-08 16:25:06 +01:00
</div>
<div class="three columns">
<label for="planned_starting_time">Geplante Abfahrtszeit</label>
2023-02-09 15:29:44 +01:00
<input class="u-full-width" type="time" id="planned_starting_time" name="planned_starting_time" value="{% if day.planned_starting_time %}{{ day.planned_starting_time }}{% else %}17:00{%endif%}">
2023-02-08 16:25:06 +01:00
</div>
<div class="three columns">
<label for="open_registration">Registrierung offen</label>
2023-02-09 15:29:44 +01:00
<input class="u-full-width" type="checkbox" id="open_registration" name="open_registration" {% if not day or day.open_registration %} checked="true" {% endif %}/>
2023-02-08 16:25:06 +01:00
</div>
<div class="three columns">
2023-02-08 22:02:17 +01:00
<input class="button-primary" type="submit" value="Speichern">
2023-02-08 16:25:06 +01:00
</div>
</div>
</form>
</details>
2023-02-09 17:08:07 +01:00
{% endif %}
2023-02-08 16:25:06 +01:00
<hr />
{% endfor %}
2023-02-16 11:26:41 +01:00
{% if user.is_cox %}
<a class="button" href="/?all">Alle heurigen Ausfahrten anzeigen</a>
{% endif %}
2023-02-08 16:25:06 +01:00
{% endblock content %}