Commit 785b49c1 authored by Kirby Ezekiel Santos's avatar Kirby Ezekiel Santos

Added the recipe create form page

parent 80095ba2
...@@ -8,6 +8,7 @@ from .views import IngredientsCreateView ...@@ -8,6 +8,7 @@ from .views import IngredientsCreateView
from .views import RecipesListView from .views import RecipesListView
from .views import RecipesDetailView from .views import RecipesDetailView
from .views import RecipesUpdateView from .views import RecipesUpdateView
from .views import RecipesCreateView
urlpatterns = [ urlpatterns = [
path('', HomePageView.as_view()), path('', HomePageView.as_view()),
...@@ -17,5 +18,6 @@ urlpatterns = [ ...@@ -17,5 +18,6 @@ urlpatterns = [
path('ingredients-create', IngredientsCreateView.as_view()), path('ingredients-create', IngredientsCreateView.as_view()),
path('recipes-list', RecipesListView.as_view()), path('recipes-list', RecipesListView.as_view()),
path('recipes-detail', RecipesDetailView.as_view()), path('recipes-detail', RecipesDetailView.as_view()),
path('recipes-update', RecipesUpdateView.as_view()) path('recipes-update', RecipesUpdateView.as_view()),
path('recipes-create', RecipesCreateView.as_view())
] ]
...@@ -23,3 +23,6 @@ class RecipesDetailView(TemplateView): ...@@ -23,3 +23,6 @@ class RecipesDetailView(TemplateView):
class RecipesUpdateView(TemplateView): class RecipesUpdateView(TemplateView):
template_name = "recipes_update_form.html" template_name = "recipes_update_form.html"
class RecipesCreateView(TemplateView):
template_name = "recipes_create_form.html"
...@@ -239,7 +239,7 @@ class NewVisitorTest(unittest.TestCase): ...@@ -239,7 +239,7 @@ class NewVisitorTest(unittest.TestCase):
back_button_to_home_from_recipes.click() back_button_to_home_from_recipes.click()
time.sleep(1) time.sleep(1)
self.assertEqual( self.assertEqual(
"http://localhost:8000", "http://localhost:8000/",
self.browser.current_url self.browser.current_url
) )
......
<!DOCTYPE html>
<html>
<head>
<title>Recipes - Create</title>
</head>
<body>
<div>
<h1 id="page_header">Recipes - Create</h1>
</div>
<div>
<form>
<div>
<label>New recipe</label>
<input type="text" placeholder="Insert name of the recipe">
</div>
<div>
<label>Recipe field</label>
<input type="text" placeholder="Insert field">
</div>
<div>
<label>Recipe field</label>
<input type="text" placeholder="Insert field">
</div>
<div>
<button type="submit">Finish Creating Recipe</button>
</div>
</form>
</div>
<div>
<form method="get" action="http://localhost:8000/recipes-list">
<button type="submit" id="back_button">Back to List</button>
</form>
</div>
</body>
</html>
...@@ -30,6 +30,11 @@ ...@@ -30,6 +30,11 @@
</table> </table>
</div> </div>
<div>
<form method="get" action="http://localhost:8000/recipes-create">
<button type="submit" id="button_to_recipes_create">Create New Recipe</button>
</form>
</div>
<div> <div>
<form method="get" action="http://localhost:8000"> <form method="get" action="http://localhost:8000">
<button type="submit" id="back_button">Back to Home</button> <button type="submit" id="back_button">Back to Home</button>
......
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