Add registration form to login and allow everyone to see listing
This commit is contained in:
parent
f5dc9e22fe
commit
c9e61da7f0
|
@ -41,6 +41,13 @@
|
||||||
{{ navbarItem .Path (.T "Request beatmap ranking") "/beatmaps/rank_request" }}
|
{{ navbarItem .Path (.T "Request beatmap ranking") "/beatmaps/rank_request" }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{ else }}
|
||||||
|
<div class="ui dropdown item">
|
||||||
|
<span>{{ .T "Beatmaps" }}</span>
|
||||||
|
<div class="menu">
|
||||||
|
{{ navbarItem .Path (.T "Listing") "/beatmaps" }} }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ navbarItem .Path (.T "Donate" | printf "<i class=\"red heart icon\"></i>%s") "/donate" }}
|
{{ navbarItem .Path (.T "Donate" | printf "<i class=\"red heart icon\"></i>%s") "/donate" }}
|
||||||
{{ if $isAdmin }}{{ navbarItem .Path (.T "RAP" | printf "<b>%s</b>") "https://old.yozora.pw/p/100" }}{{ end }}
|
{{ if $isAdmin }}{{ navbarItem .Path (.T "RAP" | printf "<b>%s</b>") "https://old.yozora.pw/p/100" }}{{ end }}
|
||||||
|
|
|
@ -2,52 +2,60 @@
|
||||||
<div class="ui container">
|
<div class="ui container">
|
||||||
{{ $regEnabled := qb "SELECT value_int FROM system_settings WHERE name = 'registrations_enabled'" }}
|
{{ $regEnabled := qb "SELECT value_int FROM system_settings WHERE name = 'registrations_enabled'" }}
|
||||||
{{ if .Context.User.ID }}
|
{{ if .Context.User.ID }}
|
||||||
<div class="ui segment">
|
<div class="ui segment">
|
||||||
{{ .T "You're already logged in!" }}
|
{{ .T "You're already logged in!" }}
|
||||||
</div>
|
</div>
|
||||||
{{ else if not ($regEnabled.value_int.Bool) }}
|
{{ else if not ($regEnabled.value_int.Bool) }}
|
||||||
<div class="ui error message">
|
<div class="ui error message">
|
||||||
{{ .T "Sorry, it's not possible to register at the moment. Please try again later." }}
|
{{ .T "Sorry, it's not possible to register at the moment. Please try again later." }}
|
||||||
</div>
|
</div>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ if eq (.Gin.Query "stopsign") "1" }}
|
{{ if eq (.Gin.Query "stopsign") "1" }}
|
||||||
<div class="ui warning message">
|
<div class="ui warning message">
|
||||||
{{ .T "Remember: this seems like it's your second account! Do not multiaccount, or you're likely to get restricted!" }}
|
{{ .T "Remember: this seems like it's your second account! Do not multiaccount, or you're likely to get restricted!" }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
<div class="ui info message">
|
||||||
|
<center> Don't have a code? Apply <a href="https://docs.google.com/forms/d/1oYO8Cky0piTsfhMDxnQOZnNOo4K4tT3itZ5CdLY-w2k">here!</a></center>
|
||||||
|
</div>
|
||||||
|
<div class="tiny container">
|
||||||
|
<div class="ui raised segments">
|
||||||
|
<div class="ui segment">
|
||||||
|
<form id="register-form" class="ui form" method="post" action="/register">
|
||||||
|
<div class="field">
|
||||||
|
<label>{{ .T "Username (2 to 15 characters, alphanumeric, spaces, <code>_[]-</code>)" | html }}</label>
|
||||||
|
<input tabindex="1" type="text" name="username" placeholder="{{ .T "Username" }}"
|
||||||
|
value="{{ .FormData.username }}" required pattern="^[A-Za-z0-9 _\[\]-]{2,15}$">
|
||||||
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<label>{{ .T "Password (at least 8 characters)" }}</label>
|
||||||
|
<input tabindex="2" type="password" name="password" placeholder="{{ .T "Password" }}"
|
||||||
|
value="{{ .FormData.password }}" required pattern="^.{8,}$">
|
||||||
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<label>{{ .T "Email" }}</label>
|
||||||
|
<input tabindex="3" type="email" name="email" placeholder="{{ .T "Email" }}"
|
||||||
|
value="{{ .FormData.email }}" required>
|
||||||
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<label>{{ .T "Registration Key" }}</label>
|
||||||
|
<input tabindex="3" type="text" name="key" placeholder="{{ .T "Key" }}"
|
||||||
|
value="{{ .FormData.key }}" required>
|
||||||
|
</div>
|
||||||
|
{{ with config "RecaptchaSite" }}
|
||||||
|
<div class="field">
|
||||||
|
<div class="g-recaptcha" data-sitekey="{{ . }}"></div>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
{{ ieForm .Gin }}
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
<div class="ui right aligned segment">
|
||||||
<div class="tiny container">
|
<button tabindex="4" class="ui primary button" type="submit"
|
||||||
<div class="ui raised segments">
|
form="register-form">{{ .T "Submit" }}</button>
|
||||||
<div class="ui segment">
|
|
||||||
<form id="register-form" class="ui form" method="post" action="/register">
|
|
||||||
<div class="field">
|
|
||||||
<label>{{ .T "Username (2 to 15 characters, alphanumeric, spaces, <code>_[]-</code>)" | html }}</label>
|
|
||||||
<input tabindex="1" type="text" name="username" placeholder="{{ .T "Username" }}" value="{{ .FormData.username }}" required pattern="^[A-Za-z0-9 _\[\]-]{2,15}$">
|
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<label>{{ .T "Password (at least 8 characters)" }}</label>
|
|
||||||
<input tabindex="2" type="password" name="password" placeholder="{{ .T "Password" }}" value="{{ .FormData.password }}" required pattern="^.{8,}$">
|
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<label>{{ .T "Email" }}</label>
|
|
||||||
<input tabindex="3" type="email" name="email" placeholder="{{ .T "Email" }}" value="{{ .FormData.email }}" required>
|
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<label>{{ .T "Registration Key" }}</label>
|
|
||||||
<input tabindex="3" type="text" name="key" placeholder="{{ .T "Key" }}" value="{{ .FormData.key }}" required>
|
|
||||||
</div>
|
|
||||||
{{ with config "RecaptchaSite" }}
|
|
||||||
<div class="field">
|
|
||||||
<div class="g-recaptcha" data-sitekey="{{ . }}"></div>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
{{ ieForm .Gin }}
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="ui right aligned segment">
|
|
||||||
<button tabindex="4" class="ui primary button" type="submit" form="register-form">{{ .T "Submit" }}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
Loading…
Reference in New Issue
Block a user