{% extends "admin/base_site.html" %}
{% load i18n future staticfiles %}

{% block stylesheets %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static settings.MEZZANINE_ADMIN_PREFIX|add:"css/login.css" %}">
{% endblock %}

{% block bodyclass %}login{% endblock %}
{% block content_title %}{% endblock %}
{% block breadcrumbs %}{% endblock %}

{% block content %}

{% if form.non_field_errors %}
{% for error in form.non_field_errors %}
<p class="errornote">{{ error }}</p>
{% endfor %}
{% endif %}
{% if no_site_permission %}
<p class="errornote">{% trans "You don't have permission to access the admin for this site." %}</p>
{% endif %}

<form action="{{ app_path }}" method="post" id="login-form">
    {% csrf_token %}
    <div id="content-main">
        <div class="form-row">
            <label for="id_username" class="required">{% trans 'Username or email:' %}</label>
            <input type="text" required name="username" id="id_username" value="{{ request.POST.username }}">
        </div>
        <div class="form-row">
            <label for="id_password" class="required">{% trans 'Password:' %}</label>
            <input type="password" required  name="password" id="id_password">
            <input type="hidden" name="this_is_the_login_form" value="1" />
        </div>
        <div class="form-row" id="extra-login-fields">
            <label class="required">{% trans "Interface:" %}</label>
            <input class="interface" type="radio" name="mezzanine_login_interface" id="interface_admin"
                value="admin"{% if request.REQUEST.mezzanine_login_interface != "site" %} checked{% endif %} />
            <label class="interface" for="interface_admin">{% trans "Admin" %}</label>
            <input class="interface" type="radio" name="mezzanine_login_interface" id="interface_site"
                value="site"{% if request.REQUEST.mezzanine_login_interface == "site" %} checked{% endif %} />
            <label class="interface" for="interface_site">{% trans "Site" %}</label>
        </div>
    </div>
    <div class="submit-row">
        <label>&nbsp;</label><input type="submit" value="{% trans 'Log in' %}" />
    </div>
    <p id="forgot-password">
        <a href="{% url "password_reset" %}">{% trans "Forgot password?" %}</a>
    </p>
</form>

{% endblock %}

