{% extends 'layouts/index.html' %}
{% from 'macros.html' import render_field %}

{% block content %}
    {% with messages = get_flashed_messages() %}
        {% if messages %}
            <span class="error-message">
                    {{ messages[0] }}
            </span>
        {% endif %}
    {% endwith %}
    <form method="POST" action="{{ url_for('auth.login') }}" class="login-form">
        {{ form.csrf_token }}
        {{ render_field(form.username) }}
        {{ render_field(form.password) }}
        {{ render_field(form.remember_me) }}
        <input type=submit value=Login>
    </form>
    <p class="form-subtext">
        Don't have a login? <a href="{{ url_for('auth.signup') }}">Sign-up</a> instead!
    </p>
{% endblock content %}
