Add booking deletion, crew views, anonymous walk-in, and account claim
- Users can delete their own bookings (confirmation page) - Crew page tree (/suff/staff/): book/pay/delete for any user, register new users, set/reset PINs - Anonymous walk-in user "anonym": bookings auto-create matching cash payment so balance stays at 0 - Self-signup: unknown name creates account (PIN required); known name without PIN and no activity allows claim (PIN required); known name without PIN but with activity blocks and points to bar crew - Crew-only PIN set/reset; no random PINs, PINs never displayed - Cyan .staff-target highlight on all crew pages - Updated suff.md with current feature state and open ideas Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
{% extends "suff/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<p class="muted">Crew-Ansicht</p>
|
||||
<h2>Buchen für <span class="staff-target">{{ tab_user.username }}</span>{% if is_anonymous_target %} (Bar / Anonym){% endif %}</h2>
|
||||
|
||||
{% if booked_drink %}
|
||||
<div class="toast" role="status">
|
||||
Gebucht: +1 {{ booked_drink.name }}{% if is_anonymous_target %} (bar bezahlt){% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if paid_toast %}
|
||||
<div class="toast" role="status">
|
||||
Zahlung gespeichert.
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if is_anonymous_target %}
|
||||
<p class="muted">Anonyme Buchungen werden automatisch als bar bezahlt eingetragen.</p>
|
||||
{% else %}
|
||||
<section class="total-box">
|
||||
<span class="total-label">Rechnung</span>
|
||||
<span class="total-value">{{ total|floatformat:2 }} €</span>
|
||||
{% if paid %}
|
||||
<span class="total-label">Bezahlt</span>
|
||||
<span class="total-value">{{ paid|floatformat:2 }} €</span>
|
||||
<span class="total-label">Offen</span>
|
||||
<span class="total-value">{{ open_balance|floatformat:2 }} €</span>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
{% if open_balance > 0 %}
|
||||
<p><a href="{% url 'suff:staff_pay' tab_user.username %}" class="btn-primary">Zahlung eintragen</a></p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if phase == "booking" %}
|
||||
<section>
|
||||
<h3>Getränk buchen</h3>
|
||||
<div class="drink-grid">
|
||||
{% for drink in drinks %}
|
||||
<form method="post" action="{% url 'suff:staff_book' tab_user.username %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="drink_id" value="{{ drink.id }}" />
|
||||
<button type="submit" class="drink-btn drink-btn-{{ drink.category }}">
|
||||
<span class="drink-plus">+1</span>
|
||||
<span class="drink-name">{{ drink.name }}</span>
|
||||
<span class="drink-price">{{ drink.sale_price_per_bottle|floatformat:2 }} €</span>
|
||||
</button>
|
||||
</form>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
<section>
|
||||
<h3>Bisher gebucht</h3>
|
||||
{% if consumption_list %}
|
||||
{% regroup consumption_list by get_day_display as day_groups %}
|
||||
{% for group in day_groups %}
|
||||
<div class="day-group">
|
||||
<h4 class="day-heading">{{ group.grouper }}</h4>
|
||||
<ul class="history">
|
||||
{% for c in group.list %}
|
||||
<li>
|
||||
<span class="hist-when">{% if c.created_at %}{{ c.created_at|date:"H:i" }}{% else %}—{% endif %}</span>
|
||||
<span class="hist-what">{{ c.drink.name }}</span>
|
||||
<span class="hist-price">
|
||||
{% if c.for_free %}gratis{% else %}{{ c.drink.sale_price_per_bottle|floatformat:2 }} €{% endif %}
|
||||
</span>
|
||||
{% if phase == "booking" %}
|
||||
<a href="{% url 'suff:staff_delete_consumption' tab_user.username c.id %}" class="hist-delete" aria-label="Buchung löschen">🗑</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<p class="empty-emoji">🍺</p>
|
||||
<p>Noch nichts gebucht.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
<div class="link-row">
|
||||
{% if not is_anonymous_target %}
|
||||
<a href="{% url 'suff:staff_pin_reset' tab_user.username %}" class="link-btn link-btn-secondary">PIN setzen / zurücksetzen</a>
|
||||
{% endif %}
|
||||
<a href="{% url 'suff:staff_index' %}" class="link-btn link-btn-secondary">Anderen Benutzer wählen</a>
|
||||
<a href="{% url 'suff:me' %}" class="link-btn link-btn-secondary">Zurück zu mir</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user