{% extends "statusboard/base.html" %}

{% block content %}
<div class="container">
    {% if forms.errors %}
    <div class="alert alert-danger" role="alert">
        Your username and password didn't match. Please try again.
    </div>
    {% endif %}

    {% if next %}
        {% if user.is_authenticated %}
        <div class="alert alert-danger" role="danger">
            Your account doesn't have access to this page. To proceed,
            please login with an account that has access.
        </div>
        {% else %}
        <div class="alert alert-danger" role="danger">
            Please login to see this page.
        </div>
        {% endif %}
    {% endif %}

    <div class="page-header">
        <h1>Please sign in</h1>
    </div>
    <form class="form-horizontal" role="form" method="post" action="{% url "statusboard:login" %}">
        {% csrf_token %}
        <div class="form-group">
            <label for="form.username.id_for_label">Username</label>
            <input class="form-control" type="text" id="{{ form.username.id_for_label }}" name="{{ form.username.name }}">
        </div>
        <div class="form-group">
            <label for="form.password.id_for_label">Password</label>
            <input class="form-control" type="password" id="{{ form.password.id_for_label }}" name="{{ form.password.name }}">
        </div>
        <div class="form-group">
            <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
        </div>
        <input type="hidden" name="next" value="{{ next }}" />
    </form>
</div>
{% endblock %}
