{% load champion_filter i18n %}
{% if rank %}
    <table class="table table-condensed table-striped table-hover">
        <thead>
        <tr>
            <th>{% trans 'Driver' %}</th>
            <th>{% trans 'Team' %}</th>
            {% with ''|center:20 as range %}
                {% for _ in range %}
                    <th>{{ forloop.counter }}</th>
                {% endfor %}
            {% endwith %}
        </tr>
        </thead>

        {% for entry in rank %}
            <tr>
                <td>
                    {% with driver=entry.driver %}
                        <i class="flag2x {{ driver.country.flag_css }}"></i>
                        <a href="{{ driver.get_absolute_url }}">{{ driver }}</a>
                    {% endwith %}
                </td>
                <td>{{ entry.teams }}</td>
                {% for position in entry.pos_list %}
                    <td>{{ position | default_if_none:"-" }}</td>
                {% endfor %}
            </tr>
        {% endfor %}

    </table>
{% else %}
    <p>No drivers</p>
{% endif %}