File size: 3,472 Bytes
7f8e190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
{% extends "base.html" %}
{% import "_partials.html" as ui %}
{# Field order (username, password, confirm password, e-mail), button copy and
   link row are transcribed from signup-desktop / signup-mobile. The captured
   page stops at submit, so the verification-code step below is this clone's
   own; see SOURCE_PROVENANCE.md. #}
{% block title %}Login / Register - LeetCode{% endblock %}
{% block header %}{{ ui.app_header(member, '', false) }}{% endblock %}
{% block main %}
<div class="auth">
  <div class="auth__card">
    <a class="auth__brand" href="/" aria-label="LeetCode">
      {{ ui.logo_mark(44) }}
      <span class="auth__word">LeetCode</span>
    </a>
    {% if stage == 'verify' %}
    <p class="auth__notice" role="status">Enter the verification code sent to {{ pending_email }}.</p>
    <form class="auth__form" method="post" action="/accounts/signup/verify/" novalidate>
      <label class="auth__field">
        <span class="visually-hidden">Verification code</span>
        <input type="text" name="code" inputmode="numeric" maxlength="6" placeholder="Verification code" autocomplete="one-time-code" required>
      </label>
      {{ ui.field_error(errors, 'code') }}
      {{ ui.field_error(errors, 'username') }}
      {{ ui.field_error(errors, 'email') }}
      <button class="auth__submit" type="submit">Verify</button>
    </form>
    <div class="auth__row">
      <a href="/accounts/message/?purpose=registration">Open the message</a>
      <a href="/accounts/signup/">Start over</a>
    </div>
    {% else %}
    <form class="auth__form" method="post" action="/accounts/signup/" novalidate>
      <label class="auth__field">
        <span class="visually-hidden">Username</span>
        <input type="text" name="username" value="{{ values.username|default('') }}" placeholder="Username" autocomplete="username" required>
      </label>
      {{ ui.field_error(errors, 'username') }}
      <label class="auth__field">
        <span class="visually-hidden">Password</span>
        <input type="password" name="password" placeholder="Password" autocomplete="new-password" required>
      </label>
      {{ ui.field_error(errors, 'password') }}
      <label class="auth__field">
        <span class="visually-hidden">Confirm password</span>
        <input type="password" name="confirm_password" placeholder="Confirm password" autocomplete="new-password" required>
      </label>
      {{ ui.field_error(errors, 'confirm_password') }}
      <label class="auth__field">
        <span class="visually-hidden">E-mail address</span>
        <input type="email" name="email" value="{{ values.email|default('') }}" placeholder="E-mail address" autocomplete="email" required>
      </label>
      {{ ui.field_error(errors, 'email') }}
      {{ ui.verification_widget(verification) }}
      {{ ui.field_error(errors, 'verification') }}
      <button class="auth__submit" type="submit">Sign Up</button>
    </form>
    <p class="auth__fine">By continuing, you agree to <a href="/terms/">Terms</a> &amp; <a href="/privacy/">Privacy Policy.</a></p>
    <p class="auth__row auth__row--center">Have an account? <a href="/accounts/login/">Sign In</a></p>
    <p class="auth__or">or you can sign in with</p>
    {{ ui.social_row() }}
    {% if social_notice %}<p class="auth__notice auth__notice--muted" role="status">{{ social_notice }}</p>{% endif %}
    {% endif %}
  </div>
</div>
{% endblock %}
{% block footer %}{{ ui.app_footer('grey') }}{% endblock %}