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