lishwist/http/templates/login.gotmpl
2026-02-14 12:29:47 +09:00

48 lines
1.4 KiB
Go Template

<!doctype html>
<html>
<head>
{{template "head"}}
</head>
{{with .Elements}}
<body>
<div style="height: 100svh;" class="d-flex flex-column">
{{template "navbar"}}
<div class="container d-flex flex-grow-1 justify-content-center align-items-center flex-column">
{{if .SuccessfulRegistration}}
<div class="alert alert-success" role="alert">
<p class="mb-0">Registration successful. Now you can login.</p>
</div>
{{end}}
{{if .SuccessfulSetPassword}}
<div class="alert alert-success" role="alert">
<p class="mb-0">Set password successfully. You can now login back in.</p>
</div>
{{end}}
{{with .GeneralError}}
<div class="alert alert-danger" role="alert">
<p class="mb-0">{{.}}</p>
</div>
{{end}}
<form method="{{$.Method}}">
<div class="d-flex flex-column">
<label>
{{.Username.Label}}
{{template "input" .Username}}
</label>
<label>
{{.Password.Label}}
{{template "input" .Password}}
</label>
<div class="mb-3">
{{template "hyperlink" .RegisterLink}}
</div>
<button class="btn btn-primary" type="submit">Login</button>
</div>
</form>
</div>
</div>
</body>
{{end}}
</html>