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
9f9c2091
Commit
9f9c2091
authored
Mar 18, 2020
by
Kirby Ezekiel Santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the recipes list page
parent
dd97decd
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
4 deletions
+44
-4
urls.py
froyo/urls.py
+3
-1
views.py
froyo/views.py
+0
-1
functional_test.py
functional_test.py
+1
-1
home_page.html
templates/home_page.html
+1
-1
recipes_list.html
templates/recipes_list.html
+39
-0
No files found.
froyo/urls.py
View file @
9f9c2091
...
...
@@ -5,11 +5,13 @@ from .views import IngredientsListView
from
.views
import
IngredientsDetailView
from
.views
import
IngredientsUpdateView
from
.views
import
IngredientsCreateView
from
.views
import
RecipesListView
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-create'
,
IngredientsCreateView
.
as_view
())
path
(
'ingredients-create'
,
IngredientsCreateView
.
as_view
()),
path
(
'recipes-list'
,
RecipesListView
.
as_view
())
]
froyo/views.py
View file @
9f9c2091
from
django.views.generic.base
import
TemplateView
from
django.views.generic.list
import
ListView
class
HomePageView
(
TemplateView
):
template_name
=
"home_page.html"
...
...
functional_test.py
View file @
9f9c2091
...
...
@@ -152,7 +152,7 @@ class NewVisitorTest(unittest.TestCase):
self
.
assertIn
(
"Recipes - List"
,
self
.
browser
.
title
)
recipes_list_header
=
self
.
browser
.
find_element_by_id
(
"page_header"
)
self
.
assertEqual
(
ingredient
s_list_header
.
get_attribute
(
"innerHTML"
),
recipe
s_list_header
.
get_attribute
(
"innerHTML"
),
"Recipes - List"
)
...
...
templates/home_page.html
View file @
9f9c2091
...
...
@@ -18,7 +18,7 @@
<div>
<h2
id=
"home_page_recipes"
>
Recipes
</h2>
<form>
<form
method=
"get"
action=
"http://localhost:8000/recipes-list"
>
<button
type=
"submit"
id=
"button_to_recipes"
>
Go to recipes
</button>
</form>
</div>
...
...
templates/recipes_list.html
0 → 100644
View file @
9f9c2091
<!DOCTYPE html>
<html>
<head>
<title>
Recipes - List
</title>
</head>
<body>
<div>
<h1
id=
"page_header"
>
Recipes - List
</h1>
</div>
<div>
<table
class=
"table"
>
<thead>
<tr>
<th>
Recipes
</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>
<form>
<button
type=
"submit"
id=
"button_to_recipes_detail"
>
Go to detail
</button>
</form>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<form
method=
"get"
action=
"http://localhost:8000"
>
<button
type=
"submit"
id=
"back_button"
>
Back to Home
</button>
</form>
</div>
</body>
</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