dont show cancel text for passed shifts, put shift in container
This commit is contained in:
parent
472bd6f629
commit
c8a4575c1b
|
@ -20,6 +20,8 @@ class Shift(models.Model):
|
|||
# todo: add helper amount override field
|
||||
def __str__(self):
|
||||
return f"{self.room.name}: {self.start_at}"
|
||||
def has_ended(self):
|
||||
return (self.start_at + self.duration) < timezone.now()
|
||||
|
||||
|
||||
class Helper(models.Model):
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
{% block title %}Schichtansicht{% endblock %}
|
||||
{% block content %}
|
||||
<div class="box">
|
||||
{% if is_registered %}
|
||||
<div>Du bist zu dieser Schicht angemeldet</div>
|
||||
{% endif %}
|
||||
|
@ -22,8 +23,9 @@ Dauer: {{ shift.duration }}<br>
|
|||
{{ shift_form.as_p }}
|
||||
<input type="submit" value="Abmelden">
|
||||
</form>
|
||||
{% else %}
|
||||
{% elif not shift.has_ended %}
|
||||
Bitte wende dich an den Infopoint, falls du es nicht zu deiner Schicht schaffst.
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue