rollerverbrauch/app/templates/admin.html

61 lines
2.4 KiB
HTML
Raw Permalink Normal View History

{% extends "layout.html" %}
{% block body %}
<h3>Admin</h3>
2016-05-24 06:49:39 +02:00
<div class="panel panel-default">
<div class="panel-heading">Users</div>
2016-05-24 06:49:39 +02:00
<div class="panel-body">
We have {{ users|length }} users so far:
2016-05-24 06:49:39 +02:00
<ul>
{% for user in users %}
2016-05-24 06:49:39 +02:00
<li>{{user.email}}</li>
{% endfor %}
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Consumables</div>
<div class="panel-body">
2016-08-06 10:59:20 +02:00
<a href="{{ url_for('create_consumable') }}" id="create_consumable" class="btn btn-primary " role="button">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> create
</a>
</div>
<table class="table table-striped table-bordered">
<tbody>
<tr>
<th>
Name
</th>
<th>
Unit
</th>
2016-06-28 23:33:24 +02:00
<th>
Used by
</th>
<th>
Actions
</th>
</tr>
{% for consumable in consumables %}
<tr>
2016-08-06 10:59:20 +02:00
<td id="name_{{loop.index}}">{{ consumable.name }}</td>
<td id="unit_{{loop.index}}">{{ consumable.unit }}</td>
<td id="count_{{loop.index}}">{{ consumable.vehicles | length }} vehicles</td>
2016-06-28 23:33:24 +02:00
<td>
{% if not consumable.in_use %}
2016-08-06 10:59:20 +02:00
<a href="{{ url_for('delete_consumable', cid=consumable.id) }}" id="delete_consumable{{loop.index}}" class="btn btn-primary btn-warning " role="button">
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span> delete
</a>
{% endif %}
2016-08-06 10:59:20 +02:00
<a href="{{ url_for('edit_consumable', cid=consumable.id) }}" id="edit_consumable{{loop.index}}" class="btn btn-primary " role="button">
2016-06-28 23:33:24 +02:00
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> edit
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}