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

{% load utils_extra %}
{% block title %}{% block og_title %}Administration{% 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">
    <div id="contenu-principal">
        <div>

            
            <article>    
                <header>
                    <div class="slide-buttons">
                        <a href="{% url 'moderate' %}" role="button">Modérer {% picto_from_name "check-square" %}</a>
                    </div>
                    <h2>Modération à venir</h2>
                </header>
                <div class="grid">
                    <div>
                        {% url 'administration' as local_url %}
                        {% include "agenda_culturel/static_content.html" with name="administration" url_path=local_url %}
                    </div>
                    <div class="moderation_heatmap">
                    {% for w in nb_not_moderated %}
                        <table>
                            <thead>
                                <th class="label"></th>
                            {% for m in w %}
                                <th><a href="{% url 'day_view' m.start_day.year m.start_day.month m.start_day.day %}">{{ m.start_day|date:"d" }}<span class="month"> {{ m.start_day|date:"M"|lower }}</span></a></th>
                            {% endfor %}
                            </thead>
                            <tbody>
                                <tr>
                                    <th class="label">reste à modérer</h>
                                {% for m in w %}
                                    <td class="ratio score_{{ m.note }}">
                                        <{% if m.not_moderated > 0 %}a href="{% if m.is_today %}
                                        {% url 'moderate' %}
                                        {% else %}
                                        {% url 'moderate_from_date' m.start_day.year m.start_day.month m.start_day.day %}
                                        {% endif %}"{% else %}span class="a"{% endif %}>
                                            {{ m.not_moderated }}<span class="total"> / {{ m.nb_events }}</span></{% if m.not_moderated > 0 %}a{% else %}span{% endif %}>
                                    </td>
                                {% endfor %}
                                </tr>
                            </tbody>
                        </table>
                    {% endfor %}
                    </div>
                </div>
            </article>                
            <article>    
            <header>
                <h2>Activité des derniers jours</h2>
            </header>
            <h3>Résumé des activités</h3>
            {% include "agenda_culturel/recent-activity-inc.html" with modifications=daily_modifications next=1 %}

            <h3>Derniers imports</h3>
            {% include "agenda_culturel/batch-imports-inc.html" with objects=batch_imports next=1 %}

            <p>Détail des imports récurrents&nbsp;:
            {% include "agenda_culturel/rimports-info-inc.html" with all=1 %}</p>

            <h3>Synthèse des événements importés</h3>
            <p>En ne considérant que les événements à venir, on compte&nbsp;:</p>
            <ul>
                <li>Nombre d'événements issus d'importations récurrentes&nbsp;: {{ nb_in_rimport }}</li>
                <li>Nombre d'événements issus d'importations uniques&nbsp;: {{ nb_in_orphan_import }}</li>
            </ul>

        </article>
        </div>

        <article>
            <header>
                <div class="slide-buttons">
                    <a href="{% url 'recent' %}" role="button">Voir tout {% picto_from_name "chevron-right" %}</a>
                </div>
                <h2>Derniers événements soumis</h2>
            </header>
            {% for e in events %}
                {% include "agenda_culturel/single-event/event-in-flat-list-inc.html" with event=e %}
            {% endfor %}
        </article>

    </div>

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

{% endblock %}

