Skip to main content

max / makenotwork

2.5 KB · 57 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-4" 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 hx-post="/api/validate/username"
19 hx-trigger="keyup changed delay:500ms"
20 hx-target="#username-status"
21 hx-indicator="#username-spinner">
22 <div class="hint">Your public url: makenot.work/u/<span id="username-preview">username</span></div>
23 <span id="username-spinner" class="htmx-indicator username-spinner">Checking...</span>
24 <span id="username-status"></span>
25 </div>
26
27 <div class="form-group">
28 <label for="wiz-email">Email</label>
29 <input type="email" id="wiz-email" name="email" required
30 placeholder="you@example.com" autocomplete="email" value="{{ email }}"
31 {% if error_field.as_deref() == Some("email") %}aria-invalid="true"{% endif %}>
32 <div class="hint">Used for account recovery and notifications</div>
33 </div>
34
35 <div class="form-group">
36 <label for="wiz-password">Password</label>
37 <input type="password" id="wiz-password" name="password" required
38 placeholder="--------" minlength="8" autocomplete="new-password"
39 {% if error_field.as_deref() == Some("password") %}aria-invalid="true"{% endif %}>
40 <div class="hint">Minimum 8 characters</div>
41 </div>
42
43 {% if let Some(code) = invite_code %}
44 <input type="hidden" name="invite_code" value="{{ code }}">
45 {% endif %}
46
47 <div class="wizard-actions">
48 <a href="/" class="btn-secondary">Cancel</a>
49 <button type="submit" class="btn-primary">Create Account</button>
50 </div>
51 </form>
52
53 <div class="foot-link foot-link--centered">
54 Already have an account? <a href="/login">Log in</a>
55 </div>
56 </div>
57