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

{% block head_title %}Programmation{% endblock %}
{% block first_title %}{{ tournament.event.display_name }}{% endblock %}
{% block second_title %}Programmation{% endblock %}
{% block meta_desc %}Programmation officielle du {{ tournament.display_name }}. Retrouvez tous les horaires prévus des matchs du tournoi.{% endblock %}
{% block meta_keywords %}programmation,matchs,horaires{% endblock %}

{% block content %}
    {% if tournament.display_prog %}
        {% include 'tournaments/navigation_tournament.html' %}

        {% if days %}
            <nav class="margin10">
                {% for day in days %}
                    <a href="{% url 'tournament-prog' tournament.id %}?day={{ day|date:'Y-m-d' }}" class="mybox topmargin5 {% if selected_day == day|date:'Y-m-d' %}active{% endif %}">
                        {{ day|date:"l d F"|capfirst }}
                    </a>
                {% endfor %}
            </nav>

            {% if match_groups %}
                {% for match_group in match_groups %}
                    <h1 class="club padding10 topmargin20">{{ match_group.name }}</h1>
                    <div class="grid-x">
                        {% for match in match_group.matches %}
                            {% include 'tournaments/match_cell.html' %}
                        {% endfor %}
                    </div>
                {% endfor %}
            {% else %}
                <p class="padding10 topmargin20">Aucun match planifié pour cette journée.</p>
            {% endif %}
        {% else %}
            <p class="padding10 topmargin20">Aucun match planifié pour ce tournoi.</p>
        {% endif %}
    {% endif %}
{% endblock %}
