forked from Ruderverein-Donau-Linz/rowt
rebase
This commit is contained in:
@ -35,8 +35,8 @@
|
||||
<div class="bg-gray p-1 mb-3">
|
||||
<div class="container content-center-end">
|
||||
{% if user.is_admin %}
|
||||
<a class="button button-primary mb-0 font-base light" href="/">🚣</a>
|
||||
<a class="button button-primary mb-0 font-base light" href="/user">👥</a>
|
||||
<a class="button mb-0 mr-2" href="/">🚣</a>
|
||||
<a class="button mb-0 mr-2" href="/user">👥</a>
|
||||
{% endif %}
|
||||
<a class="button button-primary mb-0 font-base light" href="/logout">LOGOUT</a>
|
||||
</div>
|
||||
@ -56,7 +56,7 @@
|
||||
{% endif %}
|
||||
{% if flash.0 == "error" %}
|
||||
<div class="row">
|
||||
<div class="one-column p-1 text-white bg-red mb-3 light text-center">
|
||||
<div class="one-column p-1 text-white bg-red mb-3 bold text-center">
|
||||
{{ flash.1 }}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -6,7 +6,12 @@
|
||||
{% set day = day_with_trip.day %}
|
||||
{% set day_string = day.day | date(format="%Y-%m-%d") %}
|
||||
{% set trips = day_with_trip.trips %}
|
||||
<div class="bg-gray p-3 mb-1">
|
||||
|
||||
{% set cox = trips | filter(attribute="user.is_cox", value=true) %}
|
||||
{% set amount_cox = cox | length %}
|
||||
{% set cox_needed = amount_cox < day.planned_amount_cox %}
|
||||
|
||||
<div class="bg-gray p-3 mb-1 data-block" data-needed="{{ cox_needed}}">
|
||||
<strong class="block">{{ day.day | date(format="%d.%m.%Y")}}</strong>
|
||||
|
||||
{% if day.planned_amount_cox > 0%}
|
||||
@ -64,19 +69,19 @@
|
||||
(Noch) keine Ausfahrt geplant
|
||||
{% endif %}
|
||||
|
||||
{% if user.is_admin %}
|
||||
<details>
|
||||
{% if user.is_admin %}
|
||||
<details class="text-right" style="margin-top: -3rem;">
|
||||
<summary class="button">✎</summary>
|
||||
<form method="post" action="/day">
|
||||
<form method="post" class="text-left" action="/day">
|
||||
<input type="hidden" name="_method" value="put" />
|
||||
<input type="hidden" name="day" value="{{ day_string }}" />
|
||||
<div class="row">
|
||||
<div class="row content-align-bottom">
|
||||
<div class="three columns">
|
||||
<label for="planned_amount_cox">Geplante Steuerpersonen</label>
|
||||
<label for="planned_amount_cox">Steuerpersonen</label>
|
||||
<input class="u-full-width" type="number" id="planned_amount_cox" name="planned_amount_cox" value="{{ day.planned_amount_cox }}">
|
||||
</div>
|
||||
<div class="three columns">
|
||||
<label for="planned_starting_time">Geplante Abfahrtszeit</label>
|
||||
<label for="planned_starting_time">Abfahrtszeit</label>
|
||||
<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%}">
|
||||
</div>
|
||||
<div class="three columns">
|
||||
@ -91,12 +96,64 @@
|
||||
</form>
|
||||
</details>
|
||||
{% endif %}
|
||||
|
||||
{% if day.planned_amount_cox > 0%}
|
||||
{% set rowers = trips | filter(attribute="user.is_cox", value=false) %}
|
||||
{% if cox_needed %}
|
||||
{% set cox_left = day.planned_amount_cox - amount_cox %}
|
||||
<div class="block text-red">Es {{ cox_left | pluralize(singular="wird", plural="werden")}} noch {{ cox_left }} Steuerperson{{ cox_left | pluralize(plural="en")}} gesucht!</div>
|
||||
{% endif %}
|
||||
<strong class="block mt-1">Abfahrtszeit: {{ day.planned_starting_time }} Uhr</strong>
|
||||
|
||||
<div style="max-width: 75%">{{ 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:</div>
|
||||
|
||||
<ol style="max-width: 75%">
|
||||
{% for r in rowers %}
|
||||
<li>
|
||||
{{ r.user.name }} (angemeldet seit {{ r.trip.created }})
|
||||
{% if r.user.name == user.name %}
|
||||
<form method="post" action="/register">
|
||||
<input type="hidden" name="_method" value="delete" />
|
||||
<input type="hidden" name="day" value="{{ day.day}}" />
|
||||
<input type="hidden" name="user" value="{{ r.user.id}}" />
|
||||
|
||||
<input type="submit" value="LÖSCHEN" />
|
||||
|
||||
</form>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
|
||||
{% if day.open_registration or user.is_cox %}
|
||||
<details class="text-right" style="margin-top: -6rem;">
|
||||
<summary class="button">+</summary>
|
||||
<form method="post" class="text-left" action="/register">
|
||||
<input type="hidden" name="_method" value="put" />
|
||||
<input type="hidden" name="day" value="{{ day_string }}" />
|
||||
<div class="row content-align-bottom">
|
||||
<div class="six columns">
|
||||
<label for="name">Name</label>
|
||||
<input class="u-full-width" type="text" id="name" name="name" value="{{ user.name }}" />
|
||||
</div>
|
||||
<div class="six columns">
|
||||
<input class="button-primary" type="submit" value="Speichern">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</details>
|
||||
{% else %}
|
||||
Anmeldung an diesem Tag leider nicht möglich (zB bei USI Kursen)
|
||||
{% endif %}
|
||||
{% else %}
|
||||
(Noch) keine Ausfahrt geplant
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
{% if user.is_cox %}
|
||||
<a class="button" href="/?all">Alle heurigen Ausfahrten anzeigen</a>
|
||||
<a class="button button-primary light font-base mb-3" href="/?all">Alle heurigen Ausfahrten anzeigen</a>
|
||||
{% endif %}
|
||||
|
||||
{% endblock content %}
|
||||
|
Reference in New Issue
Block a user