2021-03-27 21:58:31 +00:00
|
|
|
{% extends 'base.html' %}
|
|
|
|
{% block header %}
|
|
|
|
{% block title %}<h1>Admin Übersicht</h1>{% endblock %}
|
|
|
|
|
2021-04-07 09:29:50 +00:00
|
|
|
<script src="../static/js/jquery-3.6.0.js"></script>
|
2021-03-27 21:58:31 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
2021-04-07 09:29:50 +00:00
|
|
|
<table class="table">
|
|
|
|
<thead>
|
2021-04-07 14:15:39 +00:00
|
|
|
<th scope="col">Benutzer</th>
|
2021-04-07 09:29:50 +00:00
|
|
|
<th scope="col">E-Mail</th>
|
|
|
|
<th scope="col">Aktiv</th>
|
2021-04-07 14:15:39 +00:00
|
|
|
<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 %}
|
2021-04-07 14:15:39 +00:00
|
|
|
{% if data['active'] %}
|
2021-04-07 09:29:50 +00:00
|
|
|
<tr>
|
2021-04-07 14:15:39 +00:00
|
|
|
{% 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>
|
2021-04-07 14:15:39 +00:00
|
|
|
{% if not data['super_admin'] %}
|
2021-04-07 09:29:50 +00:00
|
|
|
<a href="{{ url_for('admin_toggle_active', username=data['username']) }}"><img src="static/stop.png" title="Aktivieren/Deaktivieren" alt="Toggle active"></a>
|
|
|
|
<a href="{{ url_for('delete_admins', username=data['username']) }}"><img src="static/delete.png" title="Löschen" alt="Delete"></a>
|
2021-04-07 14:15:39 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if data['admin'] %}
|
|
|
|
{% if not data['super_admin'] %}
|
|
|
|
<a href="{{ url_for('demote_admin', username=data['username']) }}"><img src="static/demote.png" title="Admin-Rechte widerrufen" alt="Demote"></a>
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
<a href="{{ url_for('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>
|
2021-03-27 21:58:31 +00:00
|
|
|
{% endfor %}
|
2021-04-07 09:29:50 +00:00
|
|
|
</tbody>
|
2021-03-27 21:58:31 +00:00
|
|
|
</table>
|
|
|
|
<div>
|
|
|
|
<p>
|
2021-04-07 14:15:39 +00:00
|
|
|
Neuen Benutzer erstellen:
|
2021-03-27 21:58:31 +00:00
|
|
|
</p>
|
|
|
|
<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>
|
2021-03-28 19:50:44 +00:00
|
|
|
<form action="{{ url_for('backup_user_datastore') }}" method="get">
|
|
|
|
<input type="submit" value="Admin Daten sichern">
|
|
|
|
</form>
|
|
|
|
<form action="{{ url_for('restore_user_datastore') }}" method=post enctype=multipart/form-data>
|
|
|
|
<input type=file name=file>
|
|
|
|
<input type=submit value="Admin Daten wiederherstellen">
|
|
|
|
</form>
|
2021-03-27 21:58:31 +00:00
|
|
|
{% endblock %}
|