cpolis/web/templates/add-user.html

29 lines
1.2 KiB
HTML
Raw Permalink Normal View History

2024-02-24 10:28:12 +01:00
{{define "page-content"}}
<h2>Neuer Benutzer</h2>
2024-02-24 10:28:12 +01:00
<form>
2024-03-01 12:25:53 +01:00
<input required name="username" placeholder="Benutzername" type="text" value="{{.UserName}}" />
<input required name="password" placeholder="Passwort" type="password" />
<input required name="password2" placeholder="Passwort wiederholen" type="password" />
2024-02-24 10:28:12 +01:00
2024-03-01 12:25:53 +01:00
<input required name="first-name" placeholder="Vorname" type="text" value="{{.FirstName}}" />
<input required name="last-name" placeholder="Nachname" type="text" value="{{.LastName}}" />
2024-02-24 10:28:12 +01:00
2024-03-03 13:56:49 +01:00
<input required id="writer" name="role" type="radio" value="2" {{if eq .Role 2 }}checked{{end}} />
2024-02-24 10:28:12 +01:00
<label for="writer">Schreiber</label>
2024-03-03 13:56:49 +01:00
<input required id="editor" name="role" type="radio" value="1" {{if eq .Role 1 }}checked{{end}} />
2024-02-24 10:28:12 +01:00
<label for="editor">Redakteur</label>
2024-03-03 13:56:49 +01:00
<input required id="admin" name="role" type="radio" value="0" {{if eq .Role 0 }}checked{{end}} />
2024-02-24 10:28:12 +01:00
<label for="admin">Admin</label>
<input type="submit" value="Anlegen" hx-post="/add-user/" hx-target="#page-content" />
</form>
2024-03-03 13:56:49 +01:00
<button hx-get="/hub/" hx-target="#page-content">Abbrechen</button>
<script>
var msg = "{{.Msg}}";
if (msg != "") {
alert(msg);
}
</script>
2024-02-24 10:28:12 +01:00
{{end}}