{% extends 'driver27/base.html' %}
{% load static print_pos %}
{% block dr27_content %}
    {{ block.super }}
    <div class="container-fluid">
        <div class="col-md-9">
            <div class="driver_image demo col-xs-12 col-md-3"><span class="placeholder-img-text">Photo</span></div>
            <div class="col-xs-12 col-md-9">
                <h1>{{ team.full_name }} <i class="flag2x {{ team.country.flag_css }}"></i></h1>

            </div>
            <div class="clearfix"></div>
            <div class="col-md-12">
                {% if by_season %}
                    <h3>Stats by season</h3>
                    <table class="table table-striped text-right table-responsive">
                        <thead>
                        <tr>
                            <th>
                                {% include 'driver27/_selector_competition.html' %}
                            </th>
                            <th>Year</th>
                            <th>Races</th>
                            <th>P1</th>
                            <th>WIN</th>
                            <th>1-3</th>
                            <th>FL</th>
                            <th>Pts</th>
                            <th></th>
                        </tr>
                        </thead>

                        {% for season in by_season %}
                            <tr
                                    class="season-stat"
                                    data-competition="{{ season.competition.slug }}" data-year="{{ season.year }}"
                            >
                                <td>
                                    <a href="{{ season.competition.get_absolute_url }}">{{ season.competition }}</a>
                                </td>
                                <td>
                                    <a href="{{ season.get_absolute_url }}">{{ season.year }}</a>
                                </td>
                                <td>{{ season.stats.RACE }}</td>
                                <td>{{ season.stats.POLE }}</td>
                                <td>{{ season.stats.WIN }}</td>
                                <td>{{ season.stats.PODIUM }}</td>
                                <td>{{ season.stats.FASTEST }}</td>
                                <td>{{ season.stats.POINTS }}</td>
                                <td>{{ season.pos | print_pos | safe }}</td>
                            </tr>
                        {% endfor %}
                    </table>
                {% else %}
                    No results
                {% endif %}

            </div>

        </div>
        <div class="col-md-3 driver_summary">
            {% include 'driver27/_summary_profile.html' %}

        </div>
        <div class="clearfix"></div>


    </div>



{% endblock %}

{% block bootstrap3_extra_head %}
    {{ block.super }}
    <link rel="stylesheet" href="{% static 'flags/sprite-hq.css' %}">

{% endblock %}

{% block bootstrap3_extra_script %}
    {{ block.super }}
    <script src="{% static 'driver27/js/filter_season_by_competition.js' %}"></script>
{% endblock %}