eye candy

pull/1/head
parent d1bdd2bc74
commit b6aa6f4e85

@ -16,7 +16,7 @@
<p class="navbar-item has-text-danger">Bestätige deine Telefonnummer über den Link in der SMS</p> <p class="navbar-item has-text-danger">Bestätige deine Telefonnummer über den Link in der SMS</p>
{% endif %} {% endif %}
{% if helper.important_shift %} {% 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 %} {% endif %}
</div> </div>
{% endif %} {% endif %}

@ -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>

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

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

@ -17,9 +17,9 @@ def index(request):
# currently only sorts by date # currently only sorts by date
context = {} context = {}
if request.helper: 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() shift__start_at__gt=timezone.now()
).order_by("shift__start_at") ).order_by("shift__start_at"))
imp_shift = request.helper.important_shift() imp_shift = request.helper.important_shift()
print(imp_shift) print(imp_shift)

Loading…
Cancel
Save