{% load static %}
{% load i18n %}
<!doctype html>
<html lang="zh-hans">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>{{site_title}}</title>
    <link href="https://cdn.bootcss.com/pure/1.0.1/pure-min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/feather-icons/4.24.1/feather.min.js"></script>
    <link rel="stylesheet" type="text/css" href="{% static "juss/juss.css" %}">
</head>
<body>
    <div id="login-page">
        <div id="login-bg" style="background-image:url({{login_bg}})">
            <h1>{{site_header}}</h1>
        </div>
        <div id="login-box">
            <h2>登录<small>LOGIN</small></h2>

            {% if form.errors and not form.non_field_errors %}
            <p class="errornote">
            {% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
            </p>
            {% endif %}

            {% 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 class="form-row">
                {{ form.username.errors }}
                {{ form.username.label_tag }} {{ form.username }}
              </div>
              <div class="form-row">
                {{ form.password.errors }}
                {{ form.password.label_tag }} {{ form.password }}
                <input type="hidden" name="next" value="{{ next }}">
              </div>
              {% 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="submit-row">
                <label>&nbsp;</label><input type="submit" value="{% trans 'Log in' %}">
              </div>
            </form>
        </div>
    </div>
</body>
</html>
