{% load widget_tweaks %}
{% include 'form_errors.html' %}
{% if form.errors %}
	<div class="alert alert-info">
		<p><strong>Please note:</strong> If it has been more than a year since you last logged in, your account will have been automatically deactivated. Contact <a href="mailto:it@nottinghamtec.co.uk">it@nottinghamtec.co.uk</a> for assistance.</p>
	</div>
{% endif %}
<div class="col-sm-6 offset-sm-3 col-lg-4 offset-lg-4">
    <form action="{% url 'login' %}" method="post" role="form" target="_self">{% csrf_token %}
        <div class="form-group">
            <label for="id_username">{{ form.username.label }}</label>
            {% render_field form.username class+="form-control" placeholder=form.username.label autofocus="" %}
        </div>
        <div class="form-group">
            <label for="{{ form.password.id_for_label }}">{{ form.password.label }}</label>
            {% render_field form.password class+="form-control" placeholder=form.password.label %}
        </div>
        <div class="text-right">
            <a href="{% url 'registration_register' %}" class="btn">Register</a>
            <a href="{% url 'password_reset' %}" class="btn">Forgotten Password</a>
            <input type="submit" id="id_submit" value="Login" class="btn btn-primary"/>
            <input type="hidden" name="next" value="{{ next }}"/>
        </div>
    </form>
</div>
