admin: add delete user with confirmation dialog

This commit is contained in:
2026-04-22 21:27:37 +02:00
parent ee05ad7511
commit b1bb205d55
4 changed files with 57 additions and 0 deletions

View File

@@ -69,6 +69,15 @@ templ AdminUsersList(users []database.User) {
>
View
</a>
<button
hx-delete={ templ.URL(fmt.Sprintf("/admin/users/%s/delete", user.ID)) }
hx-target="#users-list"
hx-swap="outerHTML"
hx-confirm={ fmt.Sprintf("Are you sure you want to delete %s? This cannot be undone.", user.Username) }
class="rounded bg-(--surface-button) px-3 py-1 text-xs text-(--danger) opacity-80 transition-opacity duration-150 hover:opacity-100"
>
Delete
</button>
</div>
</div>
}