{% extends "vellum/post_list.html" %}
{% load i18n %}

{% block title %}{% trans "Archives" %} | {{ block.super }}{% endblock %}
{% block description %}{{ object_list|length }} {% trans "posts published in the history of" %} {{ BLOG_NAME }}{% endblock %}
{% block body_id %}post-archive{% endblock %}

{% block content %}
    <h1>{% trans "Archives" %}</h1>
    {% regroup object_list by publish|date:"Y" as years %}
    <ul class="yearly-archive">
        {% for year in years %}
        <li><h2><a class="year" href="{% url vellum_archive_year year.grouper %}" title="View all posts in {{ year.grouper }}.">{{ year.grouper }}</a></h3>
            {% regroup year.list by publish|date:"F" as months %}
            <ul class="monthly-archive">
            {% for month in months %}
            <li><h3><a class="month" href="{% url vellum_archive_month year.grouper month.list.0.publish|date:"m" %}" title="View all posts in {{ month.grouper }} {{ year.grouper }}.">{{ month.grouper }}</a></h3>
                    <ul class="monthly-posts">
                        {% for post in month.list %}
                        <li class="post"><a href="{{ post.get_absolute_url }}" title="Read the post: {{ post }}">{{ post }}</a></li>
                        {% endfor %}
                    </ul>
                </li>    
            {% endfor %}
            </ul>
        </li>
        {% endfor %}
    </ul>

{% endblock %}
