Commit 4216c3a6 authored by Kirby Ezekiel Santos's avatar Kirby Ezekiel Santos

Added the ingredients detail page which contains no data yet

parent b7faf601
......@@ -2,8 +2,10 @@ from django.urls import path
from .views import HomePageView
from .views import IngredientsListView
from .views import IngredientsDetailView
urlpatterns = [
path('', HomePageView.as_view()),
path('ingredients-list', IngredientsListView.as_view())
path('ingredients-list', IngredientsListView.as_view()),
path('ingredients-detail', IngredientsDetailView.as_view())
]
......@@ -9,6 +9,7 @@ class HomePageView(TemplateView):
class IngredientsListView(ListView):
template_name = "ingredients_list.html"
Ingredient.objects.all().delete()
emptyIngredient = Ingredient(
name="",
quantity=""
......@@ -19,3 +20,6 @@ class IngredientsListView(ListView):
context = {
"object_list": queryset
}
class IngredientsDetailView(TemplateView):
template_name = "ingredients_detail.html"
<!DOCTYPE html>
<html>
<head>
<title>Ingredients - Detail</title>
</head>
<body>
<div>
<h1 id="page_header">Ingredients - Detail</h1>
</div>
<div>
<table class="table">
<thead>
<tr>
<th>Ingredient</th>
<th>Qty On Hand</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
......@@ -13,7 +13,7 @@
<table class="table">
<thead>
<tr>
<th>Ingredient</th>
<th>Inventory</th>
<th></th>
</tr>
</thead>
......@@ -22,8 +22,8 @@
<tr>
<td>{{object.name}}</td>
<td>
<form>
<button type="submit">Go to detail</button>
<form method="get" action="http://localhost:8000/ingredients-detail">
<button type="submit" id="button_to_ingredients_detail">Go to detail</button>
</form>
</td>
</tr>
......
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