forgejo-tickets/web/templates/pages/admin/users/pending.html

49 lines
2.5 KiB
HTML

{{define "title"}}Pending Account Requests{{end}}
{{define "content"}}
<div class="flex items-center justify-between mb-6">
<h1 class="text-2xl font-bold text-gray-900">Pending Account Requests</h1>
<a href="/admin/users" class="text-sm text-blue-600 hover:text-blue-500">&larr; Back to all users</a>
</div>
{{with .Data}}
{{if .Users}}
<div class="overflow-hidden bg-white shadow ring-1 ring-gray-200 rounded-lg">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">Name</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">Email</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">Requested</th>
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase">Actions</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
{{range .Users}}
<tr class="hover:bg-gray-50">
<td class="px-4 py-3 text-sm font-medium text-gray-900">{{.Name}}</td>
<td class="px-4 py-3 text-sm text-gray-500">{{.Email}}</td>
<td class="px-4 py-3 text-sm text-gray-500">{{formatDate .CreatedAt}}</td>
<td class="px-4 py-3 text-right">
<div class="flex justify-end gap-2">
<form method="POST" action="/admin/users/{{.ID}}/approve">
<input type="hidden" name="gorilla.csrf.Token" value="{{$.CSRFToken}}">
<button type="submit" class="rounded-md bg-green-600 px-3 py-1.5 text-xs font-semibold text-white shadow hover:bg-green-500">Approve</button>
</form>
<form method="POST" action="/admin/users/{{.ID}}/reject" onsubmit="return confirm('Are you sure you want to reject this request? The account will be deleted.')">
<input type="hidden" name="gorilla.csrf.Token" value="{{$.CSRFToken}}">
<button type="submit" class="rounded-md bg-red-600 px-3 py-1.5 text-xs font-semibold text-white shadow hover:bg-red-500">Reject</button>
</form>
</div>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
{{else}}
<p class="text-sm text-gray-500">No pending account requests.</p>
{{end}}
{{end}}
{{end}}