<!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">
                <div class="d-flex align-items-center justify-content-between mb-4">
                    <h1 class="mb-4" th:text="${titlePage}"></h1>
                    <a th:href="@{/cpr/register}" type="button" class="btn btn-outline-dark" title="Novo">
                        <i class="bi bi-plus-square"></i>
                    </a>
                </div>
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>Código</th>
                        <th>Adtivo</th>
                        <th>Código Contrato</th>
                        <th>Valor Contrato</th>
                        <th>Local Emissão</th>
                        <th>Data Entrega</th>
                        <th>Status</th>
                        <th>Ações</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="object : ${cprRegisters}">
                        <td th:text="${object.id}">0</td>
                        <td th:text="${object.aditivo}">0</td>
                        <td th:text="${object.contratoValorCpr.codigoContratoOperacaoCredito}">0</td>
                        <td th:text="${object.contratoValorCpr.valorTotalCredito}">0</td>

                        <td th:text="${object.emissaoCpr.localEmissao}">0</td>
                        <td th:text="${#temporals.format(object.emissaoCpr.dataEntrega, 'dd/MM/yyyy')}">0</td>

                        <td th:text="${object.status}">0</td>
                        <td>
                            <a th:href="@{'/cpr/register/send/' + ${object.id}}" type="button" class="btn btn-outline-dark"
                               title="Enviar">
                                <i class="bi bi-send"></i>
                            </a>
                            <a th:href="@{'/cpr/register/edit/' + ${object.id}}" type="button" class="btn btn-outline-dark"
                               title="Editar">
                                <i class="bi bi-pencil-square"></i>
                            </a>
                            <a th:href="@{'/cpr/register/remove/' + ${object.id}}" type="button" class="btn btn-outline-dark"
                               title="Remover">
                                <i class="bi bi-dash-square"></i>
                            </a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </section>
    </div>
</div>
</body>
</html>
