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
56dfdf55
Commit
56dfdf55
authored
Mar 18, 2020
by
Kirby Ezekiel Santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the recipe update form page
parent
853d64e2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
3 deletions
+53
-3
tests.py
froyo/tests.py
+1
-1
urls.py
froyo/urls.py
+3
-1
views.py
froyo/views.py
+3
-0
recipes_detail.html
templates/recipes_detail.html
+1
-1
recipes_update_form.html
templates/recipes_update_form.html
+45
-0
No files found.
froyo/tests.py
View file @
56dfdf55
...
@@ -39,4 +39,4 @@ class RecipesDetailPageTest(TestCase):
...
@@ -39,4 +39,4 @@ class RecipesDetailPageTest(TestCase):
class
RecipesUpdatePageTest
(
TestCase
):
class
RecipesUpdatePageTest
(
TestCase
):
def
test_recipes_update_page_returns_correct_html
(
self
):
def
test_recipes_update_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/recipes-update'
)
response
=
self
.
client
.
get
(
'/recipes-update'
)
self
.
assertTemplateUsed
(
response
,
'recipes_update.html'
)
self
.
assertTemplateUsed
(
response
,
'recipes_update
_form
.html'
)
froyo/urls.py
View file @
56dfdf55
...
@@ -7,6 +7,7 @@ from .views import IngredientsUpdateView
...
@@ -7,6 +7,7 @@ from .views import IngredientsUpdateView
from
.views
import
IngredientsCreateView
from
.views
import
IngredientsCreateView
from
.views
import
RecipesListView
from
.views
import
RecipesListView
from
.views
import
RecipesDetailView
from
.views
import
RecipesDetailView
from
.views
import
RecipesUpdateView
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
HomePageView
.
as_view
()),
path
(
''
,
HomePageView
.
as_view
()),
...
@@ -15,5 +16,6 @@ urlpatterns = [
...
@@ -15,5 +16,6 @@ urlpatterns = [
path
(
'ingredients-update'
,
IngredientsUpdateView
.
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
()),
path
(
'recipes-list'
,
RecipesListView
.
as_view
()),
path
(
'recipes-detail'
,
RecipesDetailView
.
as_view
())
path
(
'recipes-detail'
,
RecipesDetailView
.
as_view
()),
path
(
'recipes-update'
,
RecipesUpdateView
.
as_view
())
]
]
froyo/views.py
View file @
56dfdf55
...
@@ -20,3 +20,6 @@ class RecipesListView(TemplateView):
...
@@ -20,3 +20,6 @@ class RecipesListView(TemplateView):
class
RecipesDetailView
(
TemplateView
):
class
RecipesDetailView
(
TemplateView
):
template_name
=
"recipes_detail.html"
template_name
=
"recipes_detail.html"
class
RecipesUpdateView
(
TemplateView
):
template_name
=
"recipes_update_form.html"
templates/recipes_detail.html
View file @
56dfdf55
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
</div>
</div>
<div>
<div>
<form>
<form
method=
"get"
action=
"http://localhost:8000/recipes-update"
>
<button
type=
"submit"
id=
"button_to_recipes_update"
>
Update Fields
</button>
<button
type=
"submit"
id=
"button_to_recipes_update"
>
Update Fields
</button>
</form>
</form>
</div>
</div>
...
...
templates/recipes_update_form.html
0 → 100644
View file @
56dfdf55
<!DOCTYPE html>
<html>
<head>
<title>
Recipes - Update
</title>
</head>
<body>
<div>
<h1
id=
"page_header"
>
Recipes - Update
</h1>
</div>
<div>
<table
class=
"table"
>
<thead>
<tr>
<th>
Field
</th>
<th>
Current Value
</th>
<th>
New Value
</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<form>
<td>
<input
type=
"text"
>
</td>
<td>
<button
type=
"submit"
>
Save Changes
</button>
</td>
</form>
</tr>
</tbody>
</table>
</div>
<div>
<form
method=
"get"
action=
"http://localhost:8000/recipes-detail"
>
<button
type=
"submit"
id=
"back_button"
>
Back to Detail
</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