From 2710670654dd543e5dc732049ebe779ca317ac74 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 31 Oct 2013 20:58:32 +0100 Subject: Improved templates: rendering of the list of articles --- pyaggr3g470r/templates/home.html | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'pyaggr3g470r/templates/home.html') diff --git a/pyaggr3g470r/templates/home.html b/pyaggr3g470r/templates/home.html index 0344263f..bf17356f 100644 --- a/pyaggr3g470r/templates/home.html +++ b/pyaggr3g470r/templates/home.html @@ -8,18 +8,30 @@ - {% for number in range(0, feed.articles|length-2, 3) %} -
- {% for n in range(number, number+3) %} -
- {% if feed.articles[n].readed %}

{% else %}

{% endif %} - {{ feed.articles[n].title }}

- {% if feed.articles[n].readed %}

{% else %}{% endif %} -
{{ feed.articles[n].date }}
+ {% for number in range(0, feed.articles|length-(feed.articles|length % 3), 3) %} +
+ {% for n in range(number, number+3) %} +
+ {% if feed.articles[n].readed %}

{% else %}

{% endif %} + {{ feed.articles[n].title }}

+ {% if feed.articles[n].readed %}

{% else %}{% endif %} +
{{ feed.articles[n].date }}
+
+ {% endfor %}
- {% endfor %} -
- {% endfor %} + {% endfor %} + {% if feed.articles|length % 3 != 0 %} +
+ {% for n in range(0, feed.articles|length % 3) %} +
+ {% if feed.articles[n].readed %}

{% else %}

{% endif %} + {{ feed.articles[n].title }}

+ {% if feed.articles[n].readed %}

{% else %}{% endif %} +
{{ feed.articles[n].date }}
+
+ {% endfor %} +
+ {% endif %} {% endfor %}
{% endblock %} \ No newline at end of file -- cgit