- add a generic AJAX submitter for forms inside dialogs - keep modal values and show field errors on server validation failure - soft-refresh the page content on success, preserving scroll, search and filters - share toast and re-init hooks for tables, markdown, sections and group page - require passwords and add minlength/match validation on auth forms
27 lines
2.2 KiB
HTML
27 lines
2.2 KiB
HTML
<!DOCTYPE html>
|
||
<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">
|
||
<div class="container-sm">
|
||
<h1 class="page-title">Смена пароля</h1>
|
||
<p class="text-sm text-muted mb-4" th:if="${currentUser != null and currentUser.mustChangePassword}">
|
||
Это временный пароль. Пока вы его не смените, другие страницы недоступны.
|
||
Смена потребуется один раз — после этого система больше не попросит.
|
||
</p>
|
||
<p class="text-sm text-muted mb-4" th:if="${currentUser == null or !currentUser.mustChangePassword}">
|
||
Смените пароль, если хотите. После сохранения вы останетесь в системе.
|
||
</p>
|
||
<form class="card form-card form-stack" th:action="@{/change-password}" method="post">
|
||
<div><label class="label" for="old">Текущий пароль</label><input class="input" id="old" name="old" type="password" autocomplete="current-password" required></div>
|
||
<div><label class="label" for="new">Новый пароль</label><input class="input" id="new" name="new" type="password" autocomplete="new-password" minlength="8" required><p class="hint">Минимум 8 символов.</p></div>
|
||
<div><label class="label" for="new2">Повторите новый пароль</label><input class="input" id="new2" name="new2" type="password" autocomplete="new-password" minlength="8" data-match="#new" data-error-match="Пароли не совпадают" required></div>
|
||
<button class="btn btn-primary" type="submit">Сменить пароль</button>
|
||
<a th:if="${currentUser != null and !currentUser.mustChangePassword}"
|
||
class="btn btn-secondary" th:href="${currentUser.admin} ? @{/admin} : @{/student}">Отмена</a>
|
||
<input type="hidden" name="_csrf" th:value="${csrfToken}">
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html> |