blog/root/initial-setup.gohtml
Noah Petherbridge 6d3de7da69 Let me use interface{} for template vars
Since most of the `render.Vars{}` fields were hardcoded/not really
editable for the templates, apart from .Data, this struct is now locked
away in the render subpackage.

End http.HandlerFunc's can then make any arbitrary template data
structure they want to, available inside the templates as `.Data`.
2018-02-10 14:05:41 -08:00

52 lines
1.7 KiB
Plaintext

{{ define "title" }}Initial Setup{{ end }}
{{ define "content" }}
<h1>Initial Setup</h1>
<p>
Welcome to your new web blog! To get started, you'll need to create a username
and password to be your <strong>admin user</strong>. You can create additional
users for your blog in a later step.
</p>
<p>
It is not recommended to name this user "admin" because that would be very
predictable for an attacker to guess.
</p>
{{ $form := .Data.Form }}
<form method="POST" action="/initial-setup">
<input type="hidden" name="_csrf" value="{{ .CSRF }}">
<div class="form-group">
<label for="setup-admin-username">Admin username:</label>
<input type="text"
name="username"
class="form-control"
id="setup-admin-username"
placeholder="Enter username"
value="{{ $form.Username }}">
</div>
<div class="form-group">
<label for="setup-admin-password1">Passphrase:</label>
<input type="password"
name="password"
class="form-control"
id="setup-admin-password1"
placeholder="correct horse battery staple"
aria-describedby="setup-password-help">
<small id="setup-password-help" class="form-text text-muted">
Choose an <a href="https://xkcd.com/936/" target="_blank">appropriately strong</a> password.
</small>
</div>
<div class="form-group">
<label for="setup-admin-password2">Confirm:</label>
<input type="password"
name="confirm"
class="form-control"
id="setup-admin-password2"
placeholder="correct horse battery staple">
</div>
<button type="submit" class="btn btn-primary">Continue</button>
</form>
{{ end }}