<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/head :: head}">
    <meta charset="UTF-8">
    <title>Too Easy</title>
</head>
<body>
<div th:replace="~{layout}">
    <div th:fragment="content">
        <section>
            <div class="container p-4 shadow bg-white rounded">
                <h1 class="mb-4" th:text="${titlePage}"></h1>
                <form th:object="${cprRegister}">
                    <div class="mb-3">
                        <input hidden="true" th:field="*{id}">

                        <label class="form-label" for="aditivo">Aditivo</label>
                        <input class="form-control" id="aditivo" th:field="*{aditivo}" required>

                        <label class="form-label" for="contratoValorCpr">Código Contrato</label>
                        <select class="form-select" id="contratoValorCpr" th:field="*{contratoValorCpr}" required>
                            <option value="" selected="selected">Selecione...</option>
                            <option th:each="contract : ${contracts}"
                            th:value="${contract.id}"
                            th:text="${contract.codigoContratoOperacaoCredito}">
                        </select>

                        <label class="form-label" for="emissaoCpr">Emissor</label>
                        <select class="form-select" id="emissaoCpr" th:field="*{emissaoCpr}" required>
                            <option value="" selected="selected">Selecione...</option>
                            <option th:each="emission : ${emissions}"
                            th:value="${emission.id}"
                            th:text="${emission.razaoSocialEmissor}">
                        </select>

                        <label class="form-label" for="status">Status</label>
                        <input class="form-control" id="status" th:field="*{status}" disabled>

                    </div>

                    <button class="btn btn-dark" formmethod="post" th:formaction="@{/cpr/register}" type="submit">Salvar</button>

                </form>
            </div>
        </section>
    </div>
</div>
</body>
</html>