{% load static %}
{% load i18n %}
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Jumpserver</title>
    <link rel="shortcut icon" href="{{ FAVICON_URL }}" type="image/x-icon">
    {% include '_head_css_js.html' %}
    <link href="{% static "css/jumpserver.css" %}" rel="stylesheet">
    <script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>
    <script src="{% static "js/jumpserver.js" %}"></script>
    <style>
        .captcha {
             float: right;
         }
    </style>
</head>

<body class="gray-bg">
    <div class="loginColumns animated fadeInDown">
        <div class="row">
            <div class="col-md-6">

                <h2 class="font-bold" style="text-align: center">{% trans 'Welcome to the Jumpserver open source fortress' %}</h2>
                <p>
                    {% trans "The world's first fully open source fortress, using the GNU GPL v2.0 open source protocol, is a professional operation and maintenance audit system in compliance with 4A." %}
                </p>
                <p>
                    {% trans "Developed using Python/Django, following the Web 2.0 specification and equipped with industry-leading Web Terminal solutions, with beautiful interactive interface and good user experience." %}
                </p>
                <p>
                    {% trans 'Distributed architecture is adopted to support multi-machine room deployment across regions, central node provides API, and each machine room deploys login node, which can be extended horizontally and without concurrent access restrictions.' %}
                </p>
                <p>
                    {% trans  "Changes the world, starting with a little bit." %}
                </p>

            </div>
            <div class="col-md-6">
                <div class="ibox-content">
                    <div>
                        <img src="{{ LOGO_URL }}" width="60" height="60">
                        <span class="font-bold text-center" style="font-size: 24px; font-family: inherit; margin-left: 20px">{% trans 'Login' %}</span>
                    </div>
                    <form class="m-t" role="form" method="post" action="">
                        {% csrf_token %}

                        {% if block_login %}
                            <p class="red-fonts">{% trans 'Log in frequently and try again later' %}</p>
                        {% elif password_expired %}
                            <p class="red-fonts">{% trans 'The user password has expired' %}</p>
                        {% elif form.errors %}
                            {% if 'captcha' in form.errors %}
                                <p class="red-fonts">{% trans 'Captcha invalid' %}</p>
                            {% else %}
                                <p class="red-fonts">{{ form.non_field_errors.as_text }}</p>
                            {% endif %}
                        {% endif %}

                        <div class="form-group">
                            <input type="text" class="form-control" name="{{ form.username.html_name }}" placeholder="{% trans 'Username' %}" required="" value="{% if form.username.value %}{{ form.username.value }}{% endif %}">
                        </div>
                        <div class="form-group">
                            <input type="password" class="form-control" name="{{ form.password.html_name }}" placeholder="{% trans 'Password' %}" required="">
                        </div>
                        <div>
                            {{ form.captcha }}
                        </div>
                        <button type="submit" class="btn btn-primary block full-width m-b">{% trans 'Login' %}</button>

                        {% if demo_mode %}
                        <p class="text-muted font-bold" style="color: red">
                            Demo账号: admin 密码: admin
                        </p>
                        {% endif %}

                        <div class="text-muted text-center">
                        <div>
                            <a href="{% url 'users:forgot-password' %}">
                                <small>{% trans 'Forgot password' %}?</small>
                            </a>
                        </div>

                        {% if AUTH_OPENID %}
                        <div class="hr-line-dashed"></div>
                        <p class="text-muted text-center">{% trans "More login options" %}</p>
                        <div>
                            <button type="button" class="btn btn-default btn-sm btn-block" onclick="location.href='{% url 'authentication:openid:openid-login' %}'">
                                <i class="fa fa-openid"></i>
                                {% trans 'Keycloak' %}
                            </button>
                        </div>
                        {% endif %}

                    </form>

                </div>
            </div>
        </div>
        <hr/>
        <div class="row">
            <div class="col-md-12">
                 {% include '_copyright.html' %}
            </div>
        </div>
    </div>
</body>
</html>
