From 73268d42f342fdf27ed42cb32544438630443e9d Mon Sep 17 00:00:00 2001 From: Stan Triepels <1939656+GDay@users.noreply.github.com> Date: Thu, 19 Oct 2023 01:30:54 +0200 Subject: [PATCH] Fix content list rendering (#379) --- back/new_hire/templates/_content.html | 17 +---------------- back/new_hire/templates/_render_list.html | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 back/new_hire/templates/_render_list.html diff --git a/back/new_hire/templates/_content.html b/back/new_hire/templates/_content.html index db2773f90..b6a9d6d13 100644 --- a/back/new_hire/templates/_content.html +++ b/back/new_hire/templates/_content.html @@ -15,22 +15,7 @@
{{ block.data.text|safe|personalize:user}}
{% endif %} {% if block.type == 'list' %} - {% if block.data.style == 'ordered' %} -
    - {% endif %} - {% if block.data.style == 'unordered' %} - - {% endif %} - {% if block.data.style == 'ordered' %} -
- {% endif %} -
{{ block.data.text|safe|personalize:user }}
+ {% include "_render_list.html" with items=block.data.items blockstyle=block.data.style %} {% endif %} {% if block.type == 'embed' %} {% if 'youtube' in block.data.embed %} diff --git a/back/new_hire/templates/_render_list.html b/back/new_hire/templates/_render_list.html new file mode 100644 index 000000000..e17dc843a --- /dev/null +++ b/back/new_hire/templates/_render_list.html @@ -0,0 +1,17 @@ +{% load general %} +{% if blockstyle == 'ordered' and items %} +
    +{% endif %} +{% if blockstyle == 'unordered' and items %} + +{% endif %} +{% if blockstyle == 'ordered' and items %} +
+{% endif %}