{% extends "registration/registration_base.html" %}

{% block page-title %}Sign up - {{ block.super }}{% endblock %}

{% block body-class %}{{ block.super }} static{% endblock %}

{% block content %}
    <form class="form-horizontal static-box" method="post" action="">
        {% if form.errors %}
            {% if form.non_field_errors %}
                <div class="alert alert-error">
                    {{ form.non_field_errors }}
                </div>
            {% else %}
                <div class="alert alert-error">
                    Please fix the errors below.
                </div>
            {% endif %}
        {% endif %}
        <fieldset>
            <legend>Sign up</legend>
            <div class="control-group {% if form.errors.username %}error{% endif %}">
                <label class="control-label" for="id_username">Username</label>
                <div class="controls">
                    {{ form.username }}
                    {% if form.errors.username %}
                        <span class="help-inline">
                            {% for error in form.errors.username  %}
                                {{ error }}
                            {% endfor %}
                        </span>
                    {% endif %}
                </div>
            </div>
            <div class="control-group {% if form.errors.email %}error{% endif %}">
                <label class="control-label" for="id_email">Email address</label>
                <div class="controls">
                    {{ form.email }}
                    {% if form.errors.email %}
                        <span class="help-inline">
                            {% for error in form.errors.email  %}
                                {{ error }}
                            {% endfor %}
                        </span>
                    {% endif %}
                </div>
            </div>
            <div class="control-group {% if form.errors.password1 %}error{% endif %}">
                <label class="control-label"l for="id_password1">Password</label>
                <div class="controls">
                    {{ form.password1 }}
                    {% if form.errors.password1 %}
                        <span class="help-inline">
                            {% for error in form.errors.password1  %}
                                {{ error }}
                            {% endfor %}
                        </span>
                    {% endif %}
                </div>
            </div>
            <div class="control-group {% if form.errors.password2 %}error{% endif %}">
                <label class="control-label" for="id_password2">Confirm password</label>
                <div class="controls">
                    {{ form.password2 }}
                    {% if form.errors.password2 %}
                        <span class="help-inline">
                            {% for error in form.errors.password2  %}
                                {{ error }}
                            {% endfor %}
                        </span>
                    {% endif %}
                </div>
            </div>
            <div class="form-actions group">
                <a class="btn pull-right" href="/login/">Log in</a>
                <button class="btn btn-primary" type="submit">Sign up</button>
            </div>
        </fieldset>
        {% csrf_token %}
    </form>
{% endblock %}
