Mercurial > libervia-templates
annotate default/blog/articles.html @ 43:f8798d691acf
blog/articles: fixed comments transition:
- as for blog articles, removed max-height workaround in favor of clicked_mh_fix function
- changed show to hide in button when comments are expanded
- reduced transition time
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 13 Jul 2017 08:41:07 +0200 |
parents | f371bc50ea45 |
children | f19e9f5e43b0 |
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 %} |
38
f371bc50ea45
blog/articles: added context when importing comment, so csrf_token is transmited to the macro.
Goffi <goffi@goffi.org>
parents:
20
diff
changeset
|
2 {% import 'input/comment.html' as comment with context %} |
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 %} |
43
f8798d691acf
blog/articles: fixed comments transition:
Goffi <goffi@goffi.org>
parents:
38
diff
changeset
|
14 <button class="comments_btn" onclick="clicked_mh_fix('{{comments_panel|next_gidx}}');clicked_cls(this)"> |
f8798d691acf
blog/articles: fixed comments transition:
Goffi <goffi@goffi.org>
parents:
38
diff
changeset
|
15 <span class='show'>{% trans %}show comments{% endtrans %}</span> |
f8798d691acf
blog/articles: fixed comments transition:
Goffi <goffi@goffi.org>
parents:
38
diff
changeset
|
16 <span class='hide'>{% trans %}hide comments{% endtrans %}</span> |
f8798d691acf
blog/articles: fixed comments transition:
Goffi <goffi@goffi.org>
parents:
38
diff
changeset
|
17 ({{comments_items|count}}) |
f8798d691acf
blog/articles: fixed comments transition:
Goffi <goffi@goffi.org>
parents:
38
diff
changeset
|
18 </button> |
16
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
19 <div id="{{comments_panel|cur_gidx}}" class="comments_panel"> |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
20 {% if allow_commenting %} |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
21 <div class="comment_post"> |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
22 {{ comment.comment(service=comments_items.service, node=comments_items.node) }} |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
23 </div> |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
24 {% endif %} |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
25 |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
26 <div class="comments"> |
8cdcbe0d7dee
blog: various appareance improvments:
Goffi <goffi@goffi.org>
parents:
10
diff
changeset
|
27 {{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
|
28 </div> |
7353e5c54359
blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
Goffi <goffi@goffi.org>
parents:
0
diff
changeset
|
29 </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
|
30 |
8
7353e5c54359
blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
Goffi <goffi@goffi.org>
parents:
0
diff
changeset
|
31 {% 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
|
32 |
8
7353e5c54359
blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
Goffi <goffi@goffi.org>
parents:
0
diff
changeset
|
33 {% endfor %} |
7353e5c54359
blog/articles: comments are now displayed if chained, and allow_commenting activate commenting form
Goffi <goffi@goffi.org>
parents:
0
diff
changeset
|
34 {% endmacro %} |
0 | 35 |
36 {% block body %} | |
37 <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
|
38 {{ show_items(items) }} |
0 | 39 </div> |
40 {% endblock body %} |