modified: web/blueprints/site_admin.py
modified: web/panel_db.py modified: web/templates/admin/user_edit.html modified: web/templates/admin/users.html
This commit is contained in:
@@ -4,11 +4,77 @@
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h2><i class="bi bi-people-fill me-2"></i>Users</h2>
|
||||
<a href="{{ url_for('site_admin.user_new') }}" class="btn btn-success">
|
||||
<i class="bi bi-person-plus-fill me-1"></i>New User
|
||||
<i class="bi bi-envelope-plus-fill me-1"></i>Invite User
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{# ── Pending Invitations ── #}
|
||||
{% if pending_invites %}
|
||||
<h5 class="text-muted mb-2"><i class="bi bi-envelope-open me-1"></i>Pending Invitations</h5>
|
||||
<div class="card border-warning mb-4">
|
||||
<div class="card-body p-0">
|
||||
<table class="table table-hover mb-0 small">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Username</th>
|
||||
<th>Email</th>
|
||||
<th>Group</th>
|
||||
<th>Role</th>
|
||||
<th>Expires</th>
|
||||
<th>Sent</th>
|
||||
<th class="text-end">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for inv in pending_invites %}
|
||||
<tr>
|
||||
<td class="fw-semibold">{{ inv.invited_username }}</td>
|
||||
<td class="text-muted">{{ inv.invited_email }}</td>
|
||||
<td>
|
||||
{% if inv.group_name %}
|
||||
<span class="badge bg-secondary">{{ inv.group_name }}</span>
|
||||
{% else %}
|
||||
<span class="text-muted">—</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ inv.role }}</td>
|
||||
<td class="text-muted">{{ inv.expires_at | fmt_dt }}</td>
|
||||
<td class="text-muted">{{ inv.send_count }}×</td>
|
||||
<td class="text-end">
|
||||
{# Copy link #}
|
||||
{% set invite_url = url_for('auth.accept_invite', token=inv.token, _external=True) %}
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary"
|
||||
title="Copy invite link"
|
||||
onclick="navigator.clipboard.writeText('{{ invite_url }}').then(()=>this.title='Copied!')">
|
||||
<i class="bi bi-clipboard"></i>
|
||||
</button>
|
||||
{# Resend #}
|
||||
<form method="post" action="{{ url_for('site_admin.user_invite_resend', invite_id=inv.id) }}" class="d-inline">
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-info" title="Resend email">
|
||||
<i class="bi bi-send"></i>
|
||||
</button>
|
||||
</form>
|
||||
{# Revoke #}
|
||||
<form method="post" action="{{ url_for('site_admin.user_invite_revoke', invite_id=inv.id) }}" class="d-inline"
|
||||
onsubmit="return confirm('Revoke invitation for {{ inv.invited_username }}?')">
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger" title="Revoke">
|
||||
<i class="bi bi-x-circle"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card border-secondary">
|
||||
<h5 class="text-muted mb-2"><i class="bi bi-people me-1"></i>Registered Users</h5>
|
||||
<div class="card border-secondary">
|
||||
<div class="card-body p-0">
|
||||
<table class="table table-hover mb-0">
|
||||
<thead>
|
||||
|
||||
Reference in New Issue
Block a user