changeset 185:cfa730bbca6e

Regroup press articles by year.
author Brian Neal <bgneal@gmail.com>
date Sun, 24 Jan 2016 21:41:28 -0600
parents 6508aef37131
children f3eca817dd33
files madeira/templates/articles/article_list.html
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/madeira/templates/articles/article_list.html	Sat Jan 16 15:01:25 2016 -0600
+++ b/madeira/templates/articles/article_list.html	Sun Jan 24 21:41:28 2016 -0600
@@ -5,11 +5,15 @@
 {% block content %}
 <h1>Madeira Press, Articles, &amp; Reviews</h1>
 {% if article_list %}
-   <ul>
-   {% for article in article_list %}
-      <li><a href="{{ article.get_absolute_url }}">{{ article.title }}</a></li>
+   {% regroup article_list by date.year as article_groups %}
+   {% for group in article_groups %}
+      <h2>{{ group.grouper }}</h2>
+      <ul>
+         {% for article in group.list %}
+            <li><a href="{{ article.get_absolute_url }}">{{ article.title }}</a></li>
+         {% endfor %}
+      </ul>
    {% endfor %}
-   </ul>
 {% else %}
    <p>No articles at this time.</p>
 {% endif %}