comparison default/blog/articles.html @ 8:7353e5c54359

blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
author Goffi <goffi@goffi.org>
date Mon, 17 Apr 2017 20:46:11 +0200
parents 9a31d2c02f47
children 8b5615a1bf3d
comparison
equal deleted inserted replaced
7:f1c773126f23 8:7353e5c54359
1 {% extends 'base/base.html' %} 1 {% extends 'base/base.html' %}
2 {% import 'input/comments.html' as comments %}
3
4
5 {% macro show_items(items) %}
6 {# show items and comments items if present after each item,
7 then post form if allow_commenting is set #}
8 {% for item in items %}
9 {% include 'blog/item.html' %}
10 {% for comments_items in item.comments_items_list %}
11 {% if allow_commenting %}
12 <div id="comment_post">
13 {{ comments.comment(service=comments_items.service, node=comments_items.node) }}
14 </div>
15 {% endif %}
16 <div class="comments">
17 {{show_items(comments_items)}}
18 </div>
19 {% endfor %}
20 {% endfor %}
21 {% endmacro %}
2 22
3 {% block body %} 23 {% block body %}
4 <div id="blog_items"> 24 <div id="blog_items">
5 {% for item in items %} 25 {{ show_items(items) }}
6 {% include 'blog/item.html' %}
7 {% endfor %}
8 </div> 26 </div>
9 {% endblock body %} 27 {% endblock body %}