<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{default}">
<head>
    <link rel="stylesheet" href="/css/client.css"/>
</head>
<body>
<div layout:fragment="content">
    <div class="Group_create_level">
        <h1>Генератор клиентов</h1>
    </div>
    <form action="#" th:action="@{/client/{id}(id=${id})}" th:object="${supportClientDTO}" method="post">
        <div class="myModalContent">
            <label for="name" class="form-label">Никнейм: </label>
            <input
                    type='text'
                    class="add-nation-input form-control"
                    id="name"
                    th:field="${supportClientDTO.nickName}"
                    required="true"
            />
            <label for="email" class="form-label">Почта: </label>
            <input
                    type='text'
                    class="add-nation-input form-control"
                    id="email"
                    th:field="${supportClientDTO.email}"
                    required="true"
            />
            <label for="balance" class="form-label">Баланс: </label>
            <input
                    type='text'
                    class="add-nation-input form-control"
                    id="balance"
                    th:field="${supportClientDTO.balance}"
                    required="true"
            />
            <label for="name" class="form-label">Танк: </label>
            <select id="level" class="form-select" th:field="${supportClientDTO.tankId}"  required="true">
                <option th:each="value: ${tanks}"
                        th:value="${value.id}"
                        th:text="${value.name}">
                </option>
            </select>
            <button
                    class="modalButton"
                    type="submit"
            >
                <span th:if="${id == null}">Добавить</span>
                <span th:if="${id != null}">Сохранить</span>
            </button>
            <button
                    class="modalButton"
                    type="submit"
                    th:href="@{/client}"
            >
                Назад
            </button>
        </div>
    </form>
</div>
</body>
</html>