38 lines
2.1 KiB
HTML
38 lines
2.1 KiB
HTML
{{define "content"}}
|
|
<div class="md:flex md:items-center md:justify-between mb-8">
|
|
<div class="min-w-0 flex-1">
|
|
<h2 class="text-2xl font-bold leading-7 text-gray-900 sm:truncate sm:text-3xl sm:tracking-tight">Users</h2>
|
|
</div>
|
|
<div class="mt-4 flex md:ml-4 md:mt-0">
|
|
<a href="/users/new" class="ml-3 inline-flex items-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">New User</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="overflow-hidden bg-white shadow sm:rounded-lg">
|
|
<table class="min-w-full divide-y divide-gray-300">
|
|
<thead class="bg-gray-50">
|
|
<tr>
|
|
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Username</th>
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Role</th>
|
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Created At</th>
|
|
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-6">
|
|
<span class="sr-only">Actions</span>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-200 bg-white">
|
|
{{range .Users}}
|
|
<tr>
|
|
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6">{{.Username}}</td>
|
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{.Role}}</td>
|
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{.CreatedAt | formatDateTime}}</td>
|
|
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6">
|
|
<button hx-delete="/users/{{.ID}}" hx-confirm="Are you sure you want to delete this user?" class="text-red-600 hover:text-red-900">Delete</button>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{{end}}
|