Group page: B3 layout (page-head, toolbar, matrix), neutral header with accent logo dot
This commit is contained in:
@@ -37,7 +37,15 @@
|
||||
document.querySelectorAll('pre code').forEach(function(el){ window.hljs.highlightElement(el); });
|
||||
};
|
||||
})();
|
||||
document.addEventListener('DOMContentLoaded', function(){ window.__hljsSet(document.documentElement.getAttribute('data-theme')); window.__hljsAll(); syncModalScrollLock(); });
|
||||
document.addEventListener('DOMContentLoaded', function(){ window.__hljsSet(document.documentElement.getAttribute('data-theme')); window.__hljsAll(); syncModalScrollLock(); initNavActive(); initSections(); });
|
||||
/* Активный пункт меню — как в макете: бордовый цвет у текущего раздела. */
|
||||
function initNavActive(){
|
||||
var path = window.location.pathname;
|
||||
document.querySelectorAll('#top-nav .nav-link').forEach(function (a) {
|
||||
var href = a.getAttribute('href') || '';
|
||||
if (path === href || (href !== '/' && path.indexOf(href + '/') === 0)) a.classList.add('active');
|
||||
});
|
||||
}
|
||||
function toggleTheme(){
|
||||
var e=document.documentElement; var t=e.getAttribute('data-theme')==='dark'?'light':'dark';
|
||||
e.setAttribute('data-theme',t); localStorage.setItem('lms-theme',t); window.__hljsSet(t);
|
||||
@@ -99,18 +107,23 @@
|
||||
<header class="page-header">
|
||||
<div class="page-header-inner">
|
||||
<a th:href="@{/}" class="logo">LMS<b>.</b></a>
|
||||
<nav class="nav">
|
||||
<nav class="nav" id="top-nav">
|
||||
<th:block th:if="${currentUser != null}">
|
||||
<a th:if="${currentUser.admin}" th:href="@{/admin/groups}" class="nav-link">Группы</a>
|
||||
<a th:if="${currentUser.admin}" th:href="@{/admin/users}" class="nav-link">Пользователи</a>
|
||||
<a th:if="${currentUser.admin}" th:href="@{/admin/labs}" class="nav-link">Лабораторные</a>
|
||||
<a th:unless="${currentUser.admin}" th:href="@{/student/labs}" class="nav-link">Лабораторные</a>
|
||||
<a th:unless="${currentUser.admin}" th:href="@{/student}" class="nav-link">Личный кабинет</a>
|
||||
<a th:href="@{/change-password}" class="nav-link">Смена пароля</a>
|
||||
<a th:if="${currentUser.admin}" th:href="@{/admin}" class="nav-link nav-user" th:text="${currentUser.name}" title="Личный кабинет">—</a>
|
||||
<a th:unless="${currentUser.admin}" th:href="@{/student}" class="nav-link nav-user" th:text="${currentUser.name}" title="Личный кабинет">—</a>
|
||||
</th:block>
|
||||
<a th:if="${currentUser == null}" th:href="@{/login}" class="btn btn-secondary">Войти</a>
|
||||
<button type="button" onclick="toggleTheme()" class="btn btn-secondary theme-btn"
|
||||
</nav>
|
||||
<div class="user">
|
||||
<th:block th:if="${currentUser != null}">
|
||||
<a th:href="@{/admin}" th:if="${currentUser.admin}" class="nav-user" th:text="${currentUser.name}" title="Личный кабинет">—</a>
|
||||
<a th:href="@{/student}" th:unless="${currentUser.admin}" class="nav-user" th:text="${currentUser.name}" title="Личный кабинет">—</a>
|
||||
</th:block>
|
||||
<a th:if="${currentUser == null}" th:href="@{/login}" class="btn btn-secondary btn-sm">Войти</a>
|
||||
<button type="button" onclick="toggleTheme()" class="btn btn-secondary btn-sm theme-btn"
|
||||
aria-label="Сменить тему" title="Сменить тему">
|
||||
<svg class="theme-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
||||
<circle cx="12" cy="12" r="5" fill="none" stroke="currentColor" stroke-width="1.6"/>
|
||||
@@ -128,10 +141,10 @@
|
||||
</svg>
|
||||
</button>
|
||||
<form th:if="${currentUser != null}" th:action="@{/logout}" method="post">
|
||||
<button class="btn btn-secondary" type="submit">Выйти</button>
|
||||
<button class="btn btn-secondary btn-sm" type="submit">Выйти</button>
|
||||
<input type="hidden" name="_csrf" th:value="${csrfToken}">
|
||||
</form>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main class="page-main">
|
||||
|
||||
Reference in New Issue
Block a user