<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity5" lang="en">
<head th:replace="fragments/loggedInNav :: head(~{::title}, ~{}, ~{})">
    <meta charset="UTF-8">
    <title>ITems | HR Document</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

</head>

<body>


<div th:block sec:authorize="!isAuthenticated()" th:replace="fragments/loggedOutNav :: nav(~{::navbar})"></div>
<div th:block sec:authorize="isAuthenticated()" th:replace="fragments/loggedInNav :: nav(~{::navbar})"></div>

<header class="masthead bg-light mb-3 border-bottom" >
    <div class="container">
        <div class="row gx-4 gx-lg-5 justify-content-center text-center">
            <div class="col-md-10 col-lg-8 col-xl-7">
                <div class="site-heading">
                    <h1 class="mt-5">ITems</h1>
                    <p class="mb-5">
                        <span class="subheading">HR Document Submission</span>
                    </p>
                </div>
            </div>
        </div>
    </div>
</header>
<main>
    <div class="container d-flex justify-content-center align-items-center">
        <div class="border rounded-2 p-3 m-5 bg-light card-lg w-50">
            <form th:action="@{/saveDocument}" th:object="${document}" method="POST" class="form justify-center" enctype="multipart/form-data">
                <div class="row g-3 align-items-center">
                    <div class="col form-floating mb-3">
                        <input type="file"  accept="application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" name="documents" placeholder="Submit document" id="floatingDocument" class="form-control form-control-sm col-2 mb-4" required/>
                        <label for="floatingDocument">Submit Document</label>
                    </div>
                </div>
                <button class="btn btn-info" type="submit">Save</button>
            </form>
            <hr>
        </div>
    </div>
</main>

<div th:block th:replace="fragments/loggedInNav :: footer(~{::footer})"></div>

</body>
</html>