Files
estus-shots-py/templates/drinks.html
2019-01-11 19:12:03 +01:00

53 lines
1.6 KiB
HTML

{% extends "base.html" %}
{% set active_page = "drinks" %}
{% block title %}Drinks{% endblock %}
{% block content %}
{% if g.is_editor %}
<div class="btn-toolbar" role="toolbar">
<a class="btn btn-primary" href="/newdrink" role="button">New Drink</a>
</div>
{% endif %}
{% if not model.drinks %}
There are no drinks.
{% else %}
<table class="table table-hover table-striped table-bordered">
<thead>
<tr>
{% for prop, caption in model.columns %}
<th scope="col" class="col-sm-auto text-center">{{ caption }}</th>
{% endfor %}
{% if g.is_editor %}
{% for id, caption in model.controls %}
<th scope="col" class="col-sm-auto text-center">{{ caption }}</th>
{% endfor %}
{% endif %}
</tr>
</thead>
<tbody>
{% for drink in model.drinks %}
<tr>
{% for prop, caption in model.columns %}
<td class="col-sm-auto text-center">{{ drink[prop] }}</td>
{% endfor %}
{% if g.is_editor %}
{% for name, caption in model.controls %}
<td class="col-sm-auto text-center">
<a class="btn btn-dark"
href="{% if name == 'edit'%}
/drinks/{{ drink.id }}
{% endif %}">
{{ caption }}
</a>
</td>
{% endfor %}
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}