Mercurial > libervia-templates
annotate default/blog/articles.html @ 30:69a2e3bf5e17
blog/item: if item is not in same language as current locale, item is hidden but will be shown on click.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 24 Jun 2017 20:27:12 +0200 |
parents | 8fa2fd2e928e |
children | f371bc50ea45 |
rev | line source |
---|---|
10
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
8
diff
changeset
|
1 {% if not embedded %}{% extends 'base/base.html' %}{% endif %} |
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
8
diff
changeset
|
2 {% import 'input/comment.html' as comment %} |
8
7353e5c54359
blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
Goffi <goffi@goffi.org>
parents:
0
diff
changeset
|
3 |
16
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
4 {% macro show_items(items, comments=False) %} |
8
7353e5c54359
blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
Goffi <goffi@goffi.org>
parents:
0
diff
changeset
|
5 {# show items and comments items if present after each item, |
7353e5c54359
blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
Goffi <goffi@goffi.org>
parents:
0
diff
changeset
|
6 then post form if allow_commenting is set #} |
7353e5c54359
blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
Goffi <goffi@goffi.org>
parents:
0
diff
changeset
|
7 {% for item in items %} |
16
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
8 {% if not comments %}<div class="main_article">{% endif %} |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
9 {% include 'blog/item.html' %} |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
10 {% if not comments %}</div>{% endif %} |
10
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
8
diff
changeset
|
11 |
16
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
12 {# we recursively display comments for all comments nodes (usually there's only one) #} |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
13 {% for comments_items in item.comments_items_list %} |
20 | 14 <button class="comments_btn" onclick="document.getElementById('{{comments_panel|next_gidx}}').classList.toggle('show')">{% trans %}show comments{% endtrans %} ({{comments_items|count}})</button> |
16
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
15 <div id="{{comments_panel|cur_gidx}}" class="comments_panel"> |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
16 {% if allow_commenting %} |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
17 <div class="comment_post"> |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
18 {{ comment.comment(service=comments_items.service, node=comments_items.node) }} |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
19 </div> |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
20 {% endif %} |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
21 |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
22 <div class="comments"> |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
23 {{show_items(comments_items, comments=True)}} |
8
7353e5c54359
blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
Goffi <goffi@goffi.org>
parents:
0
diff
changeset
|
24 </div> |
7353e5c54359
blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
Goffi <goffi@goffi.org>
parents:
0
diff
changeset
|
25 </div> |
10
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
8
diff
changeset
|
26 |
8
7353e5c54359
blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
Goffi <goffi@goffi.org>
parents:
0
diff
changeset
|
27 {% endfor %} |
10
8b5615a1bf3d
articles, input: use new embedding mechanism in articles + new macros to build forms and inputs
Goffi <goffi@goffi.org>
parents:
8
diff
changeset
|
28 |
8
7353e5c54359
blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
Goffi <goffi@goffi.org>
parents:
0
diff
changeset
|
29 {% endfor %} |
7353e5c54359
blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
Goffi <goffi@goffi.org>
parents:
0
diff
changeset
|
30 {% endmacro %} |
0 | 31 |
32 {% block body %} | |
33 <div id="blog_items"> | |
8
7353e5c54359
blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
Goffi <goffi@goffi.org>
parents:
0
diff
changeset
|
34 {{ show_items(items) }} |
0 | 35 </div> |
36 {% endblock body %} |