{% extends 'tournaments/broadcast/broadcast_base.html' %}

{% load static %}

{% block head_title %}{{ club.broadcast_code }} - {{ club.name }} Broadcast{% endblock %}
{% block first_title %}{{ club.name }} ({{ club.broadcast_code }}){% endblock %}
{% block second_title %}Broadcast{% endblock %}

{% block content %}
<div class="grid-x">
    <!-- Club Auto Broadcast Link at the top -->
    <div class="cell topblock padding10">
        <div class="bubble" style="padding: 8px 15px; margin-bottom: 10px; background-color: #f8f9fa;">
            <span style="font-size: 0.9em; color: #555;">
                <a href="{% url 'club-broadcast-auto' club.broadcast_code %}" style="color: #007acc; text-decoration: none; font-weight: 500;">Diffusion automatique du club</a>
                - Cycle automatiquement entre tous les tournois actifs +- 3 jours
            </span>
        </div>
    </div>

    <div class="cell topblock padding10">
        <div class="bubble">

                {% for tournament in tournaments %}

                <div class="table-row-6-colums-club-tournament {% cycle 'even-row' 'odd-row' %}">
                    <div class="table-cell mybox center">{{ tournament.formatted_start_date }}</div>

                    <div class="tight table-cell">
                        <div class="large">{{ tournament.level }}</div>
                        <div class="small">{{ tournament.category }}</div>
                        {% if tournament.age %}
                        <div class="small">{{ tournament.age }}</div>
                        {% endif %}
                    </div>
                    <div class="tight table-cell">
                        <span>{{ tournament.creator }}</span>
                    </div>
                    <div class="tight table-cell">
                        <span>{{ tournament.private_label }}</span>
                    </div>
                    <div class="table-cell">
                        <span><a href="{% url 'automatic-broadcast' tournament.id %}">Auto</a></span> |
                        <span><a href="{% url 'automatic-broadcast-event' tournament.event.id %}">Event Auto</a></span> |
                        <span><a href="{% url 'broadcasted-bracket' tournament.id %}">(beta) Tableau</a></span> |
                        <span><a href="{% url 'broadcasted-planning' tournament.id %}">(beta) Planning</a></span> |
                        <span><a href="{% url 'broadcasted-matches' tournament.id %}">Matchs</a></span> |
                        <span><a href="{% url 'broadcasted-group-stages' tournament.id %}">Poules</a></span> |
                        <span><a href="{% url 'broadcasted-summons' tournament.id %}">Convocations</a></span> |
                        <span><a href="{% url 'broadcasted-rankings' tournament.id %}">Classement</a></span>
                    </div>

                    <div class="table-cell horizontal-padding semibold">
                        {% if tournament.name_and_event %}
                        <span>{{ tournament.name_and_event }}</span>
                        {% endif %}
                    </div>
                </div>

                {% endfor %}
        </div>
    </div>
</div>

{% endblock %}
