<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
    <head>
        <th:block th:insert="~{fragments/header}"></th:block>
        <link rel="stylesheet" href="/static/css/util.css">
        <link href="/static/css/sign-up.css" rel="stylesheet">
    </head>
    <body class="d-flex align-items-center py-4 bg-body-tertiary">
        <div th:replace="~{fragments/floating_button}"></div>

        <main class="form-signup w-100 m-auto">
            <div th:if="${param.error}">
                <div class="alert alert-danger" role="alert" th:text="#{incorcred}">

                </div>
            </div>

            <div th:if="${error}">
                <div class="alert alert-danger" role="alert" th:text="#{incorcred}">

                </div>
            </div>

            <form method="post" th:action="@{/signup}" th:object="${user}">
                <h1 class="h3 mb-3 fw-normal" th:text="#{signup}"></h1>

                <div class="form-floating">
                    <input type="text" name="username" class="form-control" id="floatingInput" placeholder="Username">
                    <label for="floatingInput" th:text="#{nname}"></label>
                </div>

                <div class="form-floating mt-1">
                    <input type="password" name="password" class="form-control" id="floatingPassword" placeholder="Password">
                    <label for="floatingPassword" th:text="#{pass}"></label>
                </div>

                <div class="form-floating mt-1">
                    <input type="text" name="invite_code" class="form-control" id="floatingInvite" placeholder="Invite code">
                    <label for="floatingInvite" th:text="#{invitecode}"></label>
                </div>

                <button class="btn btn-primary w-100 py-2 mt-3" type="submit" th:text="#{signup}"></button>

                <p class="mt-3"><a th:href="@{/login}" class="link-primary" th:text="#{signin}"></a></p>

                <p class="mb-3 text-body-secondary">&copy; alterdekim 2023</p>
            </form>
        </main>
        <div th:replace="~{fragments/footer :: div}"></div>
    </body>
</html>