{% extends 'driver27/base.html' %}
{% load static i18n %}
{% block dr27_menu %}
    {% include 'driver27/season/menu-pre.html' %}
    <li class="nav-item">
        <a class="nav-link" href="{{ season.get_races_url }}">Races</a>
    </li>
    <li class="nav-item">
        <a class="nav-link" href="{{ race.get_absolute_url }}">{{ race }}</a>
    </li>
{% endblock %}
{% block dr27_content %}
    {{ block.super }}
    <table class="table">
        <tr>
            <th>{% trans 'Position' %}</th>
            <th>{% trans 'Driver' %}</th>
            <th>{% trans 'Team' %}</th>
            <th>{% trans 'Start' %}</th>
            <th>&nbsp;</th>
        </tr>
        {% for result in results %}
            <tr class="race_result finish_{{ result.finish }} {% if result.points %}points{% endif %}">
                <td>
                    {% if result.retired or  not result.finish %}
                        <span class="result retired">Retired</span>
                    {% else %}
                        {{ result.finish }}
                    {% endif %}
                </td>
                <td>
                    {% with driver=result.driver %}
                        <i class="flag2x {{ driver.country.flag_css }}"></i>
                        <a href="{{ driver.get_absolute_url }}">{{ driver }}</a>
                    {% endwith %}
                </td>
                <td>
                    {% with team=result.team %}
                        <i class="flag2x {{ team.country.flag_css }}"></i>
                        <a href="{{ team.get_absolute_url }}">{{ team }}</a>
                    {% endwith %}

                </td>
                <td>
                    {% if result.qualifying %}
                        {{ result.qualifying }}
                    {% else %}
                        -
                    {% endif %}
                </td>
                <td>
                    {% if result.wildcard %}
                        <span class="result wildcard">{% trans 'Wildcard' %}</span>
                    {% endif %}
                    {% if result.is_fastest %}
                        <span class="result fastest">{% trans 'Fastest lap' %}</span>
                    {% endif %}
                </td>
            </tr>
        {% endfor %}

    </table>
{% endblock %}

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

{% endblock %}
