Update location views

This commit is contained in:
Midgard 2020-01-27 00:57:51 +01:00
parent 3380d790bc
commit 161a5031e5
Signed by: midgard
GPG key ID: 511C112F1331BBB4
3 changed files with 10 additions and 9 deletions

View file

@ -45,7 +45,7 @@ class HldsSemanticActions:
ast["id"], ast["id"],
name=ast["name"], name=ast["name"],
description=ast["description"], description=ast["description"],
price=ast["price"], price=ast["price"] if ast["price"] else 0,
tags=ast["tags"] if ast["tags"] else [], tags=ast["tags"] if ast["tags"] else [],
choices=ast["choices"], choices=ast["choices"],
) )
@ -70,7 +70,7 @@ class HldsSemanticActions:
ast["id"], ast["id"],
name=ast["name"], name=ast["name"],
description=ast["description"], description=ast["description"],
price=ast["price"], price=ast["price"] if ast["price"] else 0,
tags=ast["tags"], tags=ast["tags"],
) )

View file

@ -7,9 +7,10 @@
<div class="row location_data" xmlns="http://www.w3.org/1999/html"> <div class="row location_data" xmlns="http://www.w3.org/1999/html">
<div class="col-md-push-1 col-md-5 darker"> <div class="col-md-push-1 col-md-5 darker">
<h3>{{ location.name }}</h3> <h3>{{ location.name }}</h3>
<span class="glyphicon glyphicon-home"></span> {{ location.address }} <br/> {% if location.address %}<span class="glyphicon glyphicon-home"></span> {{ location.address }}<br/>{% endif %}
<span class="glyphicon glyphicon-phone"></span> {{ location.telephone }} <br/> {% if location.telephone %}<span class="glyphicon glyphicon-phone"></span>{{ location.telephone }}<br/>{% endif %}
<span class="glyphicon glyphicon-link"></span> <a href="{{ location.website}}">{{ location.website }}</a> {% if location.website %}<span class="glyphicon glyphicon-link"></span> <a href="{{ location.website}}">{{ location.website }}</a> <br/>{% endif %}
{% if location.osm %}<span class="glyphicon glyphicon-map-marker"></span> <a href="{{ location.osm}}">{{ location.osm }}</a> <br/>{% endif %}
{% if not current_user.is_anonymous() %} {% 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> <a href="{{ url_for("order_bp.orders", location_id=location.id) }}" class="btn btn-primary btn-sm">Create order</a>
{% endif %} {% endif %}
@ -28,10 +29,10 @@
<tr><th>Name</th><th>Price</th></tr> <tr><th>Name</th><th>Price</th></tr>
</thead> </thead>
<tbody> <tbody>
{% for prod in location.products -%} {% for dish in location.dishes -%}
<tr> <tr>
<td>{{ prod.name }}</td> <td>{{ dish.name }}{% if dish.description %} <span class="description">({{dish.description}})</span>{% endif %}</td>
<td>{{ prod.price|euro }}<td> <td>{{ dish.price|euro }}<td>
</tr> </tr>
{%- endfor %} {%- endfor %}
</tbody> </tbody>

View file

@ -16,7 +16,7 @@
<tr> <tr>
<td><a href="{{ url_for('general_bp.location', location_id=loc.id) }}">{{ loc.name }}</a></td> <td><a href="{{ url_for('general_bp.location', location_id=loc.id) }}">{{ loc.name }}</a></td>
<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> {{ loc.website }}</a></td>
<td> <td>
{% if not current_user.is_anonymous() %} {% 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> <a href="{{ url_for("order_bp.orders", location_id=loc.id) }}" class="btn btn-primary btn-xs">Create order</a>