<!DOCTYPE html>
<html lang="fr" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="fragments.html :: head(#{company.delete.title}, null)"></th:block>

    <style>
        table {
            margin: auto;
        }

        th {
            padding-right: 50px;
        }

        td {
            text-align: left;
        }
    </style>
</head>
<body>

<!-- Fragment de l'entête -->
<header th:include="fragments.html :: header(false)"></header>
<!-- Corps de la page -->
<section>
    <div th:include="fragments.html :: messages"></div>
    <h1 th:text="#{company.delete.title}"></h1>

    <form action="/company/remover/" class="requireAuth-remover" method="POST">
        <th:block th:if="${!companies.empty}">
            <table id="companiesList">
                <tr>
                    <th th:text="#{company.form.companyName}"></th>
                    <th></th>
                </tr>
                <th:block th:each="company : ${companies}">
                    <tr>
                        <td th:text="${company.name}"></td>
                        <td>
                            <button class="remover" th:data-code="${company.name}"
                                    th:data-entityId="${company.id}"
                                    type="button" th:text="#{keyword.delete}"></button>
                        </td>
                    </tr>
                </th:block>
            </table>
        </th:block>
    </form>
    <th:block th:if="${companies.empty}">
        <b class="error" th:text="#{company.error.anyFound}"></b>
    </th:block>
</section>
<!-- Fragment du pied de page -->
<footer th:include="fragments.html :: footer('/company/remover', true)"></footer>

</body>
</html>
