2
0
Fork 0

eye candy

This commit is contained in:
Andreas (@xAndy) Zimmermann 2022-04-21 00:21:06 +02:00
parent d1bdd2bc74
commit b6aa6f4e85
5 changed files with 23 additions and 11 deletions

View File

@ -16,7 +16,7 @@
<p class="navbar-item has-text-danger">Bestätige deine Telefonnummer über den Link in der SMS</p>
{% endif %}
{% if helper.important_shift %}
<a class="navbar-item" href="{% url 'shift' helper.important_shift.pk %}">{%if helper.important_shift.is_running%}Laufende{% else %}Nächste{% endif %} Schicht</a>
<a class="navbar-item" href="{% url 'shift' helper.important_shift.pk %}">{%if helper.important_shift.is_running%}Laufende{% else %}Nächste{% endif %} Schicht({{ helper.important_shift.start_at|date:"H:m" }})</a>
{% endif %}
</div>
{% endif %}

View File

@ -0,0 +1,7 @@
<li class="box">{{ shift.room.name }} {{ shift.start_at }}
{% if registered %}
<a class="button is-info is-small" href="{% url 'shift' shift.id %}">Details</a>
{% else %}
<a class="button is-primary is-small" href="{% url 'shift' shift.id %}">Mithelfen</a>
{% endif %}
</li>

View File

@ -13,7 +13,7 @@ Dauer: {{ shift.duration }}<br>
<form action="" method="post">
{% csrf_token %}
{{ shift_form.as_p }}
<input type="submit" value="Anmelden">
<input type="submit" class="button is-link" value="Anmelden">
</form>
{% endif %}
{% if is_registered %}
@ -21,7 +21,7 @@ Dauer: {{ shift.duration }}<br>
<form action="{% url 'cancel' shift.pk %}" method="post">
{% csrf_token %}
{{ shift_form.as_p }}
<input type="submit" value="Abmelden">
<input type="submit" class="button is-danger is-small" value="Abmelden">
</form>
{% elif not shift.has_ended %}
Bitte wende dich an den Infopoint, falls du es nicht zu deiner Schicht schaffst.

View File

@ -7,17 +7,22 @@
{{ current_shift.room.name }} {{ current_shift.start_at }}<a href="{% url 'shift' current_shift.id %}">Details</a>
{% endif %}
{% if my_shifts %}
<h2>Meine Schichten</h2>
<h3 class="title is-3">Meine Schichten:</h3>
<ul>
{% for reg in my_shifts %}
<li>{{ reg.shift.room.name }} {{ reg.shift.start_at }}<a href="{% url 'shift' reg.shift.id %}">Details</a></li>
{% for shift in my_shifts %}
{% include "partials/shift_listitem.html" with registered=True%}
{% endfor %}
</ul>
{% endif %}
<h2>Freie Schichten:</h2>
<hr/>
{% if free_shifts %}
<h3 class="title is-3">Freie Schichten:</h3>
<ul>
{% for shift in free_shifts %}
<li>{{ shift.room.name }} {{ shift.start_at }}<a href="{% url 'shift' shift.id %}">Mithelfen</a></li>
{% include "partials/shift_listitem.html"%}
{% endfor %}
</ul>
{% else %}
Alle Schichten sind voll. Schau später noch mal vorbei.
{% endif %}
{% endblock %}

View File

@ -17,9 +17,9 @@ def index(request):
# currently only sorts by date
context = {}
if request.helper:
context["my_shifts"] = request.helper.shiftregistration_set.filter(
context["my_shifts"] = (reg.shift for reg in request.helper.shiftregistration_set.filter(
shift__start_at__gt=timezone.now()
).order_by("shift__start_at")
).order_by("shift__start_at"))
imp_shift = request.helper.important_shift()
print(imp_shift)