<!-- templates/registration/login.html -->
{% extends 'tournaments/base.html' %}
{% block head_title %} Connexion {% endblock %}
{% block first_title %} Padel Club {% endblock %}
{% block second_title %} Connexion {% endblock %}

{% block content %}
{% load static %}
{% load tz %}

<div class="grid-x">
<div class="bubble">
    <div class="cell medium-6 large-6 my-block">
        {% if form.errors %}
        <div class="alert alert-error">
            {% if form.non_field_errors %}
                {% for error in form.non_field_errors %}
                    <p>{{ error }}</p>
                {% endfor %}
            {% endif %}

            {% for field in form %}
                {% for error in field.errors %}
                    <p>{{ error }}</p>
                {% endfor %}
            {% endfor %}
        </div>
        {% endif %}
        <form method="post" action="{% url 'custom-login' %}">
            {% csrf_token %}
            <input type="hidden" name="next" value="{{ request.GET.next }}">
            <label for="username">Identifiant ou e-mail </label>
            <input type="text" name="username" id="username" required>

            <label for="password">Mot de passe :</label>
            <input type="password" name="password" id="password" required>
            <button type="submit" class="rounded-button">Se connecter</button>

            <p>
                <a href="{% url 'password_reset' %}" class="styled-link">Mot de passe oublié ?</a>
            </p>

        </form>
        <p>Pas encore de compte ? <a href="{% url 'signup' %}" class="styled-link">Créer le tout de suite !</a></p>
    </div>
</div>
</div>

{% endblock %}
