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

{% block head_title %}Équipes du {{ tournament.display_name }}{% endblock %}
{% block first_title %}{{ tournament.event.display_name }}{% endblock %}
{% block second_title %}{{ tournament.display_name }}{% endblock %}

{% block content %}
{% include 'tournaments/navigation_tournament.html' %}
<div class="grid-x grid-margin-x">
    <style>
        .bubble {
            height: 100%;
        }
    </style>
<div class="cell medium-12">
    <h1 class="club my-block topmargin20">{{ team.formatted_team_names }} {{team.formatted_special_status}}</h1>
    <div class="grid-x">
    {% for player in team.player_registrations.all %}
        {% include 'tournaments/player_row.html' with player=player %}
    {% endfor %}
    {% include 'tournaments/team_stats.html' %}
    </div>
</div>
</div>

<div class="grid-x grid-margin-x">
    {% with upcoming_matches=team.get_upcoming_matches %}
    {% if upcoming_matches %}
    <!-- Upcoming Matches -->
    <div class="cell medium-12">
        <h1 class="club my-block topmargin20">Prochains matchs</h1>
        <div class="grid-x">
            {% for match in upcoming_matches %}
                {% include 'tournaments/match_cell.html' %}
            {% endfor %}
        </div>
    </div>
    {% endif %}
    {% endwith %}

    {% with completed_matches=team.get_completed_matches %}
    {% if completed_matches %}
    <!-- Completed Matches -->
    <div class="cell medium-12">
        <h1 class="club my-block topmargin20">Matchs terminés</h1>
        <div class="grid-x">
            {% for match in completed_matches %}
                {% include 'tournaments/match_cell.html' %}
            {% endfor %}
        </div>
    </div>
    {% endif %}
    {% endwith %}
</div>
{% endblock %}
