92 lines
4.0 KiB
HTML
Executable File
92 lines
4.0 KiB
HTML
Executable File
{% extends "admin/base.html" %}
|
|
{% block title %}Admin-Benutzer{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="d-flex justify-content-between align-items-start mb-4">
|
|
<div>
|
|
<h1><i class="bi bi-shield-lock me-2"></i>Admin-Benutzer</h1>
|
|
<p class="text-muted">{{ admin_users|length }} Administratoren</p>
|
|
</div>
|
|
<a href="{{ url_for('admin.create_admin') }}" class="btn btn-danger">
|
|
<i class="bi bi-plus-lg me-1"></i>
|
|
Neuer Admin
|
|
</a>
|
|
</div>
|
|
|
|
<div class="card bg-dark border-secondary">
|
|
<div class="card-body p-0">
|
|
<div class="table-responsive">
|
|
<table class="table table-dark table-hover mb-0">
|
|
<thead>
|
|
<tr>
|
|
<th>Benutzername</th>
|
|
<th>Name</th>
|
|
<th>E-Mail</th>
|
|
<th>Erstellt</th>
|
|
<th>Letzter Login</th>
|
|
<th class="text-center">Status</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for admin in admin_users %}
|
|
<tr>
|
|
<td>
|
|
<strong>{{ admin.username }}</strong>
|
|
{% if admin.id == g.admin_user.id %}
|
|
<span class="badge bg-info ms-1">Sie</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ admin.name }}</td>
|
|
<td>
|
|
{% if admin.email %}
|
|
<a href="mailto:{{ admin.email }}" class="text-info text-decoration-none">
|
|
{{ admin.email }}
|
|
</a>
|
|
{% else %}
|
|
<span class="text-muted">-</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ admin.created_at.strftime('%d.%m.%Y') if admin.created_at else '-' }}</td>
|
|
<td>
|
|
{% if admin.last_login_at %}
|
|
{{ admin.last_login_at.strftime('%d.%m.%Y %H:%M') }}
|
|
{% else %}
|
|
<span class="text-muted">Noch nie</span>
|
|
{% endif %}
|
|
</td>
|
|
<td class="text-center">
|
|
{% if admin.is_active %}
|
|
<span class="badge bg-success">Aktiv</span>
|
|
{% else %}
|
|
<span class="badge bg-secondary">Inaktiv</span>
|
|
{% endif %}
|
|
</td>
|
|
<td class="text-end">
|
|
{% if admin.id != g.admin_user.id %}
|
|
<form action="{{ url_for('admin.toggle_admin_status', admin_id=admin.id) }}"
|
|
method="POST" class="d-inline">
|
|
{% if admin.is_active %}
|
|
<button type="submit" class="btn btn-sm btn-outline-warning"
|
|
title="Deaktivieren"
|
|
onclick="return confirm('Admin {{ admin.username }} deaktivieren?')">
|
|
<i class="bi bi-pause-circle"></i>
|
|
</button>
|
|
{% else %}
|
|
<button type="submit" class="btn btn-sm btn-outline-success"
|
|
title="Aktivieren">
|
|
<i class="bi bi-play-circle"></i>
|
|
</button>
|
|
{% endif %}
|
|
</form>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|