Files
wizarr/app/templates/settings/admins.html
2025-10-07 11:04:58 +02:00

73 lines
4.4 KiB
HTML

<div id="create-admin-modal"></div>
<section class="py-8 animate__animated animate__fadeIn">
<div class="container px-4 mx-auto">
<h1 class="text-2xl font-bold mb-6 text-gray-900 dark:text-white">{{ _("Administrators") }}</h1>
<div class="grid grid-cols-1 gap-4 animate__animated" id="admins_grid">
{% for a in admins %}
<div class="flex items-center justify-between bg-white dark:bg-gray-800 rounded-lg shadow-xs p-4 border border-gray-200 dark:border-gray-700"
data-admin-id="{{ a.id }}">
<div class="flex items-center gap-3">
<svg class="w-6 h-6 text-gray-500 dark:text-gray-400"
xmlns="http://www.w3.org/2000/svg"
fill="currentColor"
viewBox="0 0 24 24">
<path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" />
</svg>
<span class="text-gray-900 dark:text-white font-medium">{{ a.username }}</span>
</div>
<div class="space-x-2">
<button hx-get="{{ url_for('admin_accounts.admin_passkeys', admin_id=a.id) }}"
hx-target="#create-admin-modal"
hx-trigger="click"
_="on htmx:afterOnLoad wait 10ms then remove .hidden to #modal"
class="inline-flex items-center justify-center p-2 text-blue-600 rounded-lg hover:text-blue-800 hover:bg-blue-100 dark:text-blue-400 dark:hover:text-blue-300 dark:hover:bg-blue-900"
title="{{ _('Manage Passkeys') }}">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z">
</path>
</svg>
</button>
<button hx-get="{{ url_for('admin_accounts.edit_admin', admin_id=a.id) }}"
hx-target="#create-admin-modal"
hx-trigger="click"
_="on htmx:afterOnLoad wait 10ms then remove .hidden to #modal"
class="inline-flex items-center justify-center p-2 text-gray-800 rounded-lg hover:text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:text-white dark:hover:bg-gray-600">
<svg class="w-5 h-5"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z">
</path>
</svg>
</button>
<button hx-delete="{{ url_for("admin_accounts.delete_admin") }}?delete={{ a.id }}"
hx-target="#tab-body"
hx-swap="innerHTML swap:0.5s"
hx-confirm="Are you sure you wish to delete {{ a.username }} ?"
class="inline-flex items-center justify-center p-2 text-red-500 rounded-lg hover:text-white hover:bg-red-500 dark:text-red-400 dark:hover:text-white dark:hover:bg-red-600">
<svg class="w-5 h-5"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd">
</path>
</svg>
</button>
</div>
</div>
{% else %}
<p class="text-gray-500 dark:text-gray-400">{{ _("No administrators yet.") }}</p>
{% endfor %}
</div>
<div class="flex items-center justify-center mt-6">
<button hx-get="{{ url_for('admin_accounts.create_admin') }}"
hx-target="#create-admin-modal"
hx-trigger="click"
_="on htmx:afterOnLoad wait 10ms then remove .hidden to #modal"
class="bg-primary hover:bg-amber-700 focus:ring-4 focus:outline-hidden focus:ring-amber-300 text-white font-medium rounded-lg px-5 py-2.5 text-sm dark:bg-primary dark:hover:bg-amber-700 dark:focus:ring-primary_hover">
{{ _("Add Admin") }}
</button>
</div>
</div>
</section>