CP_EHRENAMT/app/templates/meine_termine.html
2026-06-25 18:58:44 +02:00

71 lines
2.7 KiB
HTML

{% extends shell_base %}
{% from "_zeit.html" import zeitspanne %}
{% block title %}Meine Termine · CheckPoint Ehrenamt{% endblock %}
{% block content %}
<h1>Meine Termine</h1>
{% if offene_planung %}
<div class="cp-actions">
<a class="cp-btn cp-btn--ghost" href="{{ url_for('planung.verfuegbarkeit') }}">Verfügbarkeit melden</a>
</div>
{% endif %}
<ul class="cp-list">
{% for z, e in termine %}
<li class="cp-card">
<strong>{{ e.art }}{% if e.ort %} · {{ e.ort }}{% endif %}</strong>
<div class="cp-muted">
{{ e.datum.strftime('%a, %d.%m.%Y') }} ·
{{ zeitspanne(e) }}
</div>
<div>
<span class="cp-tag">{{ "Haupt" if z.platztyp == "haupt" else "Springer" }}</span>
<span class="cp-tag">{{ "Übernommen" if z.status == "uebernommen" else "Zugeteilt" }}</span>
</div>
<div class="cp-actions">
<form method="post" action="{{ url_for('dienste.absagen', zuteilung_id=z.id) }}"
onsubmit="return confirm('Diesen Dienst absagen?');">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="cp-btn cp-btn--urgent">Absagen</button>
</form>
</div>
</li>
{% else %}
<li class="cp-muted">Du hast aktuell keine zugeteilten Termine. Sobald ein
Dienstplan veröffentlicht ist, erscheinen deine Einsätze hier.</li>
{% endfor %}
</ul>
{% if offene %}
<h2>Offene Dienste</h2>
<p class="cp-muted">Hier ist jemand abgesprungen. Wer zuerst übernimmt, bekommt
den Platz.</p>
<ul class="cp-list">
{% for z, e in offene %}
<li class="cp-card">
<strong>{{ e.art }}{% if e.ort %} · {{ e.ort }}{% endif %}</strong>
<div class="cp-muted">
{{ e.datum.strftime('%a, %d.%m.%Y') }} ·
{{ zeitspanne(e) }}
</div>
<div>
<span class="cp-tag cp-tag--urgent">Offen</span>
<span class="cp-tag">{{ "Haupt" if z.platztyp == "haupt" else "Springer" }}</span>
</div>
{% if e.id in eigene_einsatz_ids %}
<div class="cp-muted">Du bist diesem Einsatz bereits zugeteilt.</div>
{% else %}
<div class="cp-actions">
<form method="post" action="{{ url_for('dienste.uebernehmen', zuteilung_id=z.id) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="cp-btn cp-btn--primary">Übernehmen</button>
</form>
</div>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}