Skip to content
Snippets Groups Projects
Commit 767d80b6 authored by Frank Poetzsch-Heffter's avatar Frank Poetzsch-Heffter
Browse files

some changes in index template

parent 43792212
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ class Status:
status_list = [
Status(name='beantragt', style_class='red'),
Status(name='bewilligt', style_class='orange'),
Status(name='abgelehnt', style_class='black'),
Status(name='bestellt', style_class='yellow'),
Status(name='bezahlt', style_class='green'),
]
......
......@@ -17,22 +17,33 @@
</button>
</form>
<h5>Laufende Anträge</h5>
<h4>Laufende Anträge</h4>
<div class="collection">
{% for booking in bookings %}
{# <div class="collection-item row">#}
<a href="{% url 'booking_edit' booking.id %}" class="collection-item row">
STATUS_ID: {% booking.status.id %}
<div class="collection-item row">
{# <a href="{% url 'booking_edit' booking.id %}" class="collection-item row"> #}
<span class="col s12 m8">{{ booking.description }}</span>
<span class="col s12 m3 flushright">{{ booking.planned_amount }} €</span>
<span class="col s12 m2 flushright">{{ booking.planned_amount }} €</span>
<span class="col s12 m1 badge new {{ booking.getStatus.style_class }}">{{ booking.getStatus.name }}</span>
{# <form action="{% url 'booking_edit' booking.id %}" class="col s12 m2">#}
{# {% csrf_token %}#}
{# <button type="submit" name="edit" class="waves-effect waves-light btn-flat btn-flat-medium" title="Bearbeiten">#}
{# <i class="material-icons center green-text">create</i>#}
{# </button>#}
{# </form>#}
</a>
{# </div>#}
<form action="{% url 'booking_edit' booking.id %}" class="col s12 m1">
{% csrf_token %}
<input type="hidden" value="{{ booking.id }}" name="booking-id">
{% if booking.status.id == 0 %}
<button type="submit" name="edit"
class="waves-effect waves-light btn-flat btn-flat-large" title="Bearbeiten">
<i class="material-icons center green-text">create</i>
</button>
{% endif %}
{% if booking.status.id == 1 %}
<button type="submit" name="order"
class="waves-effect waves-light btn-flat btn-flat-large" title="Ware ist bestellt">
<i class="material-icons center red-text">shopping-cart</i>
</button>
{% endif %}
</form>
{# </a>#}
</div>
{% endfor %}
</div>
{% endblock %}
......
......@@ -75,7 +75,7 @@ def check(request):
if 'allow' in request.POST:
Booking.objects.filter(id=booking_id).update(status=1)
elif 'deny' in request.POST:
Booking.objects.filter(id=booking_id).update(status=3)
Booking.objects.filter(id=booking_id).update(status=2)
# Notify user
# register_notification(title="Ihr Antrag auf Unterrichtsbefreiung wurde abgelehnt",
# description="Ihr Antrag auf Unterrichtsbefreiung vom {}, {} Uhr bis {}, {} Uhr wurde von der "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment