{% extends 'base.html' %}
{% block title %}注册{% endblock %}
{% block content %}
<div class="row justify-content-center">
  <div class="col-md-8">
    <h3 class="mb-3">注册账号</h3>
    <form method="post">
      {% csrf_token %}
      <div class="row g-3">
        <div class="col-md-6">
          <label class="form-label">用户名</label>
          {{ form.username }}
        </div>
        <div class="col-md-6">
          <label class="form-label">邮箱</label>
          {{ form.email }}
        </div>
        <div class="col-md-6">
          <label class="form-label">密码</label>
          {{ form.password1 }}
        </div>
        <div class="col-md-6">
          <label class="form-label">确认密码</label>
          {{ form.password2 }}
        </div>
        <div class="col-md-6">
          <label class="form-label">显示名称</label>
          {{ form.display_name }}
        </div>
        <div class="col-md-6">
          <label class="form-label">联系电话</label>
          {{ form.contact_phone }}
        </div>
        {% if captcha_question %}
        <div class="col-md-6">
          <label class="form-label">验证码：<span class="text-primary">{{ captcha_question }}</span></label>
          {{ form.captcha }}
        </div>
        {% endif %}
      </div>
      <div class="mt-3">
        <button class="btn btn-success" type="submit">注册</button>
        <a class="btn btn-outline-secondary" href="{% url 'accounts:login' %}">已有账号？去登录</a>
      </div>
    </form>
  </div>
</div>
{% endblock %}