Refactor web UI: CSS classes only, no inline styles; fix footer; add full lab1.zip

- Replace all inline style= with reusable CSS classes
- Add layout classes: page, page-header, page-main, page-footer
- Fix footer at bottom via flex column + flex:1 on main
- Remove jsessionid from static resource URLs
- Create lab1-full.zip with 30 variants from PDF metodichka
- All templates use CSS var classes for light/dark theme
This commit is contained in:
2026-09-10 21:29:10 +03:00
parent 2cee104633
commit b48cf1d1e3
10 changed files with 230 additions and 275 deletions

View File

@@ -1,44 +1,25 @@
<!DOCTYPE html>
<html lang="ru" xmlns:th="http://www.thymeleaf.org"
th:replace="~{fragments/base :: layout(~{::title}, ~{::#content})}">
<html lang="ru" xmlns:th="http://www.thymeleaf.org" th:replace="~{fragments/base :: layout(~{::title}, ~{::#content})}">
<head><title>Панель — LMS</title></head>
<body>
<div id="content">
<h1 style="margin:0 0 1.5rem;font-size:1.5rem;font-weight:600;">Панель преподавателя</h1>
<div style="display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(12rem,1fr));">
<div class="card" style="padding:1.5rem;">
<p style="font-size:0.875rem;color:var(--c-text-muted);margin:0;">Группы</p>
<p style="margin:0.5rem 0 0;font-size:1.875rem;font-weight:600;" th:text="${groupCount}">0</p>
</div>
<div class="card" style="padding:1.5rem;">
<p style="font-size:0.875rem;color:var(--c-text-muted);margin:0;">Студенты</p>
<p style="margin:0.5rem 0 0;font-size:1.875rem;font-weight:600;" th:text="${studentCount}">0</p>
</div>
<div class="card" style="padding:1.5rem;">
<p style="font-size:0.875rem;color:var(--c-text-muted);margin:0;">Лабораторные</p>
<p style="margin:0.5rem 0 0;font-size:1.875rem;font-weight:600;color:var(--c-text-muted);">скоро</p>
</div>
<h1 class="page-title">Панель преподавателя</h1>
<div class="grid grid-stats">
<div class="card card-body"><p class="stat-title">Группы</p><p class="stat-value" th:text="${groupCount}">0</p></div>
<div class="card card-body"><p class="stat-title">Студенты</p><p class="stat-value" th:text="${studentCount}">0</p></div>
<div class="card card-body"><p class="stat-title">Лабораторные</p><p class="stat-value text-muted">скоро</p></div>
</div>
<div style="margin-top:2rem;">
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:0.75rem;">
<h2 style="margin:0;font-size:1.125rem;font-weight:500;">Группы</h2>
<a th:href="@{/admin/groups}" style="font-size:0.875rem;">Все группы →</a>
<div class="mt-8">
<div class="flex items-center justify-between mb-4">
<h2 class="section-title">Группы</h2>
<a th:href="@{/admin/groups}" class="text-sm">Все группы →</a>
</div>
<div class="card" style="padding:0;">
<div class="card card-flush">
<table>
<thead>
<tr><th>Название</th><th>Студентов</th></tr>
</thead>
<thead><tr><th>Название</th><th>Студентов</th></tr></thead>
<tbody>
<tr th:each="group : ${groups}">
<td><a th:href="@{/admin/groups/{id}(id=${group.id})}" th:text="${group.name}">—</a></td>
<td th:text="${group.studentCount}">0</td>
</tr>
<tr th:if="${#lists.isEmpty(groups)}">
<td colspan="2" style="text-align:center;color:var(--c-text-muted);padding:1.5rem;">Групп пока нет.</td>
</tr>
<tr th:each="group : ${groups}"><td><a th:href="@{/admin/groups/{id}(id=${group.id})}" th:text="${group.name}">—</a></td><td th:text="${group.studentCount}">0</td></tr>
<tr th:if="${#lists.isEmpty(groups)}"><td colspan="2" class="empty">Групп пока нет.</td></tr>
</tbody>
</table>
</div>

View File

@@ -1,80 +1,40 @@
<!DOCTYPE html>
<html lang="ru" xmlns:th="http://www.thymeleaf.org"
th:replace="~{fragments/base :: layout(~{::title}, ~{::#content})}">
<html lang="ru" xmlns:th="http://www.thymeleaf.org" th:replace="~{fragments/base :: layout(~{::title}, ~{::#content})}">
<head><title th:text="${group.name} + ' — LMS'">Группа</title></head>
<body>
<div id="content">
<a th:href="@{/admin/groups}" style="font-size:0.875rem;">← Все группы</a>
<div style="margin-top:1rem;margin-bottom:1.5rem;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:1rem;">
<div>
<h1 style="margin:0;font-size:1.5rem;font-weight:600;" th:text="${group.name}">Группа</h1>
<p style="margin:0.25rem 0 0;font-size:0.875rem;color:var(--c-text-muted);">
Студентов: <span th:text="${#lists.size(group.students)}">0</span>
</p>
</div>
<div style="display:flex;gap:0.5rem;">
<a class="btn btn-secondary" th:href="@{/admin/groups/{id}/credentials(id=${group.id}, format='xlsx')}">Выгрузить XLSX</a>
<a class="btn btn-secondary" th:href="@{/admin/groups/{id}/credentials(id=${group.id}, format='csv')}">CSV</a>
<a th:href="@{/admin/groups}" class="text-sm">← Все группы</a>
<div class="mt-4 mb-6 flex flex-wrap items-center justify-between gap-4">
<div><h1 class="page-title" th:text="${group.name}">Группа</h1><p class="text-sm text-muted mt-1">Студентов: <span th:text="${#lists.size(group.students)}">0</span></p></div>
<div class="flex gap-2"><a class="btn btn-secondary" th:href="@{/admin/groups/{id}/credentials(id=${group.id}, format='xlsx')}">Выгрузить XLSX</a><a class="btn btn-secondary" th:href="@{/admin/groups/{id}/credentials(id=${group.id}, format='csv')}">CSV</a></div>
</div>
<div th:if="${notice}" class="alert alert-success" th:text="${notice}"></div>
<div th:if="${error}" class="alert alert-error" th:text="${error}"></div>
<div th:if="${resetPassword}" class="alert alert-warning">Новый пароль: <code class="code" th:text="${resetPassword}">password</code></div>
<div th:if="${importResult}" class="card import-card mb-4">
<div class="card-body">
<h2 class="section-title">Импорт: <span th:text="${importResult.groupName}">группа</span></h2>
<p class="text-sm text-muted">Новых студентов: <span th:text="${#lists.size(importResult.added)}">0</span>, обновлено: <span th:text="${#lists.size(importResult.updated)}">0</span>.</p>
<div th:if="${not #lists.isEmpty(importResult.added)}" class="mt-4 overflow-x-auto">
<p class="text-sm alert-warning mini-alert">Сохраните пароли — они показываются для выдачи студентам.</p>
<table><thead><tr><th>ФИО</th><th>Логин</th><th>Пароль</th></tr></thead>
<tbody><tr th:each="credential : ${importResult.added}"><td th:text="${credential.fullName}">—</td><td class="font-mono" th:text="${credential.studentNo}">—</td><td class="font-mono font-semibold" th:text="${credential.password}">—</td></tr></tbody>
</table>
</div>
</div>
</div>
<div th:if="${notice}" style="margin-bottom:1rem;padding:0.75rem 1rem;border-radius:0.5rem;font-size:0.875rem;background:#dcfce7;color:#166534;" th:text="${notice}"></div>
<div th:if="${error}" style="margin-bottom:1rem;padding:0.75rem 1rem;border-radius:0.5rem;font-size:0.875rem;background:#fef2f2;color:#991b1b;" th:text="${error}"></div>
<div th:if="${resetPassword}" style="margin-bottom:1rem;padding:0.75rem 1rem;border-radius:0.5rem;font-size:0.875rem;background:#fef3c7;color:#92400e;">
Новый пароль: <code style="padding:0.125rem 0.5rem;border-radius:0.25rem;font-family:monospace;" th:text="${resetPassword}">password</code>
</div>
<div th:if="${importResult}" class="card" style="margin-bottom:1.5rem;padding:1.5rem;">
<h2 style="margin:0 0 0.25rem;font-size:1.125rem;font-weight:500;">
Импорт: <span th:text="${importResult.groupName}">группа</span>
</h2>
<p style="margin:0;font-size:0.875rem;color:var(--c-text-muted);">
Новых студентов: <span th:text="${#lists.size(importResult.added)}">0</span>,
обновлено: <span th:text="${#lists.size(importResult.updated)}">0</span>.
</p>
<div th:if="${not #lists.isEmpty(importResult.added)}" style="margin-top:1rem;overflow-x:auto;">
<p style="margin:0 0 0.5rem;font-size:0.875rem;color:#92400e;">Сохраните пароли — они показываются для выдачи студентам.</p>
<table>
<thead>
<tr><th>ФИО</th><th>Логин</th><th>Пароль</th></tr>
</thead>
<tbody>
<tr th:each="credential : ${importResult.added}">
<td th:text="${credential.fullName}">—</td>
<td style="font-family:monospace;" th:text="${credential.studentNo}">—</td>
<td style="font-family:monospace;font-weight:600;" th:text="${credential.password}">—</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="card" style="padding:0;">
<table>
<thead>
<tr><th>№</th><th>ФИО</th><th>Логин</th><th>Основа</th><th>Пароль</th><th></th></tr>
</thead>
<div class="card card-flush">
<table><thead><tr><th>№</th><th>ФИО</th><th>Логин</th><th>Основа</th><th>Пароль</th><th></th></tr></thead>
<tbody>
<tr th:each="student, iter : ${group.students}">
<td style="color:var(--c-text-muted);" th:text="${iter.count}">1</td>
<td class="text-muted" th:text="${iter.count}">1</td>
<td th:text="${student.fullName}">—</td>
<td style="font-family:monospace;" th:text="${student.studentNo}">—</td>
<td style="color:var(--c-text-muted);" th:text="${student.basis}">—</td>
<td>
<span th:if="${student.mustChangePassword}" class="badge badge-warn">временный</span>
<span th:unless="${student.mustChangePassword}" class="badge badge-ok">изменён</span>
</td>
<td style="text-align:right;">
<form th:action="@{/admin/groups/{gid}/students/{sid}/reset-password(gid=${group.id}, sid=${student.id})}" method="post">
<button type="submit" style="font-size:0.875rem;border:none;background:none;cursor:pointer;color:var(--c-text-link);">Сбросить пароль</button>
</form>
</td>
</tr>
<tr th:if="${#lists.isEmpty(group.students)}">
<td colspan="6" style="text-align:center;color:var(--c-text-muted);padding:1.5rem;">В группе пока нет студентов.</td>
<td class="font-mono" th:text="${student.studentNo}">—</td>
<td class="text-muted" th:text="${student.basis}">—</td>
<td><span th:if="${student.mustChangePassword}" class="badge badge-warn">временный</span><span th:unless="${student.mustChangePassword}" class="badge badge-ok">изменён</span></td>
<td class="text-center"><form th:action="@{/admin/groups/{gid}/students/{sid}/reset-password(gid=${group.id}, sid=${student.id})}" method="post"><button type="submit" class="nav-link">Сбросить</button></form></td>
</tr>
<tr th:if="${#lists.isEmpty(group.students)}"><td colspan="6" class="empty">В группе пока нет студентов.</td></tr>
</tbody>
</table>
</div>

