comparison default/blog/articles.html @ 10:8b5615a1bf3d

articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
author Goffi <goffi@goffi.org>
date Thu, 27 Apr 2017 01:07:28 +0200
parents 7353e5c54359
children 8cdcbe0d7dee
comparison
equal deleted inserted replaced
9:7a1626e78d53 10:8b5615a1bf3d
1 {% extends 'base/base.html' %} 1 {% if not embedded %}{% extends 'base/base.html' %}{% endif %}
2 {% import 'input/comments.html' as comments %} 2 {% import 'input/comment.html' as comment %}
3
4 3
5 {% macro show_items(items) %} 4 {% macro show_items(items) %}
6 {# show items and comments items if present after each item, 5 {# show items and comments items if present after each item,
7 then post form if allow_commenting is set #} 6 then post form if allow_commenting is set #}
8 {% for item in items %} 7 {% for item in items %}
9 {% include 'blog/item.html' %} 8 {% include 'blog/item.html' %}
9
10 {% for comments_items in item.comments_items_list %} 10 {% for comments_items in item.comments_items_list %}
11
11 {% if allow_commenting %} 12 {% if allow_commenting %}
12 <div id="comment_post"> 13 <div id="comment_post">
13 {{ comments.comment(service=comments_items.service, node=comments_items.node) }} 14 {{ comment.comment(service=comments_items.service, node=comments_items.node) }}
14 </div> 15 </div>
15 {% endif %} 16 {% endif %}
17
16 <div class="comments"> 18 <div class="comments">
17 {{show_items(comments_items)}} 19 {{show_items(comments_items)}}
18 </div> 20 </div>
21
19 {% endfor %} 22 {% endfor %}
23
20 {% endfor %} 24 {% endfor %}
21 {% endmacro %} 25 {% endmacro %}
22 26
23 {% block body %} 27 {% block body %}
24 <div id="blog_items"> 28 <div id="blog_items">