Mercurial > libervia-templates
comparison sat_templates/templates/default/blog/item.html @ 247:40fccd3b7cf0
updated code to handle blog items following data structure change in backend/Libervia
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 16 Jul 2020 09:08:32 +0200 |
parents | aa37750c2617 |
children | c5de5514a251 |
comparison
equal
deleted
inserted
replaced
246:1928ba66c194 | 247:40fccd3b7cf0 |
---|---|
26 {# title and publication date link to a HTTP page if items_http_uri is set #} | 26 {# title and publication date link to a HTTP page if items_http_uri is set #} |
27 {% set item_http_uri = items_http_uri.get(item.id) if items_http_uri is defined else none %} | 27 {% set item_http_uri = items_http_uri.get(item.id) if items_http_uri is defined else none %} |
28 | 28 |
29 <div class="blog__title"> | 29 <div class="blog__title"> |
30 {% block blog_title scoped %} | 30 {% block blog_title scoped %} |
31 {% set title = item.title_xhtml or item.title or '' %} | 31 {% set title = item.title_xhtml|safe or item.title or '' %} |
32 {% if item_http_uri %} | 32 {% if item_http_uri %} |
33 <a href="{{item_http_uri}}">{{title}}</a> | 33 <a href="{{item_http_uri}}">{{title}}</a> |
34 {% else %} | 34 {% else %} |
35 {{title}} | 35 {{title}} |
36 {% endif %} | 36 {% endif %} |
40 <div class="blog__metadata"> | 40 <div class="blog__metadata"> |
41 {% if identities is defined %} | 41 {% if identities is defined %} |
42 {% if avatar is defined %} | 42 {% if avatar is defined %} |
43 {{ avatar.avatar(item.author_jid, "avatar--float-left") }} | 43 {{ avatar.avatar(item.author_jid, "avatar--float-left") }} |
44 {% endif %} | 44 {% endif %} |
45 <span class="blog__author">{{identities[item.author_jid].nicknames[0] if identities[item.author_jid].nicknames else item.author}}</span> | 45 <span class="blog__author">{{identities[item.author_jid].nicknames[0] if identities[item.author_jid].nicknames else item.author)}}</span> |
46 {% else %} | 46 {% else %} |
47 <span class="blog__author">{{item.author}}</span> | 47 <span class="blog__author">{{item.author}}</span> |
48 {% endif %} | 48 {% endif %} |
49 {% set published = item.published|date_fmt(fmt=dates_format) %} | 49 {% set published = item.published|date_fmt(fmt=dates_format) %} |
50 {% if item_http_uri %} | 50 {% if item_http_uri %} |
70 {% endblock header %} | 70 {% endblock header %} |
71 </header> | 71 </header> |
72 | 72 |
73 <div class="box__content{{' box__content--plaintext' if not item.content_xhtml}}"> | 73 <div class="box__content{{' box__content--plaintext' if not item.content_xhtml}}"> |
74 {% block content %} | 74 {% block content %} |
75 {{- item.content_xhtml or item.content|urlize or '' -}} | 75 {{- item.content_xhtml|safe or item.content|urlize or '' -}} |
76 {% endblock content %} | 76 {% endblock content %} |
77 </div> | 77 </div> |
78 | 78 |
79 </article> | 79 </article> |
80 | 80 |