-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathsignup.html
More file actions
104 lines (100 loc) · 5.48 KB
/
Copy pathsignup.html
File metadata and controls
104 lines (100 loc) · 5.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
{% extends "v3/accounts/auth_page.html" %}
{% comment %}
Sign Up (Create Account) Page — extends the auth page layout.
Renders the account creation form with email, password fields,
mailing list checkbox, and social login options. Inherits from
allauth's SignupView for full registration handling.
This form triggers client-side validation on all fields, then submits natively if no errors.
Context variables:
page_title (string, optional, default "Account") — passed to auth_page.html
foreground_image_url (string, optional, default "") — passed to auth_page.html
background_image_url (string, optional, default "") — passed to auth_page.html
login_url (string, required) — URL for the login page
form (SignupForm, required) — allauth signup form with .email, .password1, .password2 fields and .errors
redirect_field_name (string, optional, default unset) — name of the redirect query parameter; hidden input omitted when redirect_field_value is unset
redirect_field_value (string, optional, default unset) — URL to redirect to after signup; hidden input omitted when unset
password_rules (list, optional, default unset) — rule objects for password validation checklist
{% endcomment %}
{% load static socialaccount %}
{% block auth_content %}
<div class="auth-page__header">
<h1 class="auth-page__title">Create an account</h1>
<p class="auth-page__subtitle">Advance your career, learn from experts, and help shape the future of Boost and C++.</p>
</div>
<form class="auth-page__card auth-page__signup-form"
id="signup_form"
method="post"
action=""
novalidate
{# djlint:off #}
x-data="{ hasErrors: false }"
@input.debounce.150ms="hasErrors = !!$el.querySelector('.field--error')"
@submit.prevent="
$el.querySelectorAll('[data-validate]').forEach(el =>
el.dispatchEvent(new Event('validate'))
);
$nextTick(() => {
hasErrors = !!$el.querySelector('.field--error');
if (!hasErrors) {
HTMLFormElement.prototype.submit.call($el);
}
});
"
{# djlint:on #}
>
{% csrf_token %}
{% include "v3/includes/_field_text.html" with name="email" type="email" label="Email Address*" placeholder="Email Address" required=True validate_type="email" validate_error="That doesn't look quite right, please double-check your email and try again." error=form.email.errors.0 %}
{% include "v3/includes/_field_password.html" with name="password1" label="Password*" placeholder="Password" required=True password_rules=password_rules %}
{% include "v3/includes/_field_password.html" with name="password2" label="Re-enter Password*" placeholder="Password" required=True error=form.password2.errors.0 password_rules="" validate_match="#field-password1" validate_match_error="Passwords do not match, please try again." %}
{% include "v3/includes/_field_text.html" with name="username" label="Username" placeholder="Username" %}
{% if form.non_field_errors %}
{% for error in form.non_field_errors %}<p class="field__error" role="alert">{{ error }}</p>{% endfor %}
{% endif %}
{% include "v3/includes/_field_checkbox.html" with name="mailing_list" label="Also join the Boost Developers Mailing List" %}
<label class="checkbox auth-page_tou-checkbox" for="checkbox-accept_terms_of_use">
<input
class="checkbox__input"
type="checkbox"
id="checkbox-accept_terms_of_use"
name="accept_terms_of_use"
value="on"
required
>
<span class="checkbox__box" aria-hidden="true">
{% include "includes/icon.html" with icon_name="check" icon_class="checkbox__check" %}
</span>
<span class="checkbox__label">I have read and accepted the <a href="{% url 'terms-of-use' %}">Terms of Use</a> for this service</span>
</label>
{% if redirect_field_value %}
<input type="hidden"
name="{{ redirect_field_name }}"
value="{{ redirect_field_value }}">
{% endif %}
<label class="auth-page__invisible-check-label" for="checkbox-create">
<input name="invisible-check-protect" class="checkbox__input" id="checkbox-create" type="checkbox">
{% include "v3/includes/_button.html" with label="Create Account" type="submit" style="primary" alpine_disabled="hasErrors" %}
</label>
<div class="auth-page__signup-divider">
<hr />
<span>
OR
</span>
<hr />
</div>
{% get_providers as socialaccount_providers %}
{% if socialaccount_providers %}
{% for provider in socialaccount_providers %}
<label class="auth-page__invisible-check-label" for="checkbox-{{provider.name}}">
{% provider_login_url provider process="login" scope=scope auth_params=auth_params as href %}
<input name="invisible-check-protect" class="checkbox__input" id="checkbox-{{provider.name}}" type="checkbox">
{% if provider.name == "GitHub" %}
{% include "v3/includes/_button.html" with label="Continue with "|add:provider.name url=href icon_name="github" style="secondary" %}
{% elif provider.name == "Google" %}
{% include "v3/includes/_button.html" with label="Continue with "|add:provider.name url=href icon_name="google-colored" style="secondary" %}
{% endif %}
</label>
{% endfor %}
{% endif %}
</form>
<p class="auth-page__sign-in-link">Already have an account? <a href="{{login_url}}">Sign in</a></p>
{% endblock auth_content %}