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
ea3a955a
Commit
ea3a955a
authored
Mar 18, 2020
by
Kirby Ezekiel Santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the ingredients create page
parent
d9b75d3c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
2 deletions
+53
-2
urls.py
froyo/urls.py
+3
-1
views.py
froyo/views.py
+3
-0
functional_test.py
functional_test.py
+1
-1
ingredients_create_form.html
templates/ingredients_create_form.html
+34
-0
ingredients_list.html
templates/ingredients_list.html
+12
-0
No files found.
froyo/urls.py
View file @
ea3a955a
...
@@ -4,10 +4,12 @@ from .views import HomePageView
...
@@ -4,10 +4,12 @@ from .views import HomePageView
from
.views
import
IngredientsListView
from
.views
import
IngredientsListView
from
.views
import
IngredientsDetailView
from
.views
import
IngredientsDetailView
from
.views
import
IngredientsUpdateView
from
.views
import
IngredientsUpdateView
from
.views
import
IngredientsCreateView
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
()),
path
(
'ingredients-detail'
,
IngredientsDetailView
.
as_view
()),
path
(
'ingredients-update'
,
IngredientsUpdateView
.
as_view
())
path
(
'ingredients-update'
,
IngredientsUpdateView
.
as_view
()),
path
(
'ingredients-create'
,
IngredientsCreateView
.
as_view
())
]
]
froyo/views.py
View file @
ea3a955a
...
@@ -26,3 +26,6 @@ class IngredientsDetailView(TemplateView):
...
@@ -26,3 +26,6 @@ class IngredientsDetailView(TemplateView):
class
IngredientsUpdateView
(
TemplateView
):
class
IngredientsUpdateView
(
TemplateView
):
template_name
=
"ingredients_update_form.html"
template_name
=
"ingredients_update_form.html"
class
IngredientsCreateView
(
TemplateView
):
template_name
=
"ingredients_create_form.html"
functional_test.py
View file @
ea3a955a
...
@@ -128,7 +128,7 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -128,7 +128,7 @@ class NewVisitorTest(unittest.TestCase):
back_button_to_home_from_ingredients
.
click
()
back_button_to_home_from_ingredients
.
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
)
)
...
...
templates/ingredients_create_form.html
0 → 100644
View file @
ea3a955a
<!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>
templates/ingredients_list.html
View file @
ea3a955a
...
@@ -31,5 +31,17 @@
...
@@ -31,5 +31,17 @@
</tbody>
</tbody>
</table>
</table>
</div>
</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>
</body>
</html>
</html>
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