<!DOCTYPE html>
{% load static %}
<html lang="ru">

<head>
    {% if is_token %}
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Регистрация</title>
    <link rel="stylesheet" href="{% static 'css/registration/login.css' %}">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
    <link rel="shortcut icon" href="{% static 'img/global/icon.png' %}" type="image/x-icon">
    {% else %}
    <title>Нет токена</title>
    <link rel="stylesheet" href="{% static 'css/global/not_authorized.css' %}">
    <link rel="shortcut icon" href="{% static 'img/global/icon.png' %}" type="image/x-icon">
    {% endif %}
</head>

<body>
    {% if is_token %}
    <a href="{% url 'home' %}" class="logo"><img src="{% static 'img/global/long_logo.svg' %}" alt="Логотип лицея"></a>

    <form action="" method="post" class="form">
        <h1 class="title">Регистрация</h1>
        <div class="form-div">
            <div class="form-subdiv">
                <div class="input">
                    <label for="id_last_name">Фамилия:</label>
                    {{ user_form.last_name }}
                </div>
                <div class="input">
                    <label for="id_first_name">Имя:</label>
                    {{ user_form.first_name }}
                </div>
                <div class="input">
                    <label for="id_middle_name">Отчество:</label>
                    {{ user_form.middle_name }}
                </div>
                <div class="input">
                    <label for="id_group">Группа:</label>
                    {{ user_form.group }}
                </div>
            </div>
            <div class="line"></div>
            <div class="form-subdiv">
                <div class="input">
                    <label for="id_username">Логин:</label>
                    {{ user_form.username }}
                </div>
                <div class="input">
                    <label for="id_email">Почта:</label>
                    {{ user_form.email }}
                </div>
                <div class="input">
                    <label for="id_password">Пароль:</label>
                    {{ user_form.password }}
                </div>
                <div class="input">
                    <label for="id_password2">Повторите пароль:</label>
                    {{ user_form.password2 }}
                </div>
            </div>
        </div>
        {% csrf_token %}
        <input type="submit" class="btn btn-success" value="Создать аккаунт" name="register_submit">

    </form>
    {% if messages %}
    <ul class="errorlist">
        {% for message in messages %}
        <li>{{ message }}</li>
        {% endfor %}
    </ul>
    {% endif %}

    {% else %}
    <a href="{% url 'home' %}" class="logo"><img src="{% static 'img/global/long_logo.svg' %}" alt="Логотип лицея"></a>
    <div class="div-error">
        <p class="hi">Йоу, мэн, ты не можешь зарегаться без токена</p>
        <img src="{% static 'img/global/not_token.jpg' %}" alt="Еделев..." style="width: 60%; max-width: 700px;">
        <p class="advice-p">Иди введи токен, пока не засмеяли</p>
        <a href="{% url 'token_page' %}">Ввести токен</a>
    </div>
    {% endif %}
</body>

</html>