Mercurial > libervia-templates
comparison default/blog/articles.html @ 16:8cdcbe0d7dee
blog: various appareance improvments:
- use new .box classe
- article as a maxium size and is expandable on click
- display comments in a different way
- author and date are now visible
- responsive design
- placeholders on comment input
- transitions
- various other improvments
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 04 May 2017 01:00:23 +0200 |
parents | 8b5615a1bf3d |
children | 8fa2fd2e928e |
comparison
equal
deleted
inserted
replaced
15:c319291943be | 16:8cdcbe0d7dee |
---|---|
1 {% if not embedded %}{% extends 'base/base.html' %}{% endif %} | 1 {% if not embedded %}{% extends 'base/base.html' %}{% endif %} |
2 {% import 'input/comment.html' as comment %} | 2 {% import 'input/comment.html' as comment %} |
3 | 3 |
4 {% macro show_items(items) %} | 4 {% macro show_items(items, comments=False) %} |
5 {# show items and comments items if present after each item, | 5 {# show items and comments items if present after each item, |
6 then post form if allow_commenting is set #} | 6 then post form if allow_commenting is set #} |
7 {% for item in items %} | 7 {% for item in items %} |
8 {% include 'blog/item.html' %} | 8 {% if not comments %}<div class="main_article">{% endif %} |
9 {% include 'blog/item.html' %} | |
10 {% if not comments %}</div>{% endif %} | |
9 | 11 |
12 {# we recursively display comments for all comments nodes (usually there's only one) #} | |
10 {% for comments_items in item.comments_items_list %} | 13 {% for comments_items in item.comments_items_list %} |
14 <button class="comments_btn" onclick="document.getElementById('{{comments_panel|next_gidx}}').classList.toggle('show')">show comments ({{comments_items|count}})</button> | |
15 <div id="{{comments_panel|cur_gidx}}" class="comments_panel"> | |
16 {% if allow_commenting %} | |
17 <div class="comment_post"> | |
18 {{ comment.comment(service=comments_items.service, node=comments_items.node) }} | |
19 </div> | |
20 {% endif %} | |
11 | 21 |
12 {% if allow_commenting %} | 22 <div class="comments"> |
13 <div id="comment_post"> | 23 {{show_items(comments_items, comments=True)}} |
14 {{ comment.comment(service=comments_items.service, node=comments_items.node) }} | |
15 </div> | 24 </div> |
16 {% endif %} | |
17 | |
18 <div class="comments"> | |
19 {{show_items(comments_items)}} | |
20 </div> | 25 </div> |
21 | 26 |
22 {% endfor %} | 27 {% endfor %} |
23 | 28 |
24 {% endfor %} | 29 {% endfor %} |