89 lines
3.9 KiB
HTML
89 lines
3.9 KiB
HTML
|
{%- extends 'login/authforms.html' -%}
|
||
|
{% block pagetitle -%}
|
||
|
{{ref_user.username + " invites you to " + SITE_NAME if ref_user else "Sign Up"}}
|
||
|
{%- endblock %}
|
||
|
{% block pagetype %}login{% endblock %}
|
||
|
|
||
|
{% block template_config %}
|
||
|
{% set root_scope.js = true %}
|
||
|
{% set root_scope.include_user_css = false %}
|
||
|
{% set root_scope.include_seo = false %}
|
||
|
{% set root_scope.include_cf_2fa_verify = false %}
|
||
|
{% endblock %}
|
||
|
|
||
|
{% set login_namespace = namespace() %}
|
||
|
{% if ref_user %}
|
||
|
{% set login_namespace.authtitle = '@' + ref_user.username + ' has invited you!' %}
|
||
|
{% set login_namespace.authtext = 'Looks like someone wants you to join ' + SITE_NAME + '.' %}
|
||
|
{% elif not site_settings['login_required'] %}
|
||
|
{% set login_namespace.authtitle = "Create your account." %}
|
||
|
{% set login_namespace.authtext = "No email address required." %}
|
||
|
{% endif %}
|
||
|
{% if ref_user or not site_settings['login_required'] %}
|
||
|
{% block authtitle %}{{login_namespace.authtitle}}{% endblock %}
|
||
|
{% block authtext %}{{login_namespace.authtext}}{% endblock %}
|
||
|
{% endif %}
|
||
|
|
||
|
{% block content %}
|
||
|
<div id="register-form">
|
||
|
<form action="/signup" method="post" class="mt-md-3" id="signup">
|
||
|
|
||
|
{% if error %}<div class="text-danger mb-2">{{error}}</div>{% endif %}
|
||
|
|
||
|
<input type="hidden" name="formkey" value="{{formkey}}">
|
||
|
<input type="hidden" name="now" value="{{now}}">
|
||
|
{% if redirect %}<input type="hidden" name="redirect" value="{{redirect}}">{% endif %}
|
||
|
{% if ref_user %}<input type="hidden" name="referred_by" value="{{ref_user.id}}">{% endif %}
|
||
|
|
||
|
<label for="username-register" class="mt-3">Username</label>
|
||
|
|
||
|
<input autocomplete="off" class="form-control" id="username-register"
|
||
|
aria-describedby="usernameHelpRegister" type="text" name="username" pattern="[a-zA-Z0-9_\-]{3,25}" min="3" max="25" required="">
|
||
|
<small id="usernameHelpRegister"></small>
|
||
|
|
||
|
<label for="email-register" class="mt-3">Email Address</label>
|
||
|
|
||
|
<small class="d-inline-block text-muted ml-1">(optional)</small>
|
||
|
|
||
|
<input style="background-color: var(--gray-800)" autocomplete="off" class="form-control" id="email-register"
|
||
|
aria-describedby="emailHelpRegister" type="email" pattern='{{EMAIL_REGEX_PATTERN}}' name="email" readonly onfocus="if (this.hasAttribute('readonly')) {this.removeAttribute('readonly');this.blur();this.focus()}">
|
||
|
|
||
|
<label for="password-register" class="mt-3">Password</label>
|
||
|
|
||
|
<input autocomplete="off" class="form-control" id="password-register"
|
||
|
aria-describedby="passwordHelpReigster" type="password" name="password" required="">
|
||
|
<small id="passwordHelpRegister" class="form-text font-weight-bold text-muted d-none mt-1">Minimum of 8
|
||
|
characters
|
||
|
required.</small>
|
||
|
<small id="passwordHelpSuccess" class="form-text font-weight-bold text-success d-none mt-1">Your password meets the requirements.
|
||
|
</small>
|
||
|
|
||
|
<label for="password_confirm" class="mt-3">Confirm Password</label>
|
||
|
|
||
|
<input autocomplete="off" class="form-control" id="password_confirm"
|
||
|
aria-describedby="passwordConfirmHelp" type="password" name="password_confirm"
|
||
|
required="">
|
||
|
<div class="custom-control custom-checkbox mt-4">
|
||
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="termsCheck" required>
|
||
|
<label class="custom-control-label terms" for="termsCheck">I accept the <a href="/sidebar">rules</a></label>
|
||
|
</div>
|
||
|
|
||
|
{% if turnstile != DEFAULT_CONFIG_VALUE %}
|
||
|
<div class="cf-turnstile" data-sitekey="{{turnstile}}" data-theme="dark"></div>
|
||
|
{% endif %}
|
||
|
|
||
|
<button type="submit" class="btn btn-primary login w-100 mt-3" id="register_button">Register</button>
|
||
|
|
||
|
<div class="text-center text-muted text-small mt-5 mb-3">
|
||
|
Already have an account? <a href="/login{{'?redirect='+redirect if redirect else ''}}" class="font-weight-bold toggle-login">Log in</a>
|
||
|
</div>
|
||
|
</form>
|
||
|
</div>
|
||
|
{% endblock %}
|
||
|
{% block scripts %}
|
||
|
<script defer src="{{'js/signup.js' | asset}}"></script>
|
||
|
{% if turnstile != DEFAULT_CONFIG_VALUE %}
|
||
|
<script defer src="https://challenges.cloudflare.com/turnstile/v0/api.js"></script>
|
||
|
{% endif %}
|
||
|
{% endblock %}
|