Merge branch 'master' into feature/104/show-map-on-location-page

This commit is contained in:
Tom Naessens 2019-05-31 09:22:26 +12:00
commit 8e682f0216
4 changed files with 9 additions and 2 deletions

View file

@ -10,6 +10,7 @@
<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>
<a href="{{ url_for("order_bp.orders", location_id=location.id) }}" class="btn btn-primary btn-sm">Create order</a>
</div>
<div class="col-md-push-1 col-md-5 padding-top">
{% if location.address %}

View file

@ -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>

View file

@ -8,7 +8,7 @@
<div class="row">
{% if not current_user.is_anonymous() %}
<div class="col-md-push-4 col-md-6">
<h3>Create new order:</h3>
<h3>Edit order:</h3>
<div class="row darker">
<div class="col-sm-12">
<form method="post" action="{{ url_for('.order_edit', id=order_id) }}">

View file

@ -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)