feat: add delete button to admin users list page
Allow admin (not just system) to delete users directly from the list without navigating to the detail page. Also enables role management link and create-user role selector for admin role. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
<label class="form-lbl" for="cu_password">Пароль</label>
|
||||
<input class="inp" type="password" id="cu_password" name="password" required>
|
||||
</div>
|
||||
{% if user.role == 'system' %}
|
||||
{% if user.role in ('system', 'admin') %}
|
||||
<div class="form-row">
|
||||
<label class="form-lbl" for="cu_role">Роль</label>
|
||||
<select class="inp" id="cu_role" name="role">
|
||||
@@ -163,10 +163,15 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><span class="mono" style="font-size:11px;color:#9EA8BE;">{{ u.created_at | datefmt }}</span></td>
|
||||
<td>
|
||||
<td style="white-space:nowrap;">
|
||||
<a href="/admin/users/{{ u.id }}" class="btn btn-outline btn-xs">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
<button type="button" class="btn btn-outline btn-xs" style="color:#E53935;border-color:#F4AEAE;margin-left:4px;"
|
||||
onclick="if(confirm('Удалить пользователя {{ u.first_name }} {{ u.last_name }} ({{ u.email }})?')) { document.getElementById('del-{{ u.id }}').submit(); }">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
<form id="del-{{ u.id }}" method="post" action="/admin/users/{{ u.id }}/delete" style="display:none;"></form>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
@@ -191,7 +196,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if user.role == 'system' %}
|
||||
{% if user.role in ('system', 'admin') %}
|
||||
<div style="margin-top:14px;text-align:right;">
|
||||
<a href="/admin/roles" class="btn btn-outline btn-sm">
|
||||
<i class="bi bi-shield-lock"></i> Управление ролями
|
||||
|
||||
Reference in New Issue
Block a user