From 9d432f5effe32285651dcb46645caffe24b6765f Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 13 Oct 2013 14:50:05 +0200 Subject: Optimizations in /home and /articles templates. --- pyaggr3g470r/templates/articles.html | 22 ++++++---------------- pyaggr3g470r/templates/home.html | 22 ++++++---------------- 2 files changed, 12 insertions(+), 32 deletions(-) diff --git a/pyaggr3g470r/templates/articles.html b/pyaggr3g470r/templates/articles.html index 374eaea7..d98d1f80 100644 --- a/pyaggr3g470r/templates/articles.html +++ b/pyaggr3g470r/templates/articles.html @@ -3,24 +3,14 @@
{% for number in range(0, feed.articles|sort(attribute='date')|length-2, 3) %}
+ {% for n in range(number, number+3) %}
- {% if feed.articles[number].readed %}

{% else %}

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

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

{% else %}{% endif %} -
{{ feed.articles[number].date }}
-
-
- {% if feed.articles[number+1].readed %}

{% else %}

{% endif %} - {{ feed.articles[number+1].title }}

- {% if feed.articles[number+1].readed %}

{% else %}{% endif %} -
{{ feed.articles[number+1].date }}
-
-
- {% if feed.articles[number+2].readed %}

{% else %}

{% endif %} - {{ feed.articles[number+2].title }}

- {% if feed.articles[number+2].readed %}

{% else %}{% endif %} -
{{ feed.articles[number+2].date }}
+ {% if feed.articles[n].readed %}

{% else %}

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

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

{% else %}{% endif %} +
{{ feed.articles[n].date }}
+ {% endfor %}
{% endfor %}
diff --git a/pyaggr3g470r/templates/home.html b/pyaggr3g470r/templates/home.html index 7aede342..aa390d2d 100644 --- a/pyaggr3g470r/templates/home.html +++ b/pyaggr3g470r/templates/home.html @@ -10,24 +10,14 @@ {% for number in range(0, feed.articles|sort(attribute='date')|length-2, 3) %}
+ {% for n in range(number, number+3) %}
- {% if feed.articles[number].readed %}

{% else %}

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

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

{% else %}{% endif %} -
{{ feed.articles[number].date }}
-
-
- {% if feed.articles[number+1].readed %}

{% else %}

{% endif %} - {{ feed.articles[number+1].title }}

- {% if feed.articles[number+1].readed %}

{% else %}{% endif %} -
{{ feed.articles[number+1].date }}
-
-
- {% if feed.articles[number+2].readed %}

{% else %}

{% endif %} - {{ feed.articles[number+2].title }}

- {% if feed.articles[number+2].readed %}

{% else %}{% endif %} -
{{ feed.articles[number+2].date }}
+ {% 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 %} -- cgit