Skip to content

Commit

Permalink
Fix content list rendering (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
GDay authored Oct 18, 2023
1 parent ddbdcc7 commit 73268d4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
17 changes: 1 addition & 16 deletions back/new_hire/templates/_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,7 @@
<blockquote>{{ block.data.text|safe|personalize:user}}</blockquote>
{% endif %}
{% if block.type == 'list' %}
{% if block.data.style == 'ordered' %}
<ol>
{% endif %}
{% if block.data.style == 'unordered' %}
<ul>
{% endif %}
{% for item in block.data.items %}
<li>{{item.content|safe|personalize:user}}</li>
{% endfor %}
{% if block.data.style == 'unordered' %}
</ul>
{% endif %}
{% if block.data.style == 'ordered' %}
</ol>
{% endif %}
<blockquote>{{ block.data.text|safe|personalize:user }}</blockquote>
{% include "_render_list.html" with items=block.data.items blockstyle=block.data.style %}
{% endif %}
{% if block.type == 'embed' %}
{% if 'youtube' in block.data.embed %}
Expand Down
17 changes: 17 additions & 0 deletions back/new_hire/templates/_render_list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% load general %}
{% if blockstyle == 'ordered' and items %}
<ol>
{% endif %}
{% if blockstyle == 'unordered' and items %}
<ul>
{% endif %}
{% for item in items %}
<li>{{item.content|safe|personalize:user}}</li>
{% include "_render_list.html" with items=item.items %}
{% endfor %}
{% if blockstyle == 'unordered' and items %}
</ul>
{% endif %}
{% if blockstyle == 'ordered' and items %}
</ol>
{% endif %}

0 comments on commit 73268d4

Please sign in to comment.