Phase 6: accordion in /learn; README feature notes; tests green
- collapse chapters/sections via styled <details> with chevrons - identity testcontainers smoke passes on JDK 21 - README: student UX, comments, JDK note (logback ThrowableProxy in fat-jars → restart recovery), data dirs
This commit is contained in:
@@ -18,8 +18,12 @@
|
||||
Материалы ещё не добавлены.
|
||||
</div>
|
||||
|
||||
<div th:each="chapter : ${tree?.chapters}" class="card mb-4">
|
||||
<div class="card-body">
|
||||
<details th:each="chapter : ${tree?.chapters}" class="card mb-4 accordion" open>
|
||||
<summary class="card-body acc-head">
|
||||
<h2 class="section-title acc-title" th:text="${chapter.title}">Глава</h2>
|
||||
<span class="acc-arrow" aria-hidden="true"></span>
|
||||
</summary>
|
||||
<div class="card-body acc-body">
|
||||
<div class="flex flex-wrap items-center justify-between gap-4 mb-4">
|
||||
<h2 class="section-title" th:text="${chapter.title}">Глава</h2>
|
||||
<div th:if="${currentUser != null and currentUser.admin}" class="flex flex-wrap gap-2">
|
||||
@@ -35,20 +39,24 @@
|
||||
|
||||
<p th:if="${#lists.isEmpty(chapter.sections)}" class="text-sm text-muted">Разделов пока нет</p>
|
||||
|
||||
<div th:each="section : ${chapter.sections}" class="mt-4">
|
||||
<div class="flex flex-wrap items-center justify-between gap-4">
|
||||
<h3 class="group-title">
|
||||
<details th:each="section : ${chapter.sections}" class="mt-4 sub-acc" open>
|
||||
<summary class="sub-head">
|
||||
<h3 class="group-title m-0">
|
||||
<span class="sub-arrow" aria-hidden="true"></span>
|
||||
<a th:href="@{/learn/{c}/{s}(c=${chapter.slug}, s=${section.slug})}" th:text="${section.title}">Раздел</a>
|
||||
</h3>
|
||||
</summary>
|
||||
<div class="flex flex-wrap items-center justify-between gap-4 sub-actions">
|
||||
<div class="spacer"></div>
|
||||
<div th:if="${currentUser != null and currentUser.admin}" class="flex flex-wrap gap-2">
|
||||
<button class="btn btn-secondary btn-sm" type="button"
|
||||
th:data-modal="|modal-rename-section-${section.id}|" onclick="openModalData(this)">Переименовать</button>
|
||||
<button class="btn btn-secondary btn-sm" type="button"
|
||||
th:data-modal="|modal-move-${section.id}|" onclick="openModalData(this)">Перенести статьи</button>
|
||||
<form th:action="@{/admin/content/sections/{id}/delete(id=${section.id})}" method="post"
|
||||
<form class="inline-form" th:action="@{/admin/content/sections/{id}/delete(id=${section.id})}" method="post"
|
||||
onsubmit="return confirm('Удалить раздел со всеми статьями?')">
|
||||
<input type="hidden" name="_csrf" th:value="${csrfToken}">
|
||||
<button class="btn btn-danger btn-sm" type="submit">Удалить</button>
|
||||
<button class="btn btn-danger btn-sm" type="submit">Удалить раздел</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -105,8 +113,7 @@
|
||||
</div>
|
||||
</dialog>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
</details>
|
||||
<th:block th:if="${currentUser != null and currentUser.admin}">
|
||||
<dialog th:id="|modal-rename-chapter-${chapter.id}|" class="modal">
|
||||
<div class="modal-header">
|
||||
@@ -125,7 +132,7 @@
|
||||
</dialog>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<dialog id="modal-import" class="modal">
|
||||
<div class="modal-header">
|
||||
|
||||
Reference in New Issue
Block a user