From 2d4ad2a60577502a0325a2e2a4fc7c343b9cb566 Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Thu, 30 May 2019 14:10:47 +1200 Subject: [PATCH] Adds a button on the location/ and locations/ page to start a new order at the given location #120 --- app/templates/location.html | 5 ++++- app/templates/locations.html | 5 ++++- app/views/order.py | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/templates/location.html b/app/templates/location.html index 2ac5081..8935a20 100644 --- a/app/templates/location.html +++ b/app/templates/location.html @@ -9,8 +9,11 @@

Location: {{ location.name }}

: {{ location.address }}
: {{ location.telephone }}
- : {{ location.website }} + : {{ location.website }}
+ Create order + +

Products

diff --git a/app/templates/locations.html b/app/templates/locations.html index 874cf36..1103047 100644 --- a/app/templates/locations.html +++ b/app/templates/locations.html @@ -9,7 +9,7 @@

Locations

- + {% for loc in locations -%} @@ -17,6 +17,9 @@ + {%- endfor %} diff --git a/app/views/order.py b/app/views/order.py index 28fcfbc..ad6072d 100644 --- a/app/views/order.py +++ b/app/views/order.py @@ -17,6 +17,9 @@ order_bp = Blueprint('order_bp', 'order') def orders(form=None): if form is None and not current_user.is_anonymous(): form = OrderForm() + location_id = request.args.get('location_id') + form.location_id.default = location_id + form.process() form.populate() return render_template('orders.html', orders=get_orders(), form=form)
NameAddress
NameAddress
{{ loc.name }} {{ loc.address }} + Create order +