<!DOCTYPE html>
<html lang="en" xmlns:th="http://thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Prijava</title>
    <link rel="stylesheet" type="text/css" href="/webjars/bootstrap/css/bootstrap.min.css"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
          integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
          crossorigin="anonymous" />
</head>
<body>
    <div class="container text-center">
        <h1>Prijava</h1>


        <form th:action="@{/login}" method="post" style="max-width: 600px; margin: 0 auto;">
            <div class="m-3">
                <div th:if="${param.error}">
                    <p class="text-danger" th:if="${session.SPRING_SECURITY_LAST_EXCEPTION.message}=='Bad credentials'">Netacan e-mail ili lozinka.</p>
                    <p class="text-danger" th:if="${session.SPRING_SECURITY_LAST_EXCEPTION.message}=='User is disabled'">Jos nije odobren vas zahtev za administrativni nalog.</p>
                </div>

                <div th:if="${param.logout}">
                    <p class="text-warning">.</p>
                </div>

                <div>
                    <div class="form-group row">
                        <label class="col-form-label col-4">E-mail:</label>
                        <div class="col-8">
                            <input id="email" type="email" class="form-control" name="email" required minlength="3" maxlength="44"/>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-form-label col-4">Lozinka:</label>
                        <div class="col-8">
                            <input type="password" class="form-control" name="password" required minlength="8" maxlength="44"/>
                        </div>
                    </div>
                    <div>
                        <button type="submit" class="btn btn-primary">Prijavi se</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</body>
</html>