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
b99bddc0
Commit
b99bddc0
authored
Mar 18, 2020
by
Kirby Ezekiel Santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the orders update form page
parent
8818b2c3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
4 deletions
+90
-4
tests.py
froyo/tests.py
+1
-1
urls.py
froyo/urls.py
+3
-1
views.py
froyo/views.py
+3
-0
functional_test.py
functional_test.py
+1
-1
orders_detail.html
templates/orders_detail.html
+1
-1
orders_update_form.html
templates/orders_update_form.html
+81
-0
No files found.
froyo/tests.py
View file @
b99bddc0
...
...
@@ -59,4 +59,4 @@ class OrdersDetailPageTest(TestCase):
class
OrdersUpdatePageTest
(
TestCase
):
def
test_orders_update_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/orders-update'
)
self
.
assertTemplateUsed
(
response
,
'orders_update.html'
)
self
.
assertTemplateUsed
(
response
,
'orders_update
_form
.html'
)
froyo/urls.py
View file @
b99bddc0
...
...
@@ -14,6 +14,7 @@ from .views import RecipesCreateView
from
.views
import
OrdersListView
from
.views
import
OrdersDetailView
from
.views
import
OrdersUpdateView
urlpatterns
=
[
path
(
''
,
HomePageView
.
as_view
()),
...
...
@@ -26,5 +27,6 @@ urlpatterns = [
path
(
'recipes-update'
,
RecipesUpdateView
.
as_view
()),
path
(
'recipes-create'
,
RecipesCreateView
.
as_view
()),
path
(
'orders-list'
,
OrdersListView
.
as_view
()),
path
(
'orders-detail'
,
OrdersDetailView
.
as_view
())
path
(
'orders-detail'
,
OrdersDetailView
.
as_view
()),
path
(
'orders-update'
,
OrdersUpdateView
.
as_view
())
]
froyo/views.py
View file @
b99bddc0
...
...
@@ -32,3 +32,6 @@ class OrdersListView(TemplateView):
class
OrdersDetailView
(
TemplateView
):
template_name
=
"orders_detail.html"
class
OrdersUpdateView
(
TemplateView
):
template_name
=
"orders_update_form.html"
functional_test.py
View file @
b99bddc0
...
...
@@ -306,7 +306,7 @@ class NewVisitorTest(unittest.TestCase):
back_button_to_orders_detail_from_update
.
click
()
time
.
sleep
(
1
)
self
.
assertEqual
(
"http://localhost:8000/orders-
list
"
,
"http://localhost:8000/orders-
detail
"
,
self
.
browser
.
current_url
)
...
...
templates/orders_detail.html
View file @
b99bddc0
...
...
@@ -31,7 +31,7 @@
</div>
<div>
<form>
<form
method=
"get"
action=
"http://localhost:8000/orders-update"
>
<button
type=
"submit"
id=
"button_to_orders_update"
>
Update Fields
</button>
</form>
</div>
...
...
templates/orders_update_form.html
0 → 100644
View file @
b99bddc0
<!DOCTYPE html>
<html>
<head>
<title>
Orders - Update
</title>
</head>
<body>
<div>
<h1
id=
"page_header"
>
Orders - 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>
Customer
</td>
<td></td>
<form>
<td>
<input
type=
"text"
>
</td>
<td>
<button
type=
"submit"
>
Save Changes
</button>
</td>
</form>
</tr>
<tr>
<td>
Size
</td>
<td></td>
<form>
<td>
<input
type=
"text"
>
</td>
<td>
<button
type=
"submit"
>
Save Changes
</button>
</td>
</form>
</tr>
<tr>
<td>
Base Recipe
</td>
<td></td>
<form>
<td>
<input
type=
"text"
>
</td>
<td>
<button
type=
"submit"
>
Save Changes
</button>
</td>
</form>
</tr>
<tr>
<td>
Customization
</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/orders-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