{% extends 'tournaments/base.html' %}
{% block head_title %} Mes tournois {% endblock %}
{% block first_title %} Mes tournois {% endblock %}
{% block second_title %} {{ user.first_name }} {{ user.last_name }} {% endblock %}

{% block content %}

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

{% load static %}
{% load tz %}

<div class="grid-x">
    {% if running_tournaments %}
        <div class="cell medium-12 large-6 topblock padding10">
            <div class="table-row-5-colums-tournament header">
                <label class="title">Vos tournois en cours</label>
            </div>

            {% for tournament in running_tournaments %}
            {% include 'tournaments/tournament_row.html' %}
            {% endfor %}
        </div>
    {% endif %}
    {% if upcoming_tournaments %}
        <div class="cell medium-12 large-6 topblock padding10">
            <div class="table-row-5-colums-tournament header">
                <label class="title">Vos tournois à venir</label>
            </div>

            {% for tournament in upcoming_tournaments %}
            {% include 'tournaments/tournament_row.html' %}
            {% endfor %}
        </div>
    {% endif %}

    {% if ended_tournaments %}
        <div class="cell medium-12 large-6 topblock padding10">
            <div class="table-row-5-colums-tournament header">
                <label class="title">Vos tournois terminés</label>
            </div>

            {% for tournament in ended_tournaments %}
            {% include 'tournaments/tournament_row.html' %}
            {% endfor %}
            <div class="table-row-5-colums-tournament footer">
                {% if ended_tournaments|length >= 12 %}
                <div class="small">
                    <a href="{% url 'all-my-ended-tournaments' %}">voir tous vos tournois terminés</a>
                </div>
                {% endif %}
            </div>
        </div>
    {% endif %}
</div>
{% endblock %}
