{% extends "admin/base_site.html" %}
{% load i18n static %}

{% block extrastyle %}{{ block.super }}<link rel="stylesheet" href="{% static "admin/css/dashboard.css" %}">{% endblock %}

{% block coltype %}colMS{% endblock %}

{% block bodyclass %}{{ block.super }} dashboard{% endblock %}

{% block nav-breadcrumbs %}{% endblock %}

{% block nav-sidebar %}{% endblock %}

{% block content %}
<div id="content-main">
  {% include "admin/app_list.html" with app_list=app_list show_changelinks=True %}
</div>
{% endblock %}

{% block sidebar %}
<div id="content-related">
    <div class="module" id="recent-events-module">
        <h2>Évènements à venir</h2>
        {% load events %}
        {% get_upcoming_events 10 as upcoming_events %}
        {% if not upcoming_events %}
            <p>Aucun évènement à venir</p>
        {% else %}
            <ul class="actionlist">
                {% for event in upcoming_events %}
                    <li class="eventlink">
                        <a href="{% url 'admin:plannings_event_change' event.id %}">
                            {{ event.title }}
                        </a>
                        <br>
                        <span class="mini quiet">{{ event.date }}</span>
                    </li>
                {% endfor %}
            </ul>
        {% endif %}
    </div>
</div>
{% endblock %}
