61 lines
2.5 KiB
HTML
61 lines
2.5 KiB
HTML
{% extends "admin/layouts/base.html" %}
|
|
{% block title %}System Users{% endblock %}
|
|
{% block content %}
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h4 class="fw-bold mb-0"><i class="bi bi-people me-2"></i>System Users</h4>
|
|
<a href="{{ url_for('system_users.create') }}" class="btn btn-dark btn-sm">
|
|
<i class="bi bi-plus-lg me-1"></i>New User
|
|
</a>
|
|
</div>
|
|
<div class="card shadow-sm">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover mb-0">
|
|
<thead class="table-dark">
|
|
<tr>
|
|
<th>Email</th><th>Name</th><th>Role</th><th>Status</th>
|
|
<th>Last Login</th><th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for u in users %}
|
|
<tr>
|
|
<td>{{ u.email }}</td>
|
|
<td>{{ u.name }}</td>
|
|
<td><span class="badge bg-secondary">{{ u.role }}</span></td>
|
|
<td>
|
|
{% if u.is_active %}
|
|
<span class="badge bg-success">Active</span>
|
|
{% else %}
|
|
<span class="badge bg-danger">Inactive</span>
|
|
{% endif %}
|
|
{% if u.is_locked() %}
|
|
<span class="badge bg-warning text-dark">Locked</span>
|
|
{% endif %}
|
|
</td>
|
|
<td class="text-muted small">
|
|
{{ u.last_login_at.strftime('%Y-%m-%d %H:%M') if u.last_login_at else 'Never' }}
|
|
</td>
|
|
<td>
|
|
<a href="{{ url_for('system_users.edit', user_id=u.id) }}" class="btn btn-outline-secondary btn-sm">Edit</a>
|
|
<form method="POST" action="{{ url_for('system_users.toggle_active', user_id=u.id) }}" class="d-inline"
|
|
onsubmit="return confirm('Toggle active status?')">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<button class="btn btn-outline-{{ 'danger' if u.is_active else 'success' }} btn-sm">
|
|
{{ 'Deactivate' if u.is_active else 'Activate' }}
|
|
</button>
|
|
</form>
|
|
<form method="POST" action="{{ url_for('system_users.force_password_reset', user_id=u.id) }}" class="d-inline"
|
|
onsubmit="return confirm('Send password reset email?')">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
<button class="btn btn-outline-warning btn-sm">Reset PW</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="6" class="text-center text-muted py-4">No system users found.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% endblock %} |