Commit e269914b authored by Kirby Ezekiel Santos's avatar Kirby Ezekiel Santos

Added the orders create form page

parent 06025bc7
...@@ -15,6 +15,7 @@ from .views import RecipesCreateView ...@@ -15,6 +15,7 @@ from .views import RecipesCreateView
from .views import OrdersListView from .views import OrdersListView
from .views import OrdersDetailView from .views import OrdersDetailView
from .views import OrdersUpdateView from .views import OrdersUpdateView
from .views import OrdersCreateView
urlpatterns = [ urlpatterns = [
path('', HomePageView.as_view()), path('', HomePageView.as_view()),
...@@ -28,5 +29,6 @@ urlpatterns = [ ...@@ -28,5 +29,6 @@ urlpatterns = [
path('recipes-create', RecipesCreateView.as_view()), path('recipes-create', RecipesCreateView.as_view()),
path('orders-list', OrdersListView.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()) path('orders-update', OrdersUpdateView.as_view()),
path('orders-create', OrdersCreateView.as_view())
] ]
...@@ -35,3 +35,6 @@ class OrdersDetailView(TemplateView): ...@@ -35,3 +35,6 @@ class OrdersDetailView(TemplateView):
class OrdersUpdateView(TemplateView): class OrdersUpdateView(TemplateView):
template_name = "orders_update_form.html" template_name = "orders_update_form.html"
class OrdersCreateView(TemplateView):
template_name = "orders_create_form.html"
...@@ -350,7 +350,7 @@ class NewVisitorTest(unittest.TestCase): ...@@ -350,7 +350,7 @@ class NewVisitorTest(unittest.TestCase):
back_button_to_home_from_orders.click() back_button_to_home_from_orders.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
) )
......
<!DOCTYPE html>
<html>
<head>
<title>Orders - Create</title>
</head>
<body>
<div>
<h1 id="page_header">Orders - Create</h1>
</div>
<div>
<form>
<div>
<label>Customer Name</label>
<input type="text" placeholder="Insert name of the customer">
</div>
<div>
<label>Size</label>
<input type="text" placeholder="Insert size">
</div>
<div>
<label>Base Recipe</label>
<input type="text" placeholder="Insert base recipe">
</div>
<div>
<label>Customization</label>
<input type="text" placeholder="Insert customization">
</div>
<div>
<button type="submit">Confirm Order</button>
</div>
</form>
</div>
<div>
<form method="get" action="http://localhost:8000/orders-list">
<button type="submit" id="back_button">Back to List</button>
</form>
</div>
</body>
</html>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</div> </div>
<div> <div>
<form> <form method="get" action="http://localhost:8000/orders-create">
<button type="submit" id="button_to_orders_create">Create New Order</button> <button type="submit" id="button_to_orders_create">Create New Order</button>
</form> </form>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment