<!DOCTYPE html>
<html lang="ru" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Регистрация - Teacher Diary</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light">
<div class="container py-5">
<div class="row justify-content-center">
<div class="col-md-5">
<div class="card shadow">
<div class="card-body p-4">
<h4 class="text-center mb-2">Добро пожаловать!</h4>
<p class="text-center text-muted mb-4">
<span th:text="${parentName}"></span>, создайте пароль для входа
</p>
<div th:if="${error}" class="alert alert-danger" th:text="${error}"></div>
<form th:action="@{/auth/parent/invite}" method="post" th:object="${request}">
<input type="hidden" th:field="*{token}">
<div class="mb-3">
<label class="form-label">Email</label>
<input type="email" class="form-control bg-light" th:value="${parentEmail}" disabled>
</div>
<div class="mb-3">
<label for="password" class="form-label">Пароль</label>
<input type="password" class="form-control" id="password" th:field="*{password}"
th:classappend="${#fields.hasErrors('password')} ? 'is-invalid'"
minlength="6" required>
<div class="invalid-feedback" th:if="${#fields.hasErrors('password')}" th:errors="*{password}"></div>
</div>
<div class="mb-4">
<label for="confirmPassword" class="form-label">Подтвердите пароль</label>
<input type="password" class="form-control" id="confirmPassword" th:field="*{confirmPassword}"
th:classappend="${#fields.hasErrors('confirmPassword')} ? 'is-invalid'"
minlength="6" required>
<div class="invalid-feedback" th:if="${#fields.hasErrors('confirmPassword')}" th:errors="*{confirmPassword}"></div>
</div>
<button type="submit" class="btn btn-primary w-100">Создать аккаунт</button>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>