2024-03-11 21:08:27 +01:00
|
|
|
{{define "page-content"}}
|
2024-11-01 16:31:47 +01:00
|
|
|
<h2>{{.Title}}</h2>
|
|
|
|
|
|
|
|
<form class="flex flex-col gap-4" hx-encoding="multipart/form-data">
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
|
|
{{template "profile-pic-template" .}}
|
2024-04-07 18:57:03 +02:00
|
|
|
|
2024-04-01 14:22:59 +02:00
|
|
|
<div>
|
|
|
|
<label for="username">Benutzername</label>
|
2024-11-01 16:31:47 +01:00
|
|
|
<input class="w-full" required name="username" type="text" {{if lt .Role 4}}value="{{.UserName}}" {{end}} />
|
2024-04-01 14:22:59 +02:00
|
|
|
</div>
|
2024-04-09 19:06:29 +02:00
|
|
|
|
2024-04-01 14:22:59 +02:00
|
|
|
<div>
|
2024-11-01 16:31:47 +01:00
|
|
|
<label for="password">Passwort</label>
|
|
|
|
<input class="w-full" required name="password" placeholder="***" type="password" />
|
2024-04-01 14:22:59 +02:00
|
|
|
</div>
|
2024-04-09 19:06:29 +02:00
|
|
|
|
2024-04-01 14:22:59 +02:00
|
|
|
<div>
|
2024-11-01 16:31:47 +01:00
|
|
|
<label for="password2">Passwort wiederholen</label>
|
|
|
|
<input class="w-full" required name="password2" placeholder="***" type="password" />
|
2024-04-01 14:22:59 +02:00
|
|
|
</div>
|
2024-04-09 19:06:29 +02:00
|
|
|
|
2024-04-01 14:22:59 +02:00
|
|
|
<div>
|
2024-11-01 16:31:47 +01:00
|
|
|
<label for="first-name">Vorname</label>
|
|
|
|
<input class="w-full" required name="first-name" type="text" {{if lt .Role 4}}value="{{.FirstName}}"
|
|
|
|
{{end}} />
|
2024-04-01 14:22:59 +02:00
|
|
|
</div>
|
2024-04-09 19:06:29 +02:00
|
|
|
|
2024-04-01 14:22:59 +02:00
|
|
|
<div>
|
2024-11-01 16:31:47 +01:00
|
|
|
<label for="last-name">Nachname</label>
|
|
|
|
<input class="w-full" required name="last-name" type="text" {{if lt .Role 4}}value="{{.LastName}}"
|
|
|
|
{{end}} />
|
2024-04-01 14:22:59 +02:00
|
|
|
</div>
|
2024-10-27 14:43:38 +01:00
|
|
|
|
|
|
|
<div>
|
|
|
|
<label for="email">Emailadresse</label>
|
2024-11-01 16:31:47 +01:00
|
|
|
<input class="w-full" required name="email" type="text" {{if lt .Role 4}}value="{{.Email}}" {{end}} />
|
2024-10-27 14:43:38 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<label for="email2">Emailadresse wiederholen</label>
|
2024-11-01 16:31:47 +01:00
|
|
|
<input class="w-full" required name="email2" type="text" {{if lt .Role 4}}value="{{.Email}}" {{end}} />
|
2024-10-27 14:43:38 +01:00
|
|
|
</div>
|
2024-03-28 08:41:38 +01:00
|
|
|
</div>
|
2024-03-11 21:08:27 +01:00
|
|
|
|
2024-11-01 16:31:47 +01:00
|
|
|
{{if lt .Role 4}}
|
2024-09-09 22:03:31 +02:00
|
|
|
<div class="flex flex-wrap gap-4">
|
2024-04-09 19:06:29 +02:00
|
|
|
<div>
|
2024-11-01 16:31:47 +01:00
|
|
|
<input required id="author" name="role" type="radio" value="3" {{if eq .Role 3}}checked{{end}} />
|
2024-04-09 19:06:29 +02:00
|
|
|
<label for="author">Autor</label>
|
|
|
|
</div>
|
|
|
|
<div>
|
2024-11-01 16:31:47 +01:00
|
|
|
<input required id="editor" name="role" type="radio" value="2" {{if eq .Role 2}}checked{{end}} />
|
2024-04-09 19:06:29 +02:00
|
|
|
<label for="editor">Redakteur</label>
|
|
|
|
</div>
|
|
|
|
<div>
|
2024-11-01 16:31:47 +01:00
|
|
|
<input required id="publisher" name="role" type="radio" value="1" {{if eq .Role 1}}checked{{end}} />
|
2024-04-09 19:06:29 +02:00
|
|
|
<label for="publisher">Herausgeber</label>
|
|
|
|
</div>
|
|
|
|
<div>
|
2024-11-01 16:31:47 +01:00
|
|
|
<input required id="admin" name="role" type="radio" value="0" {{if eq .Role 0}}checked{{end}} />
|
2024-04-12 08:46:34 +02:00
|
|
|
<label for="admin">Administrator</label>
|
2024-04-09 19:06:29 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-11-01 16:31:47 +01:00
|
|
|
{{end}}
|
2024-04-09 19:06:29 +02:00
|
|
|
|
2024-04-01 14:22:59 +02:00
|
|
|
<div class="btn-area">
|
2024-11-01 16:31:47 +01:00
|
|
|
<input class="action-btn" type="submit" value="{{.ButtonText}}" hx-post="{{.URL}}" hx-target="#page-content" />
|
2024-04-03 20:24:54 +02:00
|
|
|
<button class="btn" hx-get="/hub" hx-target="#page-content">Abbrechen</button>
|
2024-03-28 08:41:38 +01:00
|
|
|
</div>
|
2024-03-11 21:08:27 +01:00
|
|
|
</form>
|
|
|
|
{{end}}
|
2024-11-01 16:31:47 +01:00
|
|
|
|
|
|
|
{{define "profile-pic-template"}}
|
|
|
|
<div class="flex items-center justify-center row-span-3 self-center" id="profile-pic-container">
|
|
|
|
<label
|
|
|
|
class="bg-slate-200 dark:bg-slate-800 hover:bg-slate-100 dark:hover:bg-slate-900 border border-slate-200 dark:border-slate-800 cursor-pointer flex flex-col h-48 items-center justify-center overflow-hidden rounded-full w-48"
|
|
|
|
for="upload-profile-pic">
|
|
|
|
{{if gt (len .Image) 0}}
|
|
|
|
<img src="/image/serve/{{.Image}}" alt="" />
|
|
|
|
{{else}}
|
|
|
|
<span class="text-2xl">+</span>
|
|
|
|
<span>Profilbild</span>
|
|
|
|
{{end}}
|
|
|
|
</label>
|
|
|
|
<input class="hidden" id="upload-profile-pic" name="upload-profile-pic" type="file"
|
|
|
|
hx-post="/user/upload-profile-pic" hx-swap="outerHTML" hx-target="#profile-pic-container" />
|
|
|
|
<input id="profile-pic-url" name="profile-pic-url" type="hidden" value="{{.Image}}" />
|
|
|
|
</div>
|
|
|
|
{{end}}
|