PIbd-22_Puchkina_Internet_P.../lab4-5/bin/main/templates/profile.html
2024-06-04 18:42:33 +04:00

57 lines
2.6 KiB
HTML

<!DOCTYPE html>
<html lang="ru" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{default}">
<head>
<title>Личный кабинет</title>
</head>
<body>
<main layout:fragment="content">
<ul class="nav nav-pills justify-content-center" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-bs-toggle="pill" href="#orders">Заказы</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="pill" href="#stats">Статистика</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="pill" href="#subscriptions">Списки рассылок</a>
</li>
</ul>
<div class="tab-content mt-2">
<div class="tab-pane container active" id="orders">
<th:block th:replace="~{ orders :: orders (
items=${items},
totalPages=${totalPages},
currentPage=${currentPage}) }" />
</div>
<div class="tab-pane container fade" id="stats">
<ul class="list-group mb-2">
<li th:each="stat : ${stats}" class="list-group-item">
<strong>[[${stat.typeName}]]</strong>:
[[${#numbers.formatDecimal(stat.totalPrice, 1, 2)}]] &#8381;
([[${stat.totalCount}]] шт.)
</li>
</ul>
</div>
<div class="tab-pane container fade" id="subscriptions">
<form action="#" th:action="@{/}" th:object="${profile}" method="post">
<div class="form-check" th:each="subscription, item : *{subscriptions}"
th:with="id=${'sub-' + subscription.id}">
<input class="form-check-input" type="hidden" th:for="${id}"
th:field="*{subscriptions[__${item.index}__].id}">
<input class="form-check-input" type="checkbox" th:for="${id}"
th:field="*{subscriptions[__${item.index}__].active}">
<label class="form-check-label" for="" th:for="${id}">
[[${subscription.name}]]
</label>
</div>
<button type="submit" class="btn btn-primary button-fixed-width">Сохранить</button>
</form>
</div>
</div>
</main>
</body>
</html>