<!DOCTYPE html>
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">

<head>
    <title>Панель администратора (категории)</title>
</head>

<body th:with="bodyClass='bg-white', mainClass='my-0'">
    <main layout:fragment="content">
        <div class="row justify-content-center">
            <form class="col-lg-8 col-xl-7 col-xxl-6" action="#"
                th:action="@{/admin/category/edit/{id}(id=${category.id})}" th:object="${category}" method="post" >
                <div class="mb-4 mt-4">
                    <label for="id" class="form-label">ID</label>
                    <input type="text" th:value="*{id}" id="id" class="form-control" readonly disabled>
                </div>
                <div class="mb-4">
                    <label class="form-label" for="name">Название категории</label>
                    <input id="name" th:field="*{name}" class="form-control" type="text">
                    <div th:if="${#fields.hasErrors('name')}" th:errors="*{name}" class="invalid-feedback"></div>
                </div>
                <div class="d-flex flex-column align-items-center mb-5">
                    <button class="btn btn-primary w-50 rounded-5 edit-btn" type="submit" id="add-btn">Сохранить категорию</button>
                    <a class="btn btn-secondary w-25 mt-4 edit-btn"
                        href="/admin/category">Отмена</a>
                </div>
            </form>
        </div>
    </main>
</body>

</html>