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

{% block stylesheets %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% load adminmedia %}{% admin_media_prefix %}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 %}

<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 %}

