Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
thegoodplace
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirby Ezekiel Santos
thegoodplace
Commits
785b49c1
Commit
785b49c1
authored
Mar 18, 2020
by
Kirby Ezekiel Santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the recipe create form page
parent
80095ba2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
2 deletions
+50
-2
urls.py
froyo/urls.py
+3
-1
views.py
froyo/views.py
+3
-0
functional_test.py
functional_test.py
+1
-1
recipes_create_form.html
templates/recipes_create_form.html
+38
-0
recipes_list.html
templates/recipes_list.html
+5
-0
No files found.
froyo/urls.py
View file @
785b49c1
...
...
@@ -8,6 +8,7 @@ from .views import IngredientsCreateView
from
.views
import
RecipesListView
from
.views
import
RecipesDetailView
from
.views
import
RecipesUpdateView
from
.views
import
RecipesCreateView
urlpatterns
=
[
path
(
''
,
HomePageView
.
as_view
()),
...
...
@@ -17,5 +18,6 @@ urlpatterns = [
path
(
'ingredients-create'
,
IngredientsCreateView
.
as_view
()),
path
(
'recipes-list'
,
RecipesListView
.
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
())
]
froyo/views.py
View file @
785b49c1
...
...
@@ -23,3 +23,6 @@ class RecipesDetailView(TemplateView):
class
RecipesUpdateView
(
TemplateView
):
template_name
=
"recipes_update_form.html"
class
RecipesCreateView
(
TemplateView
):
template_name
=
"recipes_create_form.html"
functional_test.py
View file @
785b49c1
...
...
@@ -239,7 +239,7 @@ class NewVisitorTest(unittest.TestCase):
back_button_to_home_from_recipes
.
click
()
time
.
sleep
(
1
)
self
.
assertEqual
(
"http://localhost:8000"
,
"http://localhost:8000
/
"
,
self
.
browser
.
current_url
)
...
...
templates/recipes_create_form.html
0 → 100644
View file @
785b49c1
<!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>
templates/recipes_list.html
View file @
785b49c1
...
...
@@ -30,6 +30,11 @@
</table>
</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>
<form
method=
"get"
action=
"http://localhost:8000"
>
<button
type=
"submit"
id=
"back_button"
>
Back to Home
</button>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment