60 lines
3.9 KiB
HTML
60 lines
3.9 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="ru" xmlns:th="http://www.thymeleaf.org" th:replace="~{fragments/base :: layout(~{::title}, ~{::#content})}">
|
||
<head><title th:text="${lab.title} + ' — LMS'">Лабораторная</title></head>
|
||
<body>
|
||
<div id="content">
|
||
<a th:href="@{/admin/labs}" class="nav-link">← Все лабораторные</a>
|
||
<div class="flex flex-wrap items-center justify-between gap-4 mt-4 mb-6">
|
||
<div>
|
||
<h1 class="page-title" th:text="|ЛР ${lab.number}. ${lab.title}|">ЛР 1</h1>
|
||
<div class="text-sm text-muted">
|
||
Статус: <span class="badge"
|
||
th:classappend="${lab.status == 'published'} ? 'badge-ok' : 'badge-warn'"
|
||
th:text="${lab.status == 'published'} ? 'Опубликована' : (${lab.status == 'archived'} ? 'В архиве' : 'Черновик')">draft</span>
|
||
<form class="inline-form" th:action="@{/admin/labs/{id}/toggle-status(id=${lab.id})}" method="post" data-confirm="Сменить статус лабораторной? Опубликованную увидят студенты, черновик — перестанут.">
|
||
<input type="hidden" name="_csrf" th:value="${csrfToken}">
|
||
<button class="btn btn-secondary" type="submit"
|
||
th:text="${lab.status == 'published'} ? 'Скрыть' : 'Опубликовать'">Опубликовать</button>
|
||
</form>
|
||
<span th:if="${deadlineMsk != null}"> · Срок: <span th:text="${deadlineMsk} + ' МСК'"></span></span>
|
||
<span th:if="${defenseMsk != null}"> · Защита: <span th:text="${defenseMsk} + ' МСК'"></span></span>
|
||
· Максимум: <span th:text="${lab.pointsMax}"></span> б.
|
||
<span th:if="${totalVariants > 0}"> · Вариантов занято: <span th:text="${occupiedVariants}"></span> из <span th:text="${totalVariants}"></span></span>
|
||
<span th:if="${submissionCount > 0}"> · Сдач: <span th:text="${submissionCount}"></span></span>
|
||
</div>
|
||
</div>
|
||
<div class="flex gap-2">
|
||
<a class="btn btn-secondary" th:href="@{/admin/labs/{id}/edit(id=${lab.id})}">Редактировать</a>
|
||
</div>
|
||
</div>
|
||
|
||
<h2 class="section-title">Условие лабораторной</h2>
|
||
<div class="card card-body md-body mb-6" th:utext="${descriptionHtml}"></div>
|
||
|
||
<h2 class="section-title">Уровни и варианты</h2>
|
||
<div th:if="${#lists.isEmpty(lab.levels)}" class="card card-body text-muted">Уровней пока нет — добавьте на экране настройки.</div>
|
||
<div th:each="level : ${lab.levels}" class="card mb-4">
|
||
<div class="card-body">
|
||
<div class="flex flex-wrap items-center justify-between gap-4 mb-2">
|
||
<h3 class="section-title" th:text="${level.title}">Уровень</h3>
|
||
<span class="text-sm text-muted" th:text="|Вариантов: ${#lists.size(level.variants)}|">0</span>
|
||
</div>
|
||
<div class="scroll-x">
|
||
<table>
|
||
<thead><tr><th class="th-w-sm">№</th><th class="th-w-md">Название</th><th>Условие</th></tr></thead>
|
||
<tbody>
|
||
<tr th:each="v : ${level.variants}">
|
||
<td class="font-mono" th:text="${v.number}">1</td>
|
||
<td th:text="${v.title}">—</td>
|
||
<td class="text-muted preview" th:text="${#strings.abbreviate(v.statementMd, 70)}">—</td>
|
||
</tr>
|
||
<tr th:if="${#lists.isEmpty(level.variants)}"><td colspan="3" class="empty">Вариантов нет.</td></tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html>
|