pcmt/templates/manage/user-new.tmpl
leo 547f6e7b3c
All checks were successful
continuous-integration/drone/push Build is passing
add user creation
2023-05-22 06:47:33 +02:00

89 lines
4.6 KiB
Go HTML Template

{{ template "head.tmpl" . }}
<body class="min-h-screen bg-white dark:bg-gray-900">
{{ template "navbar.tmpl" . }}
<main class="grow min-w-[300px]">
<section class="bg-white dark:bg-gray-900">
<div class="container mx-auto md:mx-4 px-6 sm:px-0:py-0 md:py-16 lg:py-32">
<div class="lg:flex">
<div class="lg:w-1/2">
<h1 class="mt-4 text-2xl font-medium text-gray-800 capitalize lg:text-3xl dark:text-white">
Create new user
</h1>
{{ if and .Data .Data.flash }}
<h2 class="text-xl text-pink-600 dark:text-pink-500 capitalize py-2">
{{- .Data.flash -}}
</h2>
{{- end }}
</div>
<div class="mt-8 lg:w-1/2 lg:mt-0">
<form method="post" action="/manage/users/create" class="w-full lg:max-w-xl">
<input type="hidden" name="_csrf" value="{{- .CSRF -}}">
<div class="relative flex items-center">
<span class="absolute" role="img" aria-label="person outline icon for username">
{{ template "svg-user.tmpl" }}
</span>
<input name="username" type="text" {{if and .Data.form .Data.form.Username}}value="{{.Data.form.Username}}"{{end}} placeholder="Username" required class="block w-full py-3 valid:border-green-300 required:border-blue-300 text-gray-700 bg-white border rounded-lg px-11 dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 focus:border-blue-400 dark:focus:border-blue-300 focus:ring-blue-300 focus:outline-none focus:ring focus:ring-opacity-40">
</div>
<div class="relative flex items-center mt-4">
<span class="absolute" role="img" aria-label="email icon">
{{ template "svg-email.tmpl" }}
</span>
<input name="email" type="email" {{if and .Data.form .Data.form.Email}}value="{{.Data.form.Email}}"{{end}} placeholder="Email address" required class="peer block w-full px-10 py-3 required:border-blue-300 text-gray-700 bg-white border rounded-lg dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 focus:border-blue-400 dark:focus:border-blue-300 focus:ring-blue-300 focus:outline-none focus:ring focus:ring-opacity-40">
<p class="mt-2 mx-4 peer-placeholder-shown:collapse peer-invalid:block text-pink-600 text-sm">
Please provide a valid email address.
</p>
</div>
<div class="relative flex items-center mt-4">
<span class="absolute" role="img" aria-label="password lock icon">
{{ template "svg-password.tmpl" }}
</span>
<input name="password" type="password" {{if and .Data.form .Data.form.Password}}value="{{.Data.form.Password}}"{{end}} placeholder="Password" required class="block w-full px-10 py-3 required:border-blue-300 text-gray-700 bg-white border rounded-lg dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 focus:border-blue-400 dark:focus:border-blue-300 focus:ring-blue-300 focus:outline-none focus:ring focus:ring-opacity-40">
</div>
<div class="relative flex items-center mt-4">
<span class="absolute" role="img" aria-label="password lock icon">
{{ template "svg-password.tmpl" }}
</span>
<input name="repeatPassword" type="password" {{if and .Data.form .Data.form.RepeatPassword}}value="{{.Data.form.RepeatPassword}}"{{end}} placeholder="Repeat Password" required class="block w-full px-10 py-3 required:border-blue-300 text-gray-700 bg-white border rounded-lg dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 focus:border-blue-400 dark:focus:border-blue-300 focus:ring-blue-300 focus:outline-none focus:ring focus:ring-opacity-40">
</div>
<div class="flex pt-2 px-2 items-center justify-center gap-6">
<div class="mb-1 block min-h-3">
<input
type="checkbox"
value="true"
id="isAdmin"
name="isAdmin"
/>
<label
class="inline-block pl-1 hover:cursor-pointer text-gray-700 dark:text-gray-300"
for="isAdmin">
Is admin?
</label>
</div>
<div class="mb-1 block min-h-3">
<input
type="checkbox"
value="true"
id="isActive"
name="isActive"
/>
<label
class="inline-block pl-1 hover:cursor-pointer text-gray-700 dark:text-gray-300"
for="isActive">
Is active?
</label>
</div>
</div>
<div class="mt-8 md:flex md:items-center">
<button class="w-full px-6 py-3 text-sm font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-blue-500 rounded-lg md:w-1/2 hover:bg-blue-400 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-50">
Create
</button>
</div>
</form>
</div>
</div>
</div>
</section>
</main>
{{ template "footer.tmpl" . }}