{% extends "material/frontend/base_site.html" %}
{% load i18n material_form %}

{% block title %}{% trans Login %} - {{ block.super }}{% endblock %}
{% block page_title %}{% trans 'Authentication' %}{% endblock %}


{% block content %}
<div class="row">
    <div class="col s12 offset-m3 m6">
        <div class="card">
            <div class="card-content">
                <span class="card-title black-text">{% trans 'Log in' %}</span>

                <form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
                    {% if 'username' in form.fields %}
                    {% form %}
                        {% part form.username prefix %}<i class="material-icons prefix">account_box</i>{% endpart %}
                        {% part form.password prefix %}<i class="material-icons prefix">lock</i>{% endpart %}
                    {% endform %}
                    {% else %}
                        {% form %}{% endform %}
                    {% endif %}

                    {% url 'admin_password_reset' as password_reset_url %}
                    {% if password_reset_url %}
                    <div class="password-reset-link">
                        <a href="{{ password_reset_url }}">{% trans 'Forgotten your password or username?' %}</a>
                    </div>
                    {% endif %}
                    <div class="card-action right-align">
                        <button type="submit" class="btn btn-primary">{% trans 'Log in' %}</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}
