Table columns: dropdown/text filters per column

- tablekit builds a filter row under the headers for every th with data-filter;
  distinct cell values become a select (label from data-filter-label), or a
  text substring filter with data-filter="text"
- filters combine with the global table search; placeholder rows (colspan) are
  not filtered away; filter row follows the lab-focus column hiding
- enabled on: matrix lab columns (by variant), defense table (ЛР, status with
  readable values), students (Основа, Пароль), lab assignment lists (Уровень,
  Источник, Сдача), labs list (Статус)
This commit is contained in:
2026-09-15 22:43:48 +03:00
parent b212eed546
commit aa1fb5c791
6 changed files with 150 additions and 36 deletions

View File

@@ -81,8 +81,8 @@
<div class="scroll-x">
<table class="tablekit" th:attr="id='assign-table-' + ${gStat.index}">
<thead><tr>
<th class="th-w-sm" data-nosort>Выбор</th><th class="th-sortable is-asc" title="ФИО — по возрастанию">Студент</th><th class="th-w-md">Уровень</th><th class="th-w-md">Вариант</th>
<th class="th-w-sm">Источник</th><th>Сдача</th>
<th class="th-w-sm" data-nosort>Выбор</th><th class="th-sortable is-asc" title="ФИО — по возрастанию">Студент</th><th class="th-w-md" data-filter>Уровень</th><th class="th-w-md">Вариант</th>
<th class="th-w-sm" data-filter>Источник</th><th data-filter>Сдача</th>
</tr></thead>
<tbody>
<tr th:each="s : ${g.students}">
@@ -125,7 +125,7 @@
<span class="badge" th:classappend="${s.source == 'вручную'} ? 'badge-ok' : 'badge-warn'"
th:text="${s.source}">авто</span>
</td>
<td>
<td th:attr="data-filter-value=${s.submissionId != null ? 'сдано' : 'нет'}">
<a th:if="${s.submissionId}" class="cell-link"
th:href="'/admin/submissions/' + ${s.submissionId} + '/download'">
попытка <span th:text="${s.submissionSeq}">1</span> ↓</a>