Unify look of editor buttons.

This commit is contained in:
2019-02-16 11:57:15 +01:00
parent ded8fc586a
commit 4da3f38cf4
4 changed files with 8 additions and 4 deletions

46
templates/drink_list.html Normal file
View File

@@ -0,0 +1,46 @@
{% extends "base.html" %}
{% set active_page = "drinks" %}
{% block title %}Drinks {{ super() }}{% endblock %}
{% block page %}
{% if g.is_editor %}
<div class="btn-toolbar" role="toolbar">
<a class="btn btn-primary" href="{{ url_for('new_drink') }}" role="button"><span class="fas fa-plus"></span> 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 %}
<th scope="col" class="col-sm-auto text-center"></th>
{% 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 %}
<td class="col-sm-auto text-center">
<a class="btn btn-default" href="{{ url_for('drink_edit', drink_id = drink.id) }}">
<span class="fas fa-pencil-alt"></span>
</a>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}