{% extends "base.html" %}

{% block content %}
    {% if today_events %}
    <h1>Aujourd'hui</h1>
    <table>
        {% for event in today_events %}
        <td>
            {% if event.picture %}
            <img src="{{ event.picture.url }}" width="200" height="200" alt=""/>
            {% endif %}<br/>
            {{ event.date|date:"l j F Y" }}<br/>
            <a href="{{ event.get_absolute_url }}">{{ event.name }}</a>
        </td>
        {% endfor %}
    </table>
    {% endif %}
    {% for chronology in latest_chronologies %}
            <h1 class="chronology-name"><a href="{{ chronology.get_absolute_url }}">{{ chronology.name }}</a></h1>
            {% for event in chronology.events.all %}
                    <figure>
                        {% if event.picture %}
                        <img src="{{ event.picture.url }}" width="200" height="200" alt=""/>
                        {% endif %}
                        <figcaption>
                            <ul>
                                <li>{{ event.date|date:"l j F Y" }}</li>
                                <li><a href="{{ event.get_absolute_url }}">{{ event.name }}</a></li>
                            </ul>
                        </figcaption>
                    </figure>
            {% endfor %}
    {% endfor %}
{% endblock %}