saasitone/templates/pages/login.gohtml
Mike Stefanello 5ebd42d8f9
Improve form and template usage (#66)
* Improve form and template usage.
2024-06-14 12:35:35 -04:00

28 lines
1.2 KiB
Plaintext

{{define "content"}}
<form method="post" hx-boost="true" action="{{url "login.post"}}">
{{template "messages" .}}
<div class="field">
<label for="email" class="label">Email address</label>
<div class="control">
<input id="email" type="email" name="email" class="input {{.Form.Submission.GetFieldStatusClass "Email"}}" value="{{.Form.Email}}">
{{template "field-errors" (.Form.Submission.GetFieldErrors "Email")}}
</div>
</div>
<div class="field">
<label for="password" class="label">Password</label>
<div class="control">
<input id="password" type="password" name="password" placeholder="*******" class="input {{.Form.Submission.GetFieldStatusClass "Password"}}">
{{template "field-errors" (.Form.Submission.GetFieldErrors "Password")}}
</div>
</div>
<div class="field is-grouped">
<p class="control">
<button class="button is-primary">Log in</button>
</p>
<p class="control">
<a href="{{url "home"}}" class="button is-light">Cancel</a>
</p>
</div>
{{template "csrf" .}}
</form>
{{end}}