Commit ea3a955a authored by Kirby Ezekiel Santos's avatar Kirby Ezekiel Santos

Added the ingredients create page

parent d9b75d3c
......@@ -4,10 +4,12 @@ from .views import HomePageView
from .views import IngredientsListView
from .views import IngredientsDetailView
from .views import IngredientsUpdateView
from .views import IngredientsCreateView
urlpatterns = [
path('', HomePageView.as_view()),
path('ingredients-list', IngredientsListView.as_view()),
path('ingredients-detail', IngredientsDetailView.as_view()),
path('ingredients-update', IngredientsUpdateView.as_view())
path('ingredients-update', IngredientsUpdateView.as_view()),
path('ingredients-create', IngredientsCreateView.as_view())
]
......@@ -26,3 +26,6 @@ class IngredientsDetailView(TemplateView):
class IngredientsUpdateView(TemplateView):
template_name = "ingredients_update_form.html"
class IngredientsCreateView(TemplateView):
template_name = "ingredients_create_form.html"
......@@ -128,7 +128,7 @@ class NewVisitorTest(unittest.TestCase):
back_button_to_home_from_ingredients.click()
time.sleep(1)
self.assertEqual(
"http://localhost:8000",
"http://localhost:8000/",
self.browser.current_url
)
......
<!DOCTYPE html>
<html>
<head>
<title>Ingredients - Create</title>
</head>
<body>
<div>
<h1 id="page_header">Ingredients - Create</h1>
</div>
<div>
<form>
<div>
<label>New ingredient</label>
<input type="text" placeholder="Insert name of the ingredient">
</div>
<div>
<label>New ingredient quantity</label>
<input type="text" placeholder="Kindly insert an integer">
</div>
<div>
<button type="submit">Finish Creating Ingredient</button>
</div>
</form>
</div>
<div>
<form method="get" action="http://localhost:8000/ingredients-list">
<button type="submit" id="back_button">Back to List</button>
</form>
</div>
</body>
</html>
......@@ -31,5 +31,17 @@
</tbody>
</table>
</div>
<div>
<form method="get" action="http://localhost:8000/ingredients-create">
<button type="submit" id="button_to_ingredients_create">Create New Ingredient</button>
</form>
</div>
<div>
<form method="get" action="http://localhost:8000">
<button type="submit" id="back_button">Back to Home</button>
</form>
</div>
</body>
</html>
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