camper/web/templates/admin/user/index.gohtml
jordi fita mas 26cc46c7b0 Add breadcrumb to all admin pages
I tried to use ../, and ../../ to make the routes relatives, but it
would not work well because the same page would have two URLs, one
ending with slash and another without, and the relative links would be
different on each case.
2024-01-21 22:44:04 +01:00

45 lines
1.5 KiB
Plaintext

<!--
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
SPDX-License-Identifier: AGPL-3.0-only
-->
{{ define "title" -}}
{{( pgettext "Users" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/user.userIndex*/ -}}
<a href="/admin/users/new">{{( pgettext "Add User" "action" )}}</a>
<a href="/admin/users/login-attempts">{{( pgettext "Logs" "action" )}}</a>
<h2>{{( pgettext "Users" "title" )}}</h2>
<table>
<thead>
<tr>
<th scope="col">{{( pgettext "Name" "header" )}}</th>
<th scope="col">{{( pgettext "Email" "header" )}}</th>
<th scope="col">{{( pgettext "Role" "header" )}}</th>
<th scope="col">{{( pgettext "Actions" "header" )}}</th>
</tr>
</thead>
<tbody>
{{ $confirm := ( gettext "Are you sure you wish to delete this user?" )}}
{{ range .Users -}}
<tr>
<td><a href="{{ .URL }}">{{ .Name }}</a></td>
<td><a href="{{ .URL }}">{{ .Email }}</a></td>
<td>{{( pgettext .Role "role" )}}</td>
<td>
<button data-hx-delete="{{ .URL }}"
data-hx-confirm="{{ $confirm }}"
data-hx-headers='{ {{ CSRFHeader }} }'>
{{( pgettext "Delete" "action" )}}
</button>
</td>
</tr>
{{- end }}
</tbody>
</table>
{{- end }}