<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Supprimer des bannières</title>

    <link href="/css/main.css" rel="stylesheet"/>
    <link href="/css/forms.css" rel="stylesheet"/>

    <style>
        table {
            margin: auto;
        }

        th {
            padding-right: 50px;
        }

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

<section>
    <p class="error" th:text="${error}"></p>
    <p class="success" th:if="${successCompanyName != null}"
       th:text="'La bannière \'' + ${successCompanyName} + '\' a bien été supprimée.'"></b>
    </p>
    <h1>Supprimer des bannières</h1>

    <form action="/company/remover/" class="requireAuth-remover" method="POST">
        <th:block th:if="${!companies.empty}">
            <table id="companiesList">
                <tr>
                    <th>Nom de la bannière</th>
                </tr>
                <th:block th:each="company : ${companies}">
                    <tr>
                        <td th:text="${company.companyName}"></td>
                        <td>
                            <button class="remover" th:data-code="${company.companyName}"
                                    th:data-recipeID="${company.companyID}"
                                    type="button">Supprimer
                            </button>
                        </td>
                    </tr>
                </th:block>
            </table>
        </th:block>
    </form>
    <th:block th:if="${companies.empty}">
        <b class="error">Aucune bannière n'a été trouvée.</b>
    </th:block>
</section>

<script src="/js/main.js"></script>
</body>
</html>