230
|
1 {# display a blog item which can be expanded/retracted by clicking on it |
|
2 |
|
3 if the locale differs from item language, it will be totally reduced, and will need a click to be displayed |
|
4 |
|
5 @variable item(data_object.BlogItem): item to display |
|
6 @variable identities(data_object.Identities): identities which can be used to display info on item author |
|
7 @variable dates_format(unicode): format of the date to use (see date_fmt filter) |
|
8 #} |
|
9 |
|
10 {% block item %} |
|
11 |
|
12 {% set item_level = (item_level or 0) + 1 %} |
|
13 |
|
14 {% if item.language and locale and locale.language != item.language %} |
|
15 {# we may display items in different language in a specific way #} |
|
16 {% set other_lang = " other_lang" if expanded else " other_lang state_init" %} |
|
17 {% endif %} |
|
18 <article id="{{item.id}}" class="media has-background-white has-padding-1" > |
|
19 {% if identities is defined %} |
|
20 {% if avatar is defined %} |
|
21 <div class="media-left"> |
|
22 {{ avatar.avatar(item.author_jid) }} |
|
23 </div> |
|
24 {% endif %} |
|
25 {% endif %} |
|
26 <div class="media-content"> |
|
27 {% set title = item.title_xhtml or item.title%} |
|
28 {% if title %} |
|
29 <h4 class="title is-4">{{title}}</h1> |
|
30 {% endif %} |
|
31 <div class="content"> |
|
32 <p class="subtitle is-6 has-text-grey"> |
|
33 {% set published = item.published|date_fmt(fmt=dates_format) %} |
|
34 <strong>{{item.author}}</strong> <small>{{published}}</small> |
|
35 {% if item.tags %} |
|
36 <small class="labels"> |
|
37 {% if tags_http_uri is defined %} |
|
38 {% for tag in item.tags %} |
|
39 <a href="{{tags_http_uri[tag]}}"><span class="tag is-rounded">{{tag}}</span></a> |
|
40 {% endfor %} |
|
41 {% else %} |
|
42 {% for tag in item.tags %} |
|
43 <span class="tag">{{tag}}</span> |
|
44 {% endfor %} |
|
45 {% endif %} |
|
46 </small> |
|
47 {% endif %} |
|
48 </p> |
|
49 <p> |
|
50 {{- item.content_xhtml or item.content|urlize or '' -}} |
|
51 </p> |
|
52 {% for comments_items in item.comments_items_list %} |
|
53 {% for item in comments_items %} |
|
54 {% include 'blog/item.html' %} |
|
55 {% endfor %} |
|
56 {% if allow_commenting and item_level == 1 %} |
|
57 <div class="comment_post"> |
|
58 {{- textbox.comment(service=comments_items.service, node=comments_items.node) -}} |
|
59 </div> |
|
60 {% endif %} |
|
61 {% endfor %} |
|
62 |
|
63 </div> |
|
64 </div> |
|
65 </article> |
|
66 |
|
67 {% endblock item %} |