{% extends "agenda_culturel/page-admin.html" %}

{% load utils_extra %}
{% load event_extra %}

{% block title %}{% block og_title %}Événements dupliqués{% endblock %}{% endblock %}

{% load cat_extra %}
{% block entete_header %}
    {% css_categories %}
{% endblock %}

{% block sidemenu-bouton %}
    <li><a href="#contenu-principal" aria-label="Aller au contenu">{% picto_from_name "chevron-up" %}</a></li>
    <li><a href="#sidebar" aria-label="Aller au menu latéral">{% picto_from_name "chevron-down" %}</a></li>
{% endblock %}

{% block content %}
<div class="grid two-columns">
<article>
    <header>
        <h1>Événements dupliqués</h1>
        <form method="get" class="form django-form recent moderation-events">
            {{ filter.form.as_div }}<br />
            <button type="submit">Filtrer</button><br />
        </form>

    <p>{{ paginator.count }} événement{{ paginator.count|pluralize }} dupliqués{% if filter.form.fixed.value == None %}.{% else %} 
        {% if filter.form.fixed.value %}sont résolus.
        {% else %}doivent être résolus.{% endif %}
        {% endif %}</p>
    </header>

    <div>
{% for obj in paginator_filter %}
    {% with obj.get_duplicated as events %}
    {% include "agenda_culturel/duplicate-inc.html" with duplicate=obj events=events %}
    {% endwith %}
{% endfor %}
    </div>
<footer>
    <span>
        {% if paginator_filter.has_previous %}
            <a href="?page=1&{{ filter.get_fixed_url }}" role="button">&laquo; premier</a>
            <a href="?page={{ paginator_filter.previous_page_number }}&{{ filter.get_fixed_url }}" role="button">&lt; précédent</a>
        {% endif %}

        <span>
            Page {{ paginator_filter.number }} sur {{ paginator_filter.paginator.num_pages }}
        </span>

        {% if paginator_filter.has_next %}
            <a href="?page={{ paginator_filter.next_page_number }}&{{ filter.get_fixed_url }}" role="button">suivant &gt;</a>
            <a href="?page={{ paginator_filter.paginator.num_pages }}&{{ filter.get_fixed_url }}" role="button">dernier &raquo;</a>
        {% endif %}
    </span>
</footer>
</article>


{% include "agenda_culturel/side-nav.html" with current="duplicates" %}
</div>

{% endblock %}