forked from Ruderverein-Donau-Linz/rowt
push
This commit is contained in:
@ -37,6 +37,12 @@
|
||||
<!-- Primary Page Layout
|
||||
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
|
||||
<div class="container">
|
||||
{% if user %}
|
||||
{% if user.is_admin %}
|
||||
<a href="/user">USER</a>
|
||||
{% endif %}
|
||||
<a href="/logout">LOGOUT</a>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
{% block content %}
|
||||
|
@ -5,22 +5,30 @@
|
||||
{% set day = day_with_trip.day %}
|
||||
{% set day_string = day.day | date(format="%Y-%m-%d") %}
|
||||
{% set trips = day_with_trip.trips %}
|
||||
{{ day.day | date(format="%d.%m.%Y")}}
|
||||
<h1>{{ day.day | date(format="%d.%m.%Y")}}</h1>
|
||||
<br />
|
||||
|
||||
|
||||
{% if day.planned_amount_cox > 0%}
|
||||
Geplante Steuerpersonen: {{ day.planned_amount_cox}}<br />
|
||||
|
||||
{% 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 %}
|
||||
Geplante Abfahrtszeit: {{ day.planned_starting_time }}<br />
|
||||
|
||||
Angemeldete Personen:
|
||||
{{ 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:
|
||||
|
||||
<ol>
|
||||
{% for trip in trips %}
|
||||
<li>{{ trip.user.name }}</li>
|
||||
{% for r in rowers %}
|
||||
<li>{{ r.user.name }} (angemeldet seit {{ r.trip.created }})</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
|
||||
{% if day.open_registration %}
|
||||
{% if day.open_registration or user.is_cox %}
|
||||
<details>
|
||||
<summary class="button">+</summary>
|
||||
<form method="post" action="/register">
|
||||
@ -43,7 +51,8 @@
|
||||
{% else %}
|
||||
(Noch) keine Ausfahrt geplant
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if user.is_admin %}
|
||||
<details>
|
||||
<summary class="button">✎</summary>
|
||||
<form method="post" action="/day">
|
||||
@ -69,7 +78,7 @@
|
||||
</div>
|
||||
</form>
|
||||
</details>
|
||||
|
||||
{% endif %}
|
||||
<hr />
|
||||
{% endfor %}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
{% extends "base" %}
|
||||
{% block content %}
|
||||
|
||||
What's your name?
|
||||
<form action="/name" method="post">
|
||||
<input type="hidden" name="_method" value="put" />
|
||||
<input type="text" name="name"/>
|
||||
<input type="submit" value="Speichern"/>
|
||||
<label for="name">Bitte deinen Namen eingeben</label>
|
||||
<input type="text" id="name" name="name"/>
|
||||
<input type="submit" value="Weiter"/>
|
||||
</form>
|
||||
{% endblock content %}
|
||||
|
||||
|
35
templates/user/index.html.tera
Normal file
35
templates/user/index.html.tera
Normal file
@ -0,0 +1,35 @@
|
||||
{% extends "base" %}
|
||||
{% block content %}
|
||||
|
||||
<table class="u-full-width">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Cox</th>
|
||||
<th>Admin</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user in users %}
|
||||
<tr>
|
||||
<form action="/user/{{ user.id }}" method="post">
|
||||
<input type="hidden" name="_method" value="put" />
|
||||
<td>{{user.name}}</td>
|
||||
<td>
|
||||
<input type="checkbox" name="is_cox" {% if user.is_cox %} checked="true"{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="is_admin" {% if user.is_admin %} checked="true"{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<input class="button-primary" type="submit" value="Speichern">
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% endblock content %}
|
||||
|
Reference in New Issue
Block a user