[chore] Don't render sign-up form when registrations closed (#3001)
This commit is contained in:
parent
fef9b6a621
commit
fbdfce3190
|
@ -59,6 +59,7 @@ func (m *Module) signupGETHandler(c *gin.Context) {
|
||||||
OGMeta: apiutil.OGBase(instance),
|
OGMeta: apiutil.OGBase(instance),
|
||||||
Extra: map[string]any{
|
Extra: map[string]any{
|
||||||
"reasonRequired": config.GetAccountsReasonRequired(),
|
"reasonRequired": config.GetAccountsReasonRequired(),
|
||||||
|
"registrationOpen": config.GetAccountsRegistrationOpen(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,9 @@
|
||||||
<main>
|
<main>
|
||||||
<section class="with-form" aria-labelledby="sign-up">
|
<section class="with-form" aria-labelledby="sign-up">
|
||||||
<h2 id="sign-up">Sign up for an account on {{ .instance.Title -}}</h2>
|
<h2 id="sign-up">Sign up for an account on {{ .instance.Title -}}</h2>
|
||||||
|
{{- if not .registrationOpen }}
|
||||||
|
<p>This instance is not currently open to new sign-ups.</p>
|
||||||
|
{{- else }}
|
||||||
<form action="/signup" method="POST">
|
<form action="/signup" method="POST">
|
||||||
<div class="labelinput">
|
<div class="labelinput">
|
||||||
<label for="email">Email</label>
|
<label for="email">Email</label>
|
||||||
|
@ -40,6 +43,7 @@
|
||||||
name="password"
|
name="password"
|
||||||
required
|
required
|
||||||
placeholder="Please enter your desired password"
|
placeholder="Please enter your desired password"
|
||||||
|
autocomplete="new-password"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="labelinput">
|
<div class="labelinput">
|
||||||
|
@ -88,6 +92,7 @@
|
||||||
<input type="hidden" name="locale" value="en">
|
<input type="hidden" name="locale" value="en">
|
||||||
<button type="submit" class="btn btn-success">Submit</button>
|
<button type="submit" class="btn btn-success">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
|
{{- end }}
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
{{- end }}
|
{{- end }}
|
Loading…
Reference in New Issue