diff sat_templates/templates/bulma/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 1928ba66c194
children 80cfec962b1e
line wrap: on
line diff
--- a/sat_templates/templates/bulma/blog/item.html	Fri Jun 19 17:57:13 2020 +0200
+++ b/sat_templates/templates/bulma/blog/item.html	Thu Jul 16 09:08:32 2020 +0200
@@ -24,7 +24,7 @@
             {% endif %}
         {% endif %}
         <div class="media-content">
-            {% set title = item.title_xhtml or item.title%}
+            {% set title = item.title_xhtml|safe or item.title%}
             {% if title %}
                 <h4 class="title is-4">{{title}}</h1>
             {% endif %}
@@ -47,15 +47,15 @@
                     {% endif %}
                 </p>
                 <p>
-                    {{- item.content_xhtml or item.content|urlize or '' -}}
+                    {{- item.content_xhtml|safe if item.content_xhtml is defined else item.content|urlize -}}
                 </p>
-                {% for comments_items in item.comments_items_list %}
-                    {% for item in comments_items %}
+                {% for comments_data in item.comments %}
+                    {% for item in comments_data['items'] %}
                         {% include 'blog/item.html' %}
                     {% endfor %}
                     {% if allow_commenting and item_level == 1 %}
                         <div class="comment_post">
-                            {{- textbox.comment(service=comments_items.service, node=comments_items.node) -}}
+                            {{- textbox.comment(service=comments_data.service, node=comments_data.node) -}}
                         </div>
                     {% endif %}
                 {% endfor %}