2023-06-20 12:22:08 +04:00

32 lines
1.2 KiB
HTML

<!DOCTYPE html>
<html lang="en"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{default}">
<body>
<div class="container container-padding" layout:fragment="content">
<form action="#" th:action="@{/topic/create}" th:object="${topicDto}" method="post">
<p>Название:</p>
<input th:field="${topicDto.name}" type="text" class="mb-2 form-control" required="true" />
<p>Описание:</p>
<input th:field="${topicDto.description}" type="text" class="mb-2 form-control" required="true" />
<button type="submit" class="btn btn-success">Добавить</button>
</form>
<div th:each="topic: ${topics}" class="border p-3 m-3 shadow-lg bg-body rounded">
<div th:text="${'Топик: ' + topic.name}"></div>
<div th:text="${'Описание: ' + topic.description}"></div>
<form action="#" th:action="@{/topic/edit/{id} (id=${topic.id})}" method="get" class="text-end m-1">
<button type="submit" class="btn btn-warning">Изменить</button>
</form>
<form action="#" th:action="@{/topic/delete/{id} (id=${topic.id})}" method="post" class="text-end m-1">
<button type="submit" class="btn btn-danger" >Удалить</button>
</form>
</div>
</div>
</body>
</html>