{% extends "base.html" %}

{% block title %}Sign Up — DjangoMOO{% endblock %}

{% block body %}
    <div class="container" style="max-width: 640px;">
      <h2>Create Account</h2>

      {% if form.errors %}
        <div class="alert alert-danger" style="margin-top: 15px;">
          Please correct the errors below.
        </div>
      {% endif %}

      <form method="post">
        {% csrf_token %}
        {% for field in form %}
          <div class="form-group">
            <label for="{{ field.id_for_label }}">{{ field.label }}</label>
            {{ field }}
            {% if field.help_text %}
              <small class="form-text text-muted">{{ field.help_text }}</small>
            {% endif %}
            {% for error in field.errors %}
              <div class="text-danger" style="margin-top: 4px;">{{ error }}</div>
            {% endfor %}
          </div>
        {% endfor %}
        <button type="submit" class="btn btn-primary">Sign Up</button>
        <a href="/" class="btn btn-secondary">Cancel</a>
      </form>

      <p style="margin-top: 20px;">
        Already have an account? <a href="{% url 'account_login' %}">Log in</a>
      </p>
    </div>
{% endblock %}
