46 lines
1.8 KiB
HTML
46 lines
1.8 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<div style="font-family:'Silkscreen',monospace; font-size:14px; color:#d4879c; margin-bottom:16px; text-transform:uppercase;">
|
|
<a href="/admin" style="color:#888;">admin</a> :: users
|
|
</div>
|
|
|
|
{% for u in users %}
|
|
<div class="post" {% if u.banned %}style="border-color:#ff6b6b;"{% endif %}>
|
|
<div style="display:flex; justify-content:space-between; align-items:center;">
|
|
<div>
|
|
<a href="/profile/{{ u.username }}" style="color:#e0e0e0;">{{ u.username }}</a>
|
|
<span style="color:#888; font-size:10px; margin-left:8px;">{{ u.email }}</span>
|
|
{% if u.role == "admin" %}
|
|
<span style="color:#ffd700; font-size:10px; margin-left:8px;">[admin]</span>
|
|
{% endif %}
|
|
{% if u.banned %}
|
|
<span style="color:#ff6b6b; font-size:10px; margin-left:8px;">[banned]</span>
|
|
{% endif %}
|
|
{% if !u.email_verified %}
|
|
<span style="color:#888; font-size:10px; margin-left:8px;">[unverified]</span>
|
|
{% endif %}
|
|
</div>
|
|
<div style="display:flex; gap:8px;">
|
|
{% if !u.banned %}
|
|
<a href="/admin/users/{{ u.id }}/ban" class="btn btn-sm">ban</a>
|
|
{% else %}
|
|
<form method="post" action="/admin/users/{{ u.id }}/unban" style="display:inline;">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
<button type="submit" class="btn btn-sm">unban</button>
|
|
</form>
|
|
{% endif %}
|
|
<form method="post" action="/admin/users/{{ u.id }}/toggle-role" style="display:inline;">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
<button type="submit" class="btn btn-sm">{% if u.role == "admin" %}demote{% else %}promote{% endif %}</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
|
|
{% if users.is_empty() %}
|
|
<div style="color:#888;">no users found</div>
|
|
{% endif %}
|
|
{% endblock %}
|