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

<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
          integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">


    <title>{% block title %}{{ parameter.tituloProjeto|default:'Prefeitura de Palmas' }}{% endblock title %}</title>
    <style>
        html,
        body {
            height: 100% !important;
        }
    </style>
</head>
<body>
<div class="container-fluid h-100">
    {% block container %}
        <div class="row h-100">
            <div class="col-6 h-100 p-5 d-flex align-items-center" style="background-color: rgb(2, 167, 243) !important;">
                {% block containerleft %}
                    <div class="col text-center">
                        <h1 class="text-white">{% block titulosistema %} {{ parameter.nomeProjeto|default:''|safe }}{% endblock titulosistema %}</h1>
                        <div class="col-md-12 btn mg-10 py-2 ">
                            {% block iconesistema %}
                                {{ parameter.iconeProjeto|safe }}
                            {% endblock iconesistema %}
                        </div>
                        <div class="text-white">
                            {% block descricaosistema %}
                                {{ parameter.descricaoProjeto|default:''|safe }}
                            {% endblock descricaosistema %}
                        </div>
                    </div>
                {% endblock containerleft %}
            </div>
            <div class="col-6 align-self-center p-5">
                {% block containerright %}
                    <div class="row mt-3 pl-3 pr-3 d-block">
                        {% if messages %}
                            {% for message in messages %}
                                <div class="alert {% if message.tags %} alert-{{ message.tags }}{% endif %} alert-dismissible fade show" role="alert">
                                    {{ message|safe }}
                                    <button type="button" class="close" data-dismiss="alert"
                                            aria-label="Close">
                                        <span aria-hidden="true">&times;</span>
                                    </button>
                                </div>
                            {% endfor %}
                        {% endif %}
                    </div>

                    {% if form.errors %}
                        <p>Seu nome de usuário e senha não coincidem. Por favor, tente novamente.</p>
                    {% endif %}

                    {% if next %}
                        <div class="alert alert-danger alert-dismissible fade show" role="alert">
                            {% if user.is_authenticated %}
                                <p> Sua conta não tem acesso a esta página. Para prosseguir, por favor faça o login com uma
                                    conta que tenha acesso.</p>
                            {% else %}
                                <p>Por favor, faça o login para ver esta página.</p>
                            {% endif %}
                            <button type="button" class="close" data-dismiss="alert"
                                    aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                    {% endif %}
                    <form class="needs-validation was-validated" novalidate method="post">
                        {% csrf_token %}
                        <div class="form-group">
                            <h4>Login</h4>
                            <input name="{{ form.username.html_name }}"
                                   id="{{ form.username.id_for_label }}"
                                   value="{% if form.username.value is not None %}{{ form.username.value }}{% endif %}"
                                   {% if form.username.field.required %}required {% endif %}
                                   type="text" class="form-control" placeholder="Digite seu login">
                            {% if form.username.errors %}
                                {{ form.username.errors }}
                            {% endif %}
                            {% if form.username.help_text %}
                                <small class="form-text text-muted">{{ form.username.help_text|safe }}</small>
                            {% endif %}

                            {% if form.username.field.required %}
                                <div class="invalid-feedback">
                                    {{ form.username.field.error_messages.required }}
                                </div>
                            {% endif %}
                        </div>
                        <div class="form-group">
                            <h4>Senha</h4>
                            <input name="{{ form.password.html_name }}"
                                   id="{{ form.password.id_for_label }}"
                                    {% if form.password.field.required %} required  {% endif %}
                                   type="password" class="form-control" placeholder="Digite sua senha">
                            <small id="emailHelp" class="form-text text-muted">Em caso de esquecimento da senha clique no botão
                                abaixo.
                            </small>
                            {% if form.password.errors %}
                                {{ form.password.errors }}
                            {% endif %}

                            {% if form.password.help_text %}
                                <small class="form-text text-muted">{{ form.password.help_text|safe }}</small>
                            {% endif %}

                            {% if form.password.field.required %}
                                <div class="invalid-feedback">
                                    {{ form.password.field.error_messages.required }}
                                </div>
                            {% endif %}
                        </div>
                        <a href="{% url 'core:password_reset' %}" class="btn btn-danger">Esqueci minha senha</a>
                        <button type="submit" class="btn btn-primary float-right">Acessar</button>
                    </form>
                {% endblock containerright %}
            </div>
        </div>
    {% endblock container %}
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
        integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
        crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
        integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
        crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
        integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
        crossorigin="anonymous"></script>
</body>

</html>

