Skip to content

Commit

Permalink
Hide create order button when a user is not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNaessens committed May 30, 2019
1 parent 4e143b9 commit 7de4dbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/templates/location.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ <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> <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 class="row">
Expand Down
4 changes: 3 additions & 1 deletion app/templates/locations.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ <h3>Locations</h3>
<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>
{% 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>
</tr>
{%- endfor %}
Expand Down

0 comments on commit 7de4dbf

Please sign in to comment.