Skip to main content

max / makenotwork

2.8 KB · 60 lines History Blame Raw
1 {% include "wizards/partials/step_nav.html" %}
2
3 <div class="wizard-step">
4 <h2 class="subtitle-h2">Create account</h2>
5 <p class="step-description">Choose a username, enter your email, and set a password.</p>
6
7 {% if let Some(err) = error %}
8 <div class="info-box info-box--error mb-section" role="alert">{{ err }}</div>
9 {% endif %}
10
11 <form hx-post="/join/step/account"
12 hx-target="#wizard-step" hx-swap="innerHTML">
13 <div class="form-group">
14 <label for="wiz-username">Username</label>
15 <input type="text" id="wiz-username" name="username" required
16 placeholder="username" autocomplete="off" value="{{ username }}"
17 {% if error_field.as_deref() == Some("username") %}aria-invalid="true"{% endif %}
18 aria-describedby="wiz-username-hint"
19 hx-post="/api/validate/username"
20 hx-trigger="keyup changed delay:500ms"
21 hx-target="#username-status"
22 hx-indicator="#username-spinner">
23 <div class="hint" id="wiz-username-hint">Your public url: makenot.work/u/<span id="username-preview">username</span></div>
24 <span id="username-spinner" class="htmx-indicator username-spinner">Checking...</span>
25 <span id="username-status"></span>
26 </div>
27
28 <div class="form-group">
29 <label for="wiz-email">Email</label>
30 <input type="email" id="wiz-email" name="email" required
31 placeholder="you@example.com" autocomplete="email" value="{{ email }}"
32 {% if error_field.as_deref() == Some("email") %}aria-invalid="true"{% endif %}
33 aria-describedby="wiz-email-hint">
34 <div class="hint" id="wiz-email-hint">Used for account recovery and notifications</div>
35 </div>
36
37 <div class="form-group">
38 <label for="wiz-password">Password</label>
39 <input type="password" id="wiz-password" name="password" required
40 placeholder="--------" minlength="8" autocomplete="new-password"
41 {% if error_field.as_deref() == Some("password") %}aria-invalid="true"{% endif %}
42 aria-describedby="wiz-password-hint">
43 <div class="hint" id="wiz-password-hint">Minimum 8 characters</div>
44 </div>
45
46 {% if let Some(code) = invite_code %}
47 <input type="hidden" name="invite_code" value="{{ code }}">
48 {% endif %}
49
50 <div class="wizard-actions">
51 <a href="/" class="btn-secondary">Cancel</a>
52 <button type="submit" class="btn-primary">Create Account</button>
53 </div>
54 </form>
55
56 <div class="foot-link foot-link--centered">
57 Already have an account? <a href="/login">Log in</a>
58 </div>
59 </div>
60