{% load filters %}

<table class="table table-hover">
    <thead>
    <tr>
        <th>Date</th>
        <th>Activity</th>
        <th>Track</th>
        <th>Sport</th>
        <th>Duration</th>
        <th>Distance</th>
    </tr>
    </thead>
    <tbody>
    {% for a in activities %}
        <tr>
            <td>{{ a.date|date:"M d, Y" }}</td>
            <td class="limit"><a href="/activity/{{ a.id }}">{{ a.name }}</a></td>
            <td>
                {% if a.trace_file.longitude_list|length > 2 %}
                    <a href="/activity/{{ a.id }}" data-toggle="tooltip" data-placement="bottom"
                       title="Show on Map" style="color: black;">
                        <i class="fas fa-map-marked-alt"></i>
                    </a>
                {% else %}

                {% endif %}
            </td>
            <td>
                {% if a.sport %}
                    <a href="/sport/{{ a.sport.slug }}" data-toggle="tooltip" data-placement="bottom"
                       title="{{ a.sport.name }}" style="color: {{ a.sport.color }};">
                        <i class="fas fa-{{ a.sport.icon }}"></i>
                    </a>
                {% else %}
                    ?
                {% endif %}
            </td>
            <td>{{ a.duration|table_duration }}</td>
            <td>
                {% if a.distance == 0.0 %}

                {% else %}
                    {{ a.distance }}
                {% endif %}
            </td>
        </tr>
    {% endfor %}
    </tbody>
</table>