internal/web/templates/login.html
cmc web: polish remaining repo sub-views, snippets/queries, and auth/landing pages
28e72be7ab 1 day ago40 lines · 1859 bytes
1{{define "width"}}bounded{{end}}
2{{define "title"}}login · {{.Site}}{{end}}
3{{define "content"}}
4<div class="pagehead">
5 <h1>Sign in</h1>
6</div>
7{{if .Next}}<p class="meta">Sign in to continue to <code>{{.Next}}</code>.</p>{{end}}
8{{if .Error}}<p class="error" role="alert">{{.Error}}</p>{{end}}
9<section class="setcard">
10{{if .Sent}}
11<p>If that account exists, a login link is on its way. It works once and
12expires in fifteen minutes.</p>
13{{else}}
14{{if .EmailLogin}}
15<form method="post" action="/login">
16 <div class="field"><label for="identifier">Username or email address</label>
17 <input type="text" id="identifier" name="identifier" autocomplete="username" autocapitalize="none" spellcheck="false" required></div>
18 <button type="submit">Email me a link</button>
19</form>
20<p class="meta">Or, from a machine with your registered key:</p>
21{{else}}
22<p>Browser sessions are minted over SSH — there is no password. From a machine
23with your registered key:</p>
24{{end}}
25<pre class="message copyable" tabindex="0">ssh git@{{.Host}} web login</pre>
26<p class="meta">Then open the printed URL within five minutes.</p>
27{{end}}
28</section>
29<section class="setcard">
30<h2>New here?</h2>
31{{if eq .Mode "open"}}<p><a href="/register">Create an account</a> — pick a username, paste your SSH
32public key, verify your email. Or from the terminal:</p>
33<pre class="message copyable" tabindex="0">ssh git@{{.Host}} register --username you --email you@example.org</pre>
34{{else if eq .Mode "invite"}}<p>This instance is invite-only. With a code from an admin,
35<a href="/register">create an account</a> — pick a username, paste your SSH public key. Or from
36the terminal:</p>
37<pre class="message copyable" tabindex="0">ssh git@{{.Host}} register --username you --invite <code></pre>
38{{else}}<p>This instance is not accepting new accounts.</p>{{end}}
39</section>
40{{end}}