<!DOCTYPE html>
<html lang="en"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{default}">
<head>
    <link th:href="@{/styles/login.css}" rel="stylesheet" />
</head>
<body>
<div class="container-fluid" layout:fragment="content">
    <div th:if="${param.error}" class="alert alert-danger margin-bottom">
        Пользователь не найден или пароль указан не верно
    </div>
    <div th:if="${param.logout}" class="alert alert-success margin-bottom">
        Выход успешно произведен
    </div>
    <div th:if="${param.created}" class="alert alert-success margin-bottom">
        Пользователь '<span th:text="${param.created}"></span>' успешно создан
    </div>
    <div class="row justify-content-center align-items-center vh-100">
        <div class="col-sm-6 col-md-4">
            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">Авторизация</h5>
                    <form th:action="@{/login}" method="post">
                        <div class="mb-3">
                            <label htmlFor="login">Логин</label>
                            <input type="text" name="username" id="username" class="form-control"
                                   placeholder="Логин" required="true" autofocus="true"/>
                        </div>
                        <div class="mb-3">
                            <label htmlFor="login">Пароль</label>
                            <input type="password" name="password" id="password" class="form-control"
                                   placeholder="Пароль" required="true"/>
                        </div>
                        <button type="submit" class="btn btn-primary button-fixed">Войти</button>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
</body>
</html>