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

{% import "bootstrap/wtf.html" as wtf %}
{% import "bootstrap/fixes.html" as fixes %}
{% import "bootstrap/utils.html" as util %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}

{% block content %}
    <div class="container">
        <div class="page-header">
            <h1>Login</h1>
        </div>

        {{ util.flashed_messages(dismissible=True, container=False) }}

        <div class="panel panel-default">
            <div class="panel-body">
                {{ wtf.quick_form(login_user_form, form_type='horizontal', action=url_for_security('login'), button_map={'submit_button': 'btn btn-primary'}) }}

                {% if security.registerable %}
                    <p>Don't have an account?
                        <a href="{{ url_for_security('register') }}{% if 'next' in request.args %}?next={{ request.args.next|urlencode }}{% endif %}">
                        Register
                        </a>.
                    </p>
                {% endif %}

                {% if security.recoverable %}
                    <p>Forgot your password?
                        <a href="{{ url_for_security('forgot_password') }}">
                            Reset
                        </a>.
                    </p>
                {% endif %}
            </div>
        </div>
    </div>
    {% include "footer.html" %}
{% endblock %}
