{% extends "base.html" %}

{% block title %} | Login{% endblock %}
{% block bodydata %} class="login" {% endblock %}

{% block main %}
			{% if form.errors %}
			<div class="page-header">
				<div class="container">
					<h1>Authorisation failed</h1>
				</div>
			</div>
			<div class="container">
				<div class="row">
					<div class="col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3">
						<div class="alert alert-danger">We were unable to authenticate you. Either user name or password are incorrect. Please try again.</div>
					</div>
				</div>
			</div>
			{% endif %}

			{% if next %}
			<div class="page-header">
				<div class="container">
					<h1>Sign in required</h1>
				</div>
			</div>
			<div class="container">
				<div class="row">
					<div class="col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3">
						<div class="alert alert-warning">Please sign in.</div>
					</div>
				</div>
			</div>
			{% endif %}

		<div class="container">
			<div class="row">
				<div class="col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3">
					<h3 class="header">Sign in</h3>

					{% include 'snippets/messages.html' %}

					<form role="form" action="/admin/account/login/" method="POST">
						{% csrf_token %}
						<input type="hidden" name="next" value="{{ request.REQUEST.next }}" />
						<div class="form-group">
							<label for="login">E-mail</label>
							<input type="text" class="form-control input-lg" id="login" name="login">
						</div>
						<div class="form-group">
							<label for="inputPassword">Password</label>
							<input type="password" class="form-control input-lg" id="password" name="password">
						</div>
						<div class="form-group">
								<button type="submit" class="btn btn-primary">Sign in</button>
						</div>
					</form>
					<div class="well text-center">
						Not a member yet? Please <a href="{% url 'account_signup' %}">sign up here</a> &bull; <a href="{% url 'account_reset_password' %}">Forgot password?</a>
					</div>
				</div>
			</div>
		</div>
{% endblock %}
