Hide create order button when a user is not logged in

This commit is contained in:
Tom Naessens 2019-05-31 09:27:44 +12:00
parent 4e143b9b97
commit 7de4dbf5c4
2 changed files with 6 additions and 2 deletions

View file

@ -10,7 +10,9 @@
<span class="glyphicon glyphicon-home"></span>: {{ location.address }} <br/> <span class="glyphicon glyphicon-home"></span>: {{ location.address }} <br/>
<span class="glyphicon glyphicon-phone"></span>: {{ location.telephone }} <br/> <span class="glyphicon glyphicon-phone"></span>: {{ location.telephone }} <br/>
<span class="glyphicon glyphicon-link"></span>: <a href="{{ location.website}}">{{ location.website }}</a> <br/> <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> {% if not current_user.is_anonymous() %}
<a href="{{ url_for("order_bp.orders", location_id=location.id) }}" class="btn btn-primary btn-sm">Create order</a>
{% endif %}
</div> </div>
</div> </div>
<div class="row"> <div class="row">

View file

@ -18,7 +18,9 @@
<td>{{ loc.address }}<td> <td>{{ loc.address }}<td>
<td><a href="{{ loc.website}}"><span class="glyphicon glyphicon-link"></span></a></td> <td><a href="{{ loc.website}}"><span class="glyphicon glyphicon-link"></span></a></td>
<td> <td>
<a href="{{ url_for("order_bp.orders", location_id=loc.id) }}" class="btn btn-primary btn-xs">Create order</a> {% if not current_user.is_anonymous() %}
<a href="{{ url_for("order_bp.orders", location_id=loc.id) }}" class="btn btn-primary btn-xs">Create order</a>
{% endif %}
</td> </td>
</tr> </tr>
{%- endfor %} {%- endfor %}