45 lines
1.8 KiB
HTML
45 lines
1.8 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
|
<h1 class="h2">{{ _('User Management') }}</h1>
|
|
</div>
|
|
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-sm">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ _('ID') }}</th>
|
|
<th>{{ _('Username') }}</th>
|
|
<th>{{ _('Role') }}</th>
|
|
<th>{{ _('Created At') }}</th>
|
|
<th>{{ _('Actions') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for user in users %}
|
|
<tr>
|
|
<td>{{ user.id }}</td>
|
|
<td>{{ user.username }}</td>
|
|
<td>
|
|
{% if user.is_admin %}
|
|
<span class="badge bg-danger">{{ _('Admin') }}</span>
|
|
{% elif user.is_guest %}
|
|
<span class="badge bg-secondary">{{ _('Guest') }}</span>
|
|
{% else %}
|
|
<span class="badge bg-primary">{{ _('User') }}</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ user.created_at.strftime('%Y-%m-%d %H:%M') }}</td>
|
|
<td>
|
|
<form action="{{ url_for('admin.delete_user', user_id=user.id) }}" method="POST" class="d-inline" onsubmit="return confirm('{{ _('WARNING: Are you sure you want to permanently delete this user AND ALL their uploaded files and G-codes?') }}');">
|
|
<button type="submit" class="btn btn-sm btn-outline-danger" {% if user.id == current_user.id %}disabled{% endif %}>{{ _('Delete') }}</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endblock %}
|