<div class="large-table">
    <table role="grid">
        <thead>
            <tr>
                <th rowspan="2">Identifiant</th>
                <th rowspan="2">Date</th>
                <th rowspan="2">Source</th>
                <th rowspan="2">Status</th>
                <th colspan="4" class="center">nombre d'événements</th>
            </tr>
            <tr>
                <th class="center"><span data-tooltip="détectés sur le site source">en ligne</span></th>
                <th class="border-left enter"><span data-tooltip="créés sur PdL">importés</span></th>
                <th class="center"><span data-tooltip="mis à jour ou inchangés sur PdL">mis à jour</span></th>
                <th class="border-left enter"><span data-tooltip="supprimés car du site source">supprimés</span></th>
            </tr>
        </thead>
        <tbody>
    {% for obj in objects %}
        <tr>
            <td>{{ obj.id }}</td>
            <td>{{ obj.created_date }}</td>
            <td>{% if obj.recurrentImport %}<a href="{{ obj.recurrentImport.get_absolute_url }}">{{ obj.recurrentImport.name }}</a>{% else %}
                {% if obj.url_source %}
                    <a href="{{ obj.url_source }}">
                        {% if "facebook" in obj.url_source %}
                        <em>lien facebook</em>
                        {% else %}
                        <em>url</em>
                        {% endif %}
                    </a>
                    {% if obj.event_id %}
                    (<a href="{% url 'edit_event_pk' obj.event_id %}">événement</a>)
                    {% endif %}
                {% endif %}
                {% endif %} </td>
            <td><span{% if obj.status == "failed" %} data-tooltip="{{ obj.error_message }}"{% endif %}>{{ obj.status }}</span>
                {% if obj.status == "running" %}(<a href="{% url 'cancel_import' obj.id %}">annuler</a>){% endif %}</td>
            <td class="center">{% if obj.status == "success" %}{{ obj.nb_initial }}{% endif %}</td>
            <td class="border-left center">{% if obj.status == "success" %}{{ obj.nb_imported }}{% endif %}</td>
            <td class="center">{% if obj.status == "success" %}{{ obj.nb_updated }}{% endif %}</td>
            <td class="border-left center">{% if obj.status == "success" %}{{ obj.nb_removed }}{% endif %}</td>
        </tr>
    {% endfor %}
    {% if next %}
        <tr>
            <td><a href="{% url 'imports' %}">...</a></td>
            <td><a href="{% url 'imports' %}">...</a></td>
            <td><a href="{% url 'imports' %}">...</a></td>
            <td><a href="{% url 'imports' %}">...</a></td>
            <td><a href="{% url 'imports' %}"></a></td>
            <td><a href="{% url 'imports' %}">...</a></td>
            <td><a href="{% url 'imports' %}">...</a></td>
            <td><a href="{% url 'imports' %}">...</a></td>
            <td><a href="{% url 'imports' %}">...</a></td>
        </tr>
    {% endif %}
        </tbody>
    </table>
</div>