mlmym/templates/login.html
2023-12-21 22:17:39 -05:00

112 lines
3.8 KiB
HTML

<!DOCTYPE html>
<head>
<title>{{ host .Host }}: sign up or log in</title>
<link rel="shortcut icon" href="/{{.Host}}/icon.jpg">
<link rel="stylesheet" href="/_/static/style.css?v={{ .Version }}">
{{ if not .Dark }}
<link rel="stylesheet" href="/_/static/dark.css?v={{ .Version }}" media="(prefers-color-scheme:dark)">
{{ end }}
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body {{ if is .Dark }}class="dark"{{end}}>
<nav>
<div class="communities">
<a href="/{{.Host}}">home</a>
<span> - </span>
<a href="/{{.Host}}?listingType=All">all</a>
|
{{ $host := .Host }}
{{ range $i, $c := .TopCommunities}}
<a href="/{{$host}}/c/{{$c.Community.Name}}">{{$c.Community.Name}}</a>
<span> - </span>
{{ end }}
<a href="/{{$host}}/search?searchtype=Communities" class="more">more »</a>
</div>
<div class="spacer">
<a href="/{{ .Host}}/">
<img class="icon" src="{{ if .Site }}{{ .Site.SiteView.Site.Icon.String }}{{else}}/{{ .Host}}/icon.jpg{{end}}">
</a>
</div>
<span class="title"><a class="title" href="/{{.Host}}">{{ host .Host}}</a> - sign up or login</span>
</nav>
{{ if .Alert }}
<div class="alert">
{{ .Alert }}
</div>
{{ end }}
{{ if .Error }}
<div class="error">{{.Error}}</div>
{{ end }}
<div class="signup">
{{ if ne .Op "2fa" }}
<div>
<h2>create a new account</h2>
<form method="POST" action="/{{ .Host}}/login">
<label>
username
<div><input required name="username" type="text"></div>
</label>
<label>
password
<div><input required name="password" type="password"></div>
</label>
<label>
verify password
<div><input required name="passwordverify" type="password"></div>
</label>
<label>
email
<div><input {{ if and .Site .Site.SiteView.LocalSite.RequireEmailVerification }} required {{ end }}name="email" type="text"></div>
</label>
{{ if and .Site (or (eq .Site.SiteView.LocalSite.RegistrationMode "RequireApplication") (eq .Site.SiteView.LocalSite.RegistrationMode "requireapplication")) }}
<div class="question">
{{ markdown .Host .Site.SiteView.LocalSite.ApplicationQuestion.String }}
</div>
<label>
answer
<div><textarea required name="answer"></textarea></div>
</label>
{{ end }}
{{ if and .Site .Site.SiteView.LocalSite.CaptchaEnabled .Captcha }}
<figure><img src="data:image/png;base64,{{ .Captcha.Png }}"></figure>
<figure><audio controls src="data:audio/wav;base64,{{ .Captcha.Wav }}"></audio></figure>
<label>
enter code
<div><input required name="captchaanswer" type="text"></div>
<input type="hidden" name="captchauuid" value="{{ .Captcha.Uuid }}">
</label>
{{ end }}
{{ if and .Site .Site.SiteView.LocalSite.EnableNSFW }}
<label>
enable nsfw
<input type="checkbox">
</label>
{{ end }}
<input type="submit" name="submit" value="sign up">
</form>
</div>
{{ end }}
<div>
<h2>login</h2>
<form method="POST" action="/{{ .Host}}/login">
<label>
username
<div><input required name="username" type="text"></div>
</label>
<label>
password
<div><input required name="password" type="password"></div>
</label>
{{ if eq .Op "2fa" }}
<label>
2fa code
<div><input required name="totp" type="text"></div>
</label>
{{ end }}
<input type="submit" name="submit" value="log in">
</form>
</div>
</div>
</body>
</html>