DoorAdmin/imaginaerraum_door_admin/templates/admins.html

84 lines
2.8 KiB
HTML
Raw Normal View History

{% extends 'base.html' %}
{% block header %}
2021-04-08 18:53:41 +00:00
{% block title %}<h1>Nutzer Übersicht</h1>{% endblock %}
2021-04-07 09:29:50 +00:00
<script src="../static/js/jquery-3.6.0.js"></script>
{% endblock %}
{% block content %}
2021-04-07 09:29:50 +00:00
<table class="table">
<thead>
<th scope="col">Benutzer</th>
2021-04-07 09:29:50 +00:00
<th scope="col">E-Mail</th>
<th scope="col">Aktiv</th>
<th scope="col">Admin</th>
<th scope="col">Super-Admin</th>
2021-04-07 09:29:50 +00:00
<th scope="col">Aktionen</th>
</thead>
<tbody>
{% for data in admin_data %}
{% if data['active'] %}
2021-04-07 09:29:50 +00:00
<tr>
{% else %}
<tr style="background-color: lightgrey">
{% endif %}
{% for field in ['username', 'email', 'active', 'admin', 'super_admin'] %}
2021-04-07 09:29:50 +00:00
<th scope="row">{{ data[field] if data[field] }}</th>
{% endfor %}
<td>
{% if not data['super_admin'] %}
2022-01-27 22:56:48 +00:00
<a href="{{ url_for('door_app.admin_toggle_active', username=data['username']) }}"><img src="static/stop.png" title="Aktivieren/Deaktivieren" alt="Toggle active"></a>
<a href="{{ url_for('door_app.delete_admins', username=data['username']) }}"><img src="static/delete.png" title="Löschen" alt="Delete"></a>
{% endif %}
{% if data['admin'] %}
{% if not data['super_admin'] %}
2022-01-27 22:56:48 +00:00
<a href="{{ url_for('door_app.demote_admin', username=data['username']) }}"><img src="static/demote.png" title="Admin-Rechte widerrufen" alt="Demote"></a>
{% endif %}
{% else %}
2022-01-27 22:56:48 +00:00
<a href="{{ url_for('door_app.promote_admin', username=data['username']) }}"><img src="static/promote.png" title="Zu Admin machen" alt="Promote"></a>
{% endif %}
2021-04-07 09:29:50 +00:00
</td>
</tr>
{% endfor %}
2021-04-07 09:29:50 +00:00
</tbody>
</table>
2021-04-08 18:53:41 +00:00
<div class="d-grid gap-3">
<div class="p-2 bg-light border">
<h3>Neuen Benutzer erstellen:</h3>
<form method="POST">
<table>
{{ form.csrf_token }}
<tr>
<td>{{ form.name.label }}</td>
<td>{{ form.name(size=20) }}</td>
</tr>
<tr>
<td>{{ form.email.label }}</td>
<td>{{ form.email(size=20) }}</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="Abschicken">
</td>
</tr>
</table>
</form>
</div>
<div class="p-2 bg-light border">
<h3>Nutzerdaten sichern:</h3>
2022-01-27 22:56:48 +00:00
<form action="{{ url_for('door_app.backup_user_datastore') }}" method="get">
2021-04-08 18:53:41 +00:00
<input type="submit" value="Download">
</form>
</div>
<div class="p-2 bg-light border">
<h3>Nutzerdaten wiederherstellen:</h3>
2022-01-27 22:56:48 +00:00
<form action="{{ url_for('door_app.restore_user_datastore') }}" method=post enctype=multipart/form-data>
2021-04-08 18:53:41 +00:00
<input type=file name=file>
<input type=submit value="Abschicken">
</form>
</div>
</div>
{% endblock %}