Adds a button on the location/ and locations/ page to start a new order at the given location #120
This commit is contained in:
parent
2314ec0e3b
commit
2d4ad2a605
3 changed files with 11 additions and 2 deletions
|
@ -9,8 +9,11 @@
|
|||
<h3>Location: {{ location.name }}</h3>
|
||||
<span class="glyphicon glyphicon-home"></span>: {{ location.address }} <br/>
|
||||
<span class="glyphicon glyphicon-phone"></span>: {{ location.telephone }} <br/>
|
||||
<span class="glyphicon glyphicon-link"></span>: <a href="{{ location.website}}">{{ location.website }}</a>
|
||||
<span class="glyphicon glyphicon-link"></span>: <a href="{{ location.website}}">{{ location.website }}</a> <br/>
|
||||
<a href="{{ url_for("order_bp.orders", location_id=location.id) }}" class="btn btn-primary btn-sm">Create order</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-push-1 col-md-10 darker">
|
||||
<h3 id="order-title">Products</h3>
|
||||
<table class="table table-hover table-condensed">
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<h3>Locations</h3>
|
||||
<table class="table table-hover table-condensed">
|
||||
<thead>
|
||||
<tr><th>Name</th><th>Address</th><th></th></tr>
|
||||
<tr><th>Name</th><th>Address</th><th></th><th></th><th></th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for loc in locations -%}
|
||||
|
@ -17,6 +17,9 @@
|
|||
<td><a href="{{ url_for('location', id=loc.id) }}">{{ loc.name }}</a></td>
|
||||
<td>{{ loc.address }}<td>
|
||||
<td><a href="{{ loc.website}}"><span class="glyphicon glyphicon-link"></span></a></td>
|
||||
<td>
|
||||
<a href="{{ url_for("order_bp.orders", location_id=loc.id) }}" class="btn btn-primary btn-xs">Create order</a>
|
||||
</td>
|
||||
</tr>
|
||||
{%- endfor %}
|
||||
</tbody>
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue