{% block body %}
+{% with posts.0 as latest %}
<div class="latest">
<h2><a href="{{ latest.get_absolute_url }}">{{ latest.title }}</a></h2>
<div class="meta">{{ latest.creation_timestamp|date:"j E Y, H:i"|lower }}</div>
{{ latest.text|safe }}
</div>
</div>
+{% endwith %}
+
+<div class="older post-list">
+<ul>
+{% for post in posts|slice:"1:" %}
+<li><a href="{{ post.get_absolute_url }}">{{ post.title }} <span>{{ post.creation_timestamp|date:"Y/m/d" }}</span></a></li>
+{% endfor %}
+<li><a href="/archives/">...</a></li>
+</ul>
+</div>
<nav>
<a href="tag/radio/">Radio <span>(Panik & ailleurs)</span></a>
def get_context_data(self, **kwargs):
context = super(HomeView, self).get_context_data(**kwargs)
- context['latest'] = Note.objects.filter(published=True).latest('creation_timestamp')
+ context['posts'] = Note.objects.filter(published=True).order_by('-creation_timestamp')[:5]
return context