Hide buttons if shift is deleted

pull/1/head
Luca 3 years ago
parent 61b28da346
commit c6dd5b5eca

@ -58,7 +58,7 @@ class Helper(models.Model):
output_field=models.DateTimeField(),
)
)
.filter(helper=self, shift_end__gte=timezone.now())
.filter(helper=self, shift_end__gte=timezone.now(), shift__deleted=False)
.order_by("shift__start_at")
.first()
)

@ -9,20 +9,23 @@
{% endif %}
{% if shift.deleted %}
<div class="notification">Diese Schicht wurde gelöscht.</div>
{% endif %}
{% if not can_register and not is_registered %}
<div class="notification">Diese Schicht ist bereits besetzt.</div>
{% endif %}
<div class="content">
<strong>Ort:</strong> {{ shift.room.name }}<br>
<strong>Beginn:</strong> {{ shift.start_at }}<br>
<strong>Dauer:</strong> {{ shift.duration }}
</div>
{% if can_register %}
{% if can_register and not shift.deleted %}
<form action="" method="post">
{% csrf_token %}
{{ shift_form.as_p }}
<input type="submit" class="button is-link" value="Anmelden">
</form>
{% endif %}
{% if is_registered %}
{% if is_registered and not shift.deleted %}
{% if can_cancel %}
<form action="{% url 'cancel' shift.pk %}" method="post">
{% csrf_token %}

Loading…
Cancel
Save