diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-10-31 20:58:32 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-10-31 20:58:32 +0100 |
commit | 2710670654dd543e5dc732049ebe779ca317ac74 (patch) | |
tree | 90f0082065b9700c6ab2313a9c48b0e6d423e262 /pyaggr3g470r/templates | |
parent | Added authentication with Flask-Login. (diff) | |
download | newspipe-2710670654dd543e5dc732049ebe779ca317ac74.tar.gz newspipe-2710670654dd543e5dc732049ebe779ca317ac74.tar.bz2 newspipe-2710670654dd543e5dc732049ebe779ca317ac74.zip |
Improved templates: rendering of the list of articles
Diffstat (limited to 'pyaggr3g470r/templates')
-rw-r--r-- | pyaggr3g470r/templates/home.html | 34 | ||||
-rw-r--r-- | pyaggr3g470r/templates/unread.html | 34 |
2 files changed, 46 insertions, 22 deletions
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 @@ <a href="/articles/{{ feed.id }}"><i class="glyphicon glyphicon-th-list"></i></a> </div> </div> - {% for number in range(0, feed.articles|length-2, 3) %} - <div class="row"> - {% for n in range(number, number+3) %} - <div class="col-xs-6 col-sm-4 col-md-4"> - {% if feed.articles[n].readed %}<h3>{% else %}<h1>{% endif %} - <a href="/article/{{ feed.articles[n].id }}">{{ feed.articles[n].title }}</a><h2> - {% if feed.articles[n].readed %}</h3>{% else %}</h1>{% endif %} - <h6>{{ feed.articles[n].date }}</h6> + {% for number in range(0, feed.articles|length-(feed.articles|length % 3), 3) %} + <div class="row"> + {% for n in range(number, number+3) %} + <div class="col-xs-6 col-sm-4 col-md-4"> + {% if feed.articles[n].readed %}<h3>{% else %}<h1>{% endif %} + <a href="/article/{{ feed.articles[n].id }}">{{ feed.articles[n].title }}</a><h2> + {% if feed.articles[n].readed %}</h3>{% else %}</h1>{% endif %} + <h6>{{ feed.articles[n].date }}</h6> + </div> + {% endfor %} </div> - {% endfor %} - </div> - {% endfor %} + {% endfor %} + {% if feed.articles|length % 3 != 0 %} + <div class="row"> + {% for n in range(0, feed.articles|length % 3) %} + <div class="col-xs-6 col-sm-4 col-md-4"> + {% if feed.articles[n].readed %}<h3>{% else %}<h1>{% endif %} + <a href="/article/{{ feed.articles[n].id }}">{{ feed.articles[n].title }}</a><h2> + {% if feed.articles[n].readed %}</h3>{% else %}</h1>{% endif %} + <h6>{{ feed.articles[n].date }}</h6> + </div> + {% endfor %} + </div> + {% endif %} {% endfor %} </div><!-- /.container --> {% endblock %}
\ No newline at end of file diff --git a/pyaggr3g470r/templates/unread.html b/pyaggr3g470r/templates/unread.html index 0344263f..bf17356f 100644 --- a/pyaggr3g470r/templates/unread.html +++ b/pyaggr3g470r/templates/unread.html @@ -8,18 +8,30 @@ <a href="/articles/{{ feed.id }}"><i class="glyphicon glyphicon-th-list"></i></a> </div> </div> - {% for number in range(0, feed.articles|length-2, 3) %} - <div class="row"> - {% for n in range(number, number+3) %} - <div class="col-xs-6 col-sm-4 col-md-4"> - {% if feed.articles[n].readed %}<h3>{% else %}<h1>{% endif %} - <a href="/article/{{ feed.articles[n].id }}">{{ feed.articles[n].title }}</a><h2> - {% if feed.articles[n].readed %}</h3>{% else %}</h1>{% endif %} - <h6>{{ feed.articles[n].date }}</h6> + {% for number in range(0, feed.articles|length-(feed.articles|length % 3), 3) %} + <div class="row"> + {% for n in range(number, number+3) %} + <div class="col-xs-6 col-sm-4 col-md-4"> + {% if feed.articles[n].readed %}<h3>{% else %}<h1>{% endif %} + <a href="/article/{{ feed.articles[n].id }}">{{ feed.articles[n].title }}</a><h2> + {% if feed.articles[n].readed %}</h3>{% else %}</h1>{% endif %} + <h6>{{ feed.articles[n].date }}</h6> + </div> + {% endfor %} </div> - {% endfor %} - </div> - {% endfor %} + {% endfor %} + {% if feed.articles|length % 3 != 0 %} + <div class="row"> + {% for n in range(0, feed.articles|length % 3) %} + <div class="col-xs-6 col-sm-4 col-md-4"> + {% if feed.articles[n].readed %}<h3>{% else %}<h1>{% endif %} + <a href="/article/{{ feed.articles[n].id }}">{{ feed.articles[n].title }}</a><h2> + {% if feed.articles[n].readed %}</h3>{% else %}</h1>{% endif %} + <h6>{{ feed.articles[n].date }}</h6> + </div> + {% endfor %} + </div> + {% endif %} {% endfor %} </div><!-- /.container --> {% endblock %}
\ No newline at end of file |