View File

@@ -1,59 +1,35 @@
<!DOCTYPE html>
<html lang="ru" xmlns:th="http://www.thymeleaf.org"
th:replace="~{fragments/base :: layout(~{::title}, ~{::#content})}">
<html lang="ru" xmlns:th="http://www.thymeleaf.org" th:replace="~{fragments/base :: layout(~{::title}, ~{::#content})}">
<head><title>Группы — LMS</title></head>
<body>
<div id="content">
<h1 style="margin:0 0 1.5rem;font-size:1.5rem;font-weight:600;">Группы</h1>
<div th:if="${notice}" style="margin-bottom:1rem;padding:0.75rem 1rem;border-radius:0.5rem;font-size:0.875rem;background:#dcfce7;color:#166534;" th:text="${notice}"></div>
<div th:if="${error}" style="margin-bottom:1rem;padding:0.75rem 1rem;border-radius:0.5rem;font-size:0.875rem;background:#fef2f2;color:#991b1b;" th:text="${error}"></div>
<div style="display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(22rem,1fr));">
<form class="card" style="padding:1.5rem;display:flex;flex-direction:column;gap:1rem;" th:action="@{/admin/groups}" method="post">
<h2 style="margin:0;font-size:1.125rem;font-weight:500;">Создать группу</h2>
<div>
<label class="label" for="name">Название</label>
<input class="input" id="name" name="name" placeholder="ПИ-11БО" required>
</div>
<h1 class="page-title">Группы</h1>
<div th:if="${notice}" class="alert alert-success" th:text="${notice}"></div>
<div th:if="${error}" class="alert alert-error" th:text="${error}"></div>
<div class="grid grid-2">
<form class="card form-card form-stack" th:action="@{/admin/groups}" method="post">
<h2 class="section-title">Создать группу</h2>
<div><label class="label" for="name">Название</label><input class="input" id="name" name="name" placeholder="ПИ-11БО" required></div>
<button class="btn btn-primary" type="submit">Создать</button>
</form>
<form class="card" style="padding:1.5rem;display:flex;flex-direction:column;gap:1rem;" th:action="@{/admin/groups/import}" method="post" enctype="multipart/form-data">
<h2 style="margin:0;font-size:1.125rem;font-weight:500;">Импорт студентов</h2>
<p style="margin:0;font-size:0.875rem;color:var(--c-text-muted);">
Файл .xls, .xlsx или .csv со столбцами: студенческий номер, ФИО, основа обучения.
</p>
<div>
<label class="label" for="file">Файл со списком</label>
<input class="input" id="file" name="file" type="file" accept=".xls,.xlsx,.csv" required>
</div>
<div>
<label class="label" for="groupName">Название группы (необязательно)</label>
<input class="input" id="groupName" name="name" placeholder="Возьмём из файла">
</div>
<form class="card form-card form-stack" th:action="@{/admin/groups/import}" method="post" enctype="multipart/form-data">
<h2 class="section-title">Импорт студентов</h2>
<p class="text-sm text-muted">Файл .xls, .xlsx или .csv со столбцами: студенческий номер, ФИО, основа обучения.</p>
<div><label class="label" for="file">Файл со списком</label><input class="input" id="file" name="file" type="file" accept=".xls,.xlsx,.csv" required></div>
<div><label class="label" for="groupName">Название группы (необязательно)</label><input class="input" id="groupName" name="name" placeholder="Возьмём из файла"></div>
<button class="btn btn-primary" type="submit">Импортировать</button>
</form>
</div>
<div class="card" style="margin-top:2rem;padding:0;">
<div class="card card-flush mt-8">
<table>
<thead>
<tr><th>Название</th><th>Студентов</th><th>Выгрузка</th></tr>
</thead>
<thead><tr><th>Название</th><th>Студентов</th><th>Выгрузка</th></tr></thead>
<tbody>
<tr th:each="group : ${groups}">
<td><a th:href="@{/admin/groups/{id}(id=${group.id})}" th:text="${group.name}">—</a></td>
<td th:text="${group.studentCount}">0</td>
<td>
<a th:href="@{/admin/groups/{id}/credentials(id=${group.id}, format='xlsx')}">XLSX</a>
<span style="margin:0 0.5rem;color:var(--c-text-muted);">·</span>
<a th:href="@{/admin/groups/{id}/credentials(id=${group.id}, format='csv')}">CSV</a>
</td>
</tr>
<tr th:if="${#lists.isEmpty(groups)}">
<td colspan="3" style="text-align:center;color:var(--c-text-muted);padding:1.5rem;">Групп пока нет.</td>
<td><a th:href="@{/admin/groups/{id}/credentials(id=${group.id}, format='xlsx')}">XLSX</a><span class="nav-sep ml-2">·</span><a class="ml-2" th:href="@{/admin/groups/{id}/credentials(id=${group.id}, format='csv')}">CSV</a></td>
</tr>
<tr th:if="${#lists.isEmpty(groups)}"><td colspan="3" class="empty">Групп пока нет.</td></tr>
</tbody>
</table>
</div>