whatapp-go-pvnet/frontend/templates/admin_users.pages.tmpl

40 lines
1.1 KiB
Cheetah
Raw Normal View History

2025-05-09 08:14:22 +00:00
{{ define "admin_users.pages.tmpl" }}
<h1 class="title">Gestion des utilisateurs</h1>
2025-05-09 15:09:51 +00:00
{{ template "head" . }}
2025-05-09 08:14:22 +00:00
<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 }}