<!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/1/manga/{id}(id=${mangaId})}" th:object="${MangaDto}" enctype="multipart/form-data" method="post">
        <div class="mb-3" th:if="${creatorId != null}">
            <label for="chapterCount" class="form-label">mangaName</label>
            <input id="mangaName" type='text' value 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' value class="form-control" th:field="${MangaDto.chapterCount}" required="true"/>
        </div>
        <div class="mb-3">
            <label for="image" class="form-label">image</label>
            <input type="file" id="image" name="image" accept="image/png, image/jpeg" />
            <!--<input id="image" type="file" name="image" class="form-control text-white" accept="image/png, image/jpeg" th:field="${MangaDto.image}" required="true"/>-->
        </div>
        <div class="mb-3">
            <button type="submit" class="btn btn-primary button-fixed">
                <span th:if="${creatorId != null}">Добавить</span>
                <span th:if="${creatorId == null}">Обновить</span>
            </button>
            <a class="btn btn-secondary button-fixed" th:href="@{/creator}">
                Назад
            </a>
        </div>
    </form>
</div>
</body>
</html>