brass/templates/user/overview.html

89 lines
2.5 KiB
HTML

{% extends "nav.html" %}
{% block content %}
<section class="section">
<div class="container">
<div class="level">
<div class="level-left">
<h3 class="title is-3">
Nutzer {% if user.role == Role::AreaManager %}für Bereich {{ area.as_ref().unwrap().name }}{% endif %}
</h3>
</div>
<div class="level-right">
<a class="button" href="/users/new">Neuen Nutzer anlegen</a>
</div>
</div>
{% if users.len() == 0 %}
<div class="box">
<h5 class="title is-5">keine Nutzer vorhanden</h5>
</div>
{% else %}
<div class="box">
<table class="table is-fullwidth">
<thead>
<tr>
<th>E-Mail</th>
<th>Name</th>
<th>Rolle</th>
<th>Funktion</th>
{% if user.role == Role::Admin %}
<th>Bereich</th>
{% endif %}
<th></th>
</tr>
</thead>
<tbody>
{% for u in users %}
<tr>
<td>
{{ u.email }}
</td>
<td>
{{ u.name }}
</td>
<td>
{% match u.role %}
{% when Role::Staff %}
<span class="tag is-info is-light">Nutzer</span>
{% when Role::AreaManager %}
<span class="tag is-info is-light">Bereichsleiter</span>
{% when Role::Admin %}
<span class="tag is-info">Admin</span>
{% else %}
{% endmatch %}
</td>
<td>
{% match u.function %}
{% when Function::Posten %}
<span class="tag is-info is-light">Posten</span>
{% when Function::Wachhabender %}
<span class="tag is-info">Wachhabender</span>
{% else %}
{% endmatch %}
</td>
{% if user.role == Role::Admin %}
<td>
{{ u.area.as_ref().unwrap().name }}
</td>
{% endif %}
<td>
<div class="buttons is-right">
<a class="button is-link" href="/users/edit/{{ u.id }}">Bearbeiten</a>
<button class="button is-danger" name="delete-availabillity">Löschen</button>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
</section>
</section>
<script>
</script>
{% endblock %}