Commit 459822c4 authored by Jansen Lao's avatar Jansen Lao
parents f4ca1637 59e047a2
Pipeline #1928 canceled with stages
......@@ -2,7 +2,6 @@
{% load static %}
{% block content %}
</div>
<div class="card w-75">
<div class="card-header">
Order Details:
......@@ -21,7 +20,7 @@
<div class="form-group">
<label for="name"> Date of Order: </label>
<input type="date" class="form-control" id="date" name="date" value="{{order.ordered_at}}" disabled>
<input type="text" class="form-control" id="date" name="date" value="{{order.ordered_at}}" disabled>
</div>
<div class="form-group">
......@@ -46,4 +45,5 @@
</form>
</div>
<a href="{% url 'view_order_details' order.pk %}"><button class="btn btn-secondary">Back</button></a>
{% endblock %}
......@@ -14,11 +14,8 @@
<li class="list-group-item"><span style="color: #8AB4F8; font-weight:bold">Mode of Payment: </span> {{order.payment_mode}}</li>
</ul>
</div>
<form action="#" method="post">
{% csrf_token %}
<input type="hidden" name="message" value="Bottle deleted successfully">
<a href="#"><button class="btn btn-secondary my-4">Delete Order</button></a>
</form>
<a href="{% url 'update_order' order.pk %}"><button type="submit" class="mt-3 btn btn-primary">Update Order</button></a>
<a onclick="window.history.go(-1); return false;"><button class="btn btn-secondary">Back</button></a>
<a href="{% url 'update_order' order.pk %}"><button class="btn btn-primary">Update Order</button></a>
<a href="{% url 'delete_order' order.pk %}"><button class="btn btn-danger my-4">Delete Order</button></a>
<a href="{% url 'home' %}"><button class="btn btn-secondary">Back</button></a>
{% endblock %}
\ No newline at end of file
......@@ -12,6 +12,7 @@ urlpatterns = [
path('view_order_details/<int:pk>', views.view_order_details, name="view_order_details"),
path('update_order/<int:pk>', views.update_order, name="update_order"),
path('add_order', views.add_order, name="add_order"),
path('delete_order/<int:pk>', views.delete_order, name="delete_order"),
# Path for Food Model
path('add_food', views.add_food, name="add_food"),
path('foods', views.view_foods, name="view_foods"),
......
......@@ -132,6 +132,9 @@ def add_food(request):
else:
return render(request, 'Kiosk/add_food.html')
def delete_order(request, pk):
Order.objects.filter(pk=pk).delete()
return redirect('home')
### Views for Food Model
def view_foods(request):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment