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

{% block page-title %}Log in - {{ block.super }}{% endblock %}

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

{% block content %}
    <form class="form-horizontal static-box" method="post" action="{% url django.contrib.auth.views.login %}">
        <div class="alert alert-info">
            <strong>Notice:</strong> OpenID is no longer supported. You can <a href="{% url auth_password_reset %}">reset your password here</a>.
        </div>
        {% if request.GET.activationcomplete %}
            <div class="alert alert-success">
                Successfully confirmed email! Log in below.
            </div>
        {% endif %}
        {% 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>Log in</legend>
            <div class="control-group {% if form.username.errors %}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.password.errors %}error{% endif %}">
                <label class="control-label" for="id_password">Password</label>
                <div class="controls">
                    {{ form.password }}
                    {% if form.errors.password %}
                        <span class="help-inline">
                            {% for error in form.errors.password  %}
                                {{ error }}
                            {% endfor %}
                        </span>
                    {% endif %}
                </div>
            </div>
            <div class="form-actions group">
                <a class="btn pull-right" href="/signup/">Sign up</a>
                <a class="btn pull-right" href="{% url auth_password_reset %}">Reset password</a>
                <button class="btn btn-primary" type="submit">Log in</button>
            </div>
        </fieldset>
        <input type="hidden" name="next" value="{{ next }}" />
        {% csrf_token %}
    </form>
{% endblock %}
