<!DOCTYPE html>
<html lang="en"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{default}">
<head>
</head>
<body>
<div layout:fragment="content">
    <div th:text="${errors}" class="margin-bottom alert-danger"></div>
    <form action="#" th:action="@{/creatorAction/{controller}{id}(id=${id}, controller=${controller})}" th:object="${mangaDto}" enctype="multipart/form-data" method="post">
        <div class="mb-3" th:if="${controller == 'creator/'}">
            <label for="mangaName" class="form-label">mangaName</label>
            <input id="mangaName" type='text' class="form-control" th:field="${mangaDto.mangaName}" required="true"/>
        </div>
        <div class="mb-3">
            <label for="chapterCount" class="form-label">chapterCount</label>
            <input id="chapterCount" type='number' class="form-control" th:field="${mangaDto.chapterCount}" required="true"/>
        </div>

        <div class="mb-3">
            <label for="multipartFile" class="form-label">image</label>
            <input type="file" id="multipartFile" th:name="multipartFile" accept="image/png, image/jpeg" class="form-control" required="true"/>
        </div>
        <div class="mb-3">
            <button type="submit" class="btn btn-primary button-fixed">
                <span th:if="${controller == 'creator/'}">Добавить</span>
                <span th:if="${controller != 'creator/'}">Обновить</span>
            </button>
            <a class="btn btn-secondary button-fixed" th:href="@{/creator}">
                Назад
            </a>
        </div>
    </form>
</div>
</body>
</html>