{% extends 'tournaments/base.html' %}

{% block head_title %}Tournois{% endblock %}
{% block first_title %}Padel Club{% endblock %}
{% block second_title %}{% if club %}{{ club.name }}{% else %}Tournois{% endif %}{% endblock %}


{% block right_header %}
{% endblock %}

{% block content %}

{% include 'tournaments/navigation_base.html' %}

    <div class="grid-x">

        {% if live or future %}
        <div class="cell medium-6 large-6 topblock my-block">

            <div class="bubble">

                {% if live %}

                <label class="title">En cours</label>

                {% for tournament in live %}
                {% include 'tournaments/tournament_row.html' %}
                {% endfor %}

                {% if live|length >= 10 %}
                <div class="right">
                    {% if club %}
                    <a href="{% url 'tournaments' %}?filter=1&club={{ club.id }}">Voir tous...</a>
                    {% else %}
                    <a href="{% url 'tournaments' %}?filter=1">Voir tous...</a>
                    {% endif %}
                </div>
                {% endif %}

                {% endif %}

                {% if future %}

                <label class="title">À venir</label>

                {% for tournament in future %}
                {% include 'tournaments/tournament_row.html' %}
                {% endfor %}

                {% if future|length >= 10 %}
                <div class="right">
                    {% if club %}
                    <a href="{% url 'tournaments' %}?filter=0&club={{ club.id }}">Voir tous...</a>
                    {% else %}
                    <a href="{% url 'tournaments' %}?filter=0">Voir tous...</a>
                    {% endif %}
                </div>
                {% endif %}

                {% endif %}

            </div>
        </div>

        {% endif %}

        {% if ended %}
        <div class="cell medium-6 large-6 topblock my-block">
            <div class="bubble">

                <label class="title">Terminés</label>

                {% for tournament in ended %}
                {% include 'tournaments/tournament_row.html' %}
                {% endfor %}

                {% if ended|length >= 10 %}
                <div class="right">
                    {% if club %}
                    <a href="{% url 'tournaments' %}?filter=2&club={{ club.id }}">Voir tous...</a>
                    {% else %}
                    <a href="{% url 'tournaments' %}?filter=2">Voir tous...</a>
                    {% endif %}
                </div>
                {% endif %}

            </div>
        </div>
        {% endif %}

    </div>

{% endblock %}
