Newer
Older
teacher-diary / src / main / resources / templates / auth / register.html
<!DOCTYPE html>
<html lang="ru" xmlns:th="http://www.thymeleaf.org"
      th:replace="~{layout/auth :: html(pageTitle='Регистрация', content=~{::content}, scripts=~{::scripts})}">
<body>
<th:block th:fragment="content">
    <div class="auth-title">
        <h2>Создать аккаунт</h2>
        <p>Начните управлять обучением эффективно</p>
    </div>

    <form class="auth-form" method="post" th:action="@{/auth/register}" th:object="${request}">
        <div class="row">
            <div class="col-12 mb-3">
                <label for="lastName" class="form-label">Фамилия <span class="text-danger">*</span></label>
                <input type="text"
                       class="form-control"
                       th:classappend="${#fields.hasErrors('lastName')} ? 'is-invalid'"
                       id="lastName"
                       th:field="*{lastName}"
                       placeholder="Иванов"
                       required>
                <div class="invalid-feedback" th:if="${#fields.hasErrors('lastName')}" th:errors="*{lastName}"></div>
            </div>
        </div>

        <div class="row">
            <div class="col-6 mb-3">
                <label for="firstName" class="form-label">Имя <span class="text-danger">*</span></label>
                <input type="text"
                       class="form-control"
                       th:classappend="${#fields.hasErrors('firstName')} ? 'is-invalid'"
                       id="firstName"
                       th:field="*{firstName}"
                       placeholder="Иван"
                       required>
                <div class="invalid-feedback" th:if="${#fields.hasErrors('firstName')}" th:errors="*{firstName}"></div>
            </div>
            <div class="col-6 mb-3">
                <label for="patronymic" class="form-label">Отчество</label>
                <input type="text"
                       class="form-control"
                       id="patronymic"
                       th:field="*{patronymic}"
                       placeholder="Иванович">
            </div>
        </div>

        <div class="mb-3">
            <label for="email" class="form-label">Email <span class="text-danger">*</span></label>
            <input type="email"
                   class="form-control"
                   th:classappend="${#fields.hasErrors('email')} ? 'is-invalid'"
                   id="email"
                   th:field="*{email}"
                   placeholder="your@email.com"
                   required>
            <div class="invalid-feedback" th:if="${#fields.hasErrors('email')}" th:errors="*{email}"></div>
        </div>

        <div class="mb-3">
            <label for="phone" class="form-label">Телефон</label>
            <input type="tel"
                   class="form-control"
                   id="phone"
                   th:field="*{phone}"
                   placeholder="+7 (999) 123-45-67">
        </div>

        <div class="mb-3">
            <label for="password" class="form-label">Пароль <span class="text-danger">*</span></label>
            <input type="password"
                   class="form-control"
                   th:classappend="${#fields.hasErrors('password')} ? 'is-invalid'"
                   id="password"
                   th:field="*{password}"
                   placeholder="Минимум 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">Подтвердите пароль <span class="text-danger">*</span></label>
            <input type="password"
                   class="form-control"
                   th:classappend="${#fields.hasErrors('confirmPassword')} ? 'is-invalid'"
                   id="confirmPassword"
                   th:field="*{confirmPassword}"
                   placeholder="Повторите пароль"
                   required>
            <div class="invalid-feedback" th:if="${#fields.hasErrors('confirmPassword')}" th:errors="*{confirmPassword}"></div>
        </div>

        <button type="submit" class="btn btn-auth">
            Зарегистрироваться
        </button>
    </form>

    <div class="auth-divider"><span>или</span></div>

    <div class="auth-links">
        <p class="mb-0">Уже есть аккаунт? <a th:href="@{/auth/login}">Войти</a></p>
    </div>
</th:block>

<th:block th:fragment="scripts"></th:block>
</body>
</html>