pcmt/templates/manage/user-details.tmpl

86 lines
4.5 KiB
Go HTML Template

{{ template "head.tmpl" . }}
<body class="h-screen bg-white dark:bg-gray-900">
{{ template "navbar.tmpl" . }}
<main class="grow">
<div class="container mx-auto place-items-center px-8 md:px-12 lg:px-14">
{{ if and .Data .Data.flash }}
<h1 class="text-xl text-pink-600 dark:text-pink-500 py-2">
{{ .Data.flash }}
</h1>
{{- end }}
<div class="flex justify-between place-items-center">
<h1 class="text-xl font-bold text-fuchsia-600 dark:text-fuchsia-400 capitalize py-2">
User details
</h1>
<a href="/manage/users" class="w-auto py-1 mt-2 text-center text-blue-500 md:mt-0 md:mx-6 lg:mx-4 hover:underline dark:text-blue-400">
⏎ All users
</a>
</div>
{{if and .Data .Data.user -}}
<div class="flex justify-end gap-2 lg:gap-0 place-items-center">
<a href="/manage/users/{{- .Data.user.ID -}}/edit" class="w-auto py-1 mt-0 text-center text-blue-500 dark:text-blue-400 md:mx-2 lg:mx-4 hover:underline hover:text-blue-600 dark:hover:text-blue-300">
Edit
</a>
<a href="/manage/users/{{- .Data.user.ID -}}/delete" class="w-auto py-1 mt-0 text-center text-pink-600 dark:text-pink-600 md:mr-6 lg:mr-4 hover:underline hover:text-pink-700 dark:hover:text-pink-400">
Delete
</a>
</div>
<div class="p-2 mt-3 lg:mx-auto border-2 dark:border-slate-500 rounded-sm space-y-0">
<div class="flex max-h-14 place-items-baseline justify-left lg:justify-between overflow-x-auto text-ellipsis hover:bg-gray-100 dark:hover:bg-gray-700">
<span class="w-24 md:w-32 px-2 text-purple-500 dark:text-purple-300">ID:</span>
<span class="text-lg text-fuchsia-500 dark:text-fuchsia-400 px-2 overflow-x-auto text-ellipsis select-all">
{{- .Data.user.ID -}}
</span>
</div><!-- id -->
<div class="flex place-items-center justify-left lg:justify-between overflow-x-auto text-ellipsis hover:bg-gray-100 dark:hover:bg-gray-700">
<span class="w-24 md:w-32 px-2 text-purple-500 dark:text-purple-300">Username:</span>
<span class="text-lg text-fuchsia-500 dark:text-fuchsia-400 px-2">
{{- .Data.user.Username -}}
</span>
</div><!-- username -->
<div class="flex place-items-center justify-left lg:justify-between overflow-x-auto text-ellipsis hover:bg-gray-100 dark:hover:bg-gray-700">
<span class="w-24 md:w-32 px-2 text-purple-500 dark:text-purple-300">Email:</span>
<span class="text-lg text-fuchsia-500 dark:text-fuchsia-400 px-2">
{{- .Data.user.Email -}}
</span>
</div><!-- email -->
<div class="flex place-items-center justify-left lg:justify-between overflow-x-auto text-ellipsis hover:bg-gray-100 dark:hover:bg-gray-700">
<span class="w-24 md:w-32 px-2 text-purple-500 dark:text-purple-300">Admin:</span>
<span class="text-lg text-fuchsia-500 dark:text-fuchsia-400 px-2">
{{- .Data.user.IsAdmin -}}
</span>
</div><!-- isAdmin -->
<div class="flex place-items-center justify-left lg:justify-between overflow-x-auto text-ellipsis hover:bg-gray-100 dark:hover:bg-gray-700">
<span class="w-24 md:w-32 px-2 text-purple-500 dark:text-purple-300">Active:</span>
<span class="text-lg text-fuchsia-500 dark:text-fuchsia-400 px-2">
{{- .Data.user.IsActive -}}
</span>
</div><!-- isActive -->
<div class="flex place-items-center justify-left lg:justify-between overflow-x-auto text-ellipsis hover:bg-gray-100 dark:hover:bg-gray-700">
<span class="w-24 md:w-32 px-2 text-purple-500 dark:text-purple-300">Last login:</span>
<span class="text-lg text-fuchsia-500 dark:text-fuchsia-400 px-2">
{{ if usrFinishedSetup .Data.user.LastLogin }}
{{- .Data.user.LastLogin -}}
{{- else -}}
never
{{- end -}}
</span>
</div><!-- updated -->
<div class="flex place-items-center justify-left lg:justify-between overflow-x-auto text-ellipsis hover:bg-gray-100 dark:hover:bg-gray-700">
<span class="w-24 md:w-32 px-2 text-purple-500 dark:text-purple-300">Created:</span>
<span class="text-lg text-fuchsia-500 dark:text-fuchsia-400 px-2">
{{- .Data.user.CreatedAt -}}
</span>
</div><!-- created -->
<div class="flex place-items-center justify-left lg:justify-between overflow-x-auto text-ellipsis hover:bg-gray-100 dark:hover:bg-gray-700">
<span class="w-24 md:w-32 px-2 text-purple-500 dark:text-purple-300">Updated:</span>
<span class="text-lg text-fuchsia-500 dark:text-fuchsia-400 px-2">
{{- .Data.user.UpdatedAt -}}
</span>
</div><!-- updated -->
</div>
{{- end -}}
</div>
</main>
{{ template "footer.tmpl" . }}