whatapp-go-pvnet/frontend/templates/admin_users.pages.tmpl
2025-05-09 17:09:51 +02:00

40 lines
1.1 KiB
Cheetah
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{ define "admin_users.pages.tmpl" }}
<h1 class="title">Gestion des utilisateurs</h1>
{{ template "head" . }}
<button class="button is-primary"
hx-get="/admin/user/new"
hx-target="#editForm"
hx-swap="innerHTML">
Créer un utilisateur
</button>
<table class="table is-fullwidth is-striped">
<thead>
<tr>
<th>ID</th>
<th>Email</th>
<th>Role</th>
<th>Actif</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="userList">
{{ range .Users }}
<tr>
<td>{{ .ID }}</td>
<td>{{ .Email }}</td>
<td>{{ .Role }}</td>
<td>{{ if .IsActive }}✅{{ else }}❌{{ end }}</td>
<td>
<button class="button is-small is-info" hx-get="/admin/user/{{ .ID }}/edit" hx-target="#editForm" hx-swap="innerHTML">✏️ Modifier</button>
<button class="button is-small is-danger" hx-delete="/api/user/delete/{{ .ID }}" hx-confirm="Confirmer suppression ?" hx-target="#userList" hx-swap="outerHTML">🗑️ Supprimer</button>
</td>
</tr>
{{ end }}
</tbody>
</table>
<hr>
<div id="editForm"></div>
{{ end }}