Mercurial > libervia-templates
diff sat_templates/templates/bulma/blog/item.html @ 412:c1d33d7e4b96
blog (item): Check if there are items before displaying comments:
The template was crashing if `items` field was not present at all in comments data.
rel 463
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 31 Aug 2025 12:38:49 +0200 |
parents | 5016fb0ff62f |
children |
line wrap: on
line diff
--- a/sat_templates/templates/bulma/blog/item.html Fri Jul 04 17:33:22 2025 +0200 +++ b/sat_templates/templates/bulma/blog/item.html Sun Aug 31 12:38:49 2025 +0200 @@ -111,9 +111,11 @@ {# comments #} {% for comments_data in item.comments %} - {% for item in comments_data['items'] %} - {% include 'blog/item.html' %} - {% endfor %} + {% if "items" in comment_data %} + {% for item in comments_data['items'] %} + {% include 'blog/item.html' %} + {% endfor %} + {% endif %} {% if allow_commenting and item_level == 1 %} <div class="comment_post"> {{- textbox.comment(service=comments_data.service, node=comments_data.node) -}}