{% extends "admin/base_site.html" %}
{% load i18n admin_static material_form %}

{% block content %}
<div class="left-panel">
    <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 %}
                <input type="hidden" name="next" value="{{ next }}" />
                {% 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>
{% endblock %}
