Commit 627a4f88 authored by Ed Rooth's avatar Ed Rooth

static: update all templates to be generic

parent 6798adc6
<html>
<body>
Hello!
Welcome to Tectonic! Please verify that your email is {{ .email }} by clicking here:
<a href="{{ .link }}"> Click here to verify!</a>
Love,
Your Pals at CoreOS
<br/>
Please verify that your email is {{ .email }} by clicking here:
<br/>
<br/>
<a href="{{ .link }}">Click here to verify!</a>
</body>
</html>
Hello!
Welcome to Tectonic! Please verify that your email is {{ .email }} by clicking here:
Please verify that your email is {{ .email }} by clicking here:
{{ .link }}
Love,
Your Pals at CoreOS
</div>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<html>
<body>
{{ if .Error }}
<div>
{{ .Message }}
</div>
{{ else }}
<ul>
{{ range $fe := .FormErrors }}
<li>{{ $fe.Field }}: {{ $fe.Error }} </li>
{{ end }}
</ul>
<h2>Please Register </h2>
{{ template "header.html" }}
<div class="panel">
<h2 class="heading">Create Your Account</h2>
{{ if .Error }}
<div class="error-box">{{ .Message }}</div>
{{ else }}
<form id="registerForm" method="POST" action="/register">
<label for="email">Email</label>
<input type="text" name="email" value="{{.Email}}" />
<br>
<!-- The client side should be responsible for making sure password is entered correctly twice -->
<div class="form-row">
<div class="input-desc">
<label for="email">Email Address</label>
</div>
<input id="email" class="input-box" type="text" name="email" required placeholder="email" value="{{.Email}}" autofocus />
{{ range $fe := .FormErrors }}
{{ if eq $fe.Field "email" }}
<div class="error-box-field">{{ $fe.Error }}</div>
{{ end }}
{{ end }}
</div>
{{ if .Local }}
<label for="password">Password</label>
<input type="text" name="password" value="{{.Password}}" />
<br>
<div class="form-row">
<div class="input-desc">
<label for="password">Password</label>
</div>
<input minlength="6" required id="password" name="password" type="password" class="input-box" value="{{.Password}}"/>
{{ range $fe := .FormErrors }}
{{ if eq $fe.Field "password" }}
<div class="error-box-field">{{ $fe.Error }}</div>
{{ end }}
{{ end }}
</div>
{{ end }}
<button type="submit" class="btn btn-primary">Create Account</button>
<input type="hidden" name="code" value="{{.Code}}"/>
<input type="hidden" name="validate" value="1"/>
<button>Submit</submit>
</form>
{{ end }}
</body>
</html>
{{ end }}
</div>
{{ template "footer.html" }}
<html>
<body>
{{ if .Success }}
Yay, you changed your password!
{{ else }}
{{ $lenError := len .Error }}
{{ $hasError := ne $lenError 0 }}
{{ template "header.html" }}
<div class="panel">
{{ if .Success }}
<h2 class="heading">Your password has been reset</h2>
{{ else }}
{{ $lenError := len .Error }}
{{ $hasError := ne $lenError 0 }}
{{ if .DontShowForm }}
{{ if $hasError }}
<h3>
{{ .Error }}
</h3>
<div>
{{ .Message }}
</div>
<div class="heading">{{ .Error }}</div>
<div class="error-box">{{ .Message }}</div>
{{ end }}
{{ else }}
<h2 class="heading">Reset your password</h2>
<form onsubmit="return validate();" id="resetPasswordForm" method="POST" action="/reset-password">
<div class="form-row">
<div class="input-desc">
<label for="password">New Password</label>
</div>
<input minlength="6" required class="input-box" type="password" id="password" name="password" autofocus />
</div>
<div class="form-row">
<div class="input-desc">
<label for="password-confirm">Confirm New Password</label>
</div>
<input minlength="6" required class="input-box" type="password" id="password-confirm" name="password-confirm" />
</div>
{{ if not .DontShowForm }}
<form id="resetPasswordForm" method="POST" action="/reset-password">
<label for="password">Password</label>
<input type="password" name="password" value="" />
<br/>
<button>Submit</button>
<input type="hidden" name="token" value="{{ .Token }}" />
</form>
<div id="js-error" style="display: none;" class="error-box">Passwords do not match</div>
{{ if $hasError }}
<div class="form-row">
<div class="error-box">{{ .Error }}</div>
<div class="explain">{{ .Message }}</div>
</div>
{{ end }}
{{ end }}
<body>
</html>
<button type="submit" class="btn btn-tec">Reset</button>
<input type="hidden" name="token" value="{{ .Token }}" />
</form>
{{ end }}
{{ end }}
</div>
<script>
function validate() {
var p1 = document.getElementById('password'),
p2 = document.getElementById('password-confirm'),
valid = p1 && p2 && p1.value === p2.value;
if (valid) {
hideError();
} else {
showError();
}
return valid;
}
function hideError() {
var e = document.getElementById('js-error');
e.style.display = 'none';
}
function showError() {
var e = document.getElementById('js-error');
e.style.display = 'block';
}
</script>
{{ template "footer.html" }}
<html>
{{ template "header.html" }}
<body>
{{ if .EmailSent }}
<div class="panel">
{{ if .EmailSent }}
<h1>Thank you, please check your email!</h1>
<h2 class="heading">Thank you, please check your email!</h2>
<div class="explain">
{{ .Email }} has been sent an email with instructions to reset your password.
</div>
{{ else }}
{{ else }}
{{ if .Error }}
<div>
{{ .Message }}
<h2 class="heading">Reset your password </h2>
<div class="explain">We will send you an email with a link to reset your password.</div>
<form id="sendResetPasswordForm" method="POST" action="/send-reset-password">
<div class="form-row">
<div class="input-desc">
<label for="email">Email Address</label>
</div>
<input required id="email" class="input-box" type="text" name="email" placeholder="email" value="" autofocus />
</div>
{{ if .Error }}
<div class="error-box">{{ .Message }}</div>
{{ end }}
<h2>Reset Your Password </h2>
<P>We will send you an email with a link to reset your password.</p>
<form id="sendResetPasswordForm" method="POST" action="/send-reset-password">
<label for="email">Email</label>
<input type="text" name="email" value="" />
<br/>
<button>Submit</button>
<input type="hidden" name="redirect_uri" value="{{ .RedirectURL }}" />
<input type="hidden" name="client_id" value="{{ .ClientID }}" />
</form>
{{ end }}
</body>
</html>
<button type="submit" class="btn btn-primary">Send Reset Link</button>
<input type="hidden" name="redirect_uri" value="{{ .RedirectURL }}" />
<input type="hidden" name="client_id" value="{{ .ClientID }}" />
</form>
{{ end }}
</div>
{{ template "footer.html" }}
<html>
<body>
<h3>
{{ .Error }}
</h3>
<div>
{{ .Message }}
</div>
<body>
</html>
{{ template "header.html" }}
<div class="panel">
<h2 class="heading">{{ .Error }}</h2>
<div class="explain">{{ .Message }}</div>
</div>
{{ template "footer.html" }}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment