From 84d1f5793a95ec2cacf2fbad3dee0541fe9ede3f Mon Sep 17 00:00:00 2001 From: Laurent Date: Tue, 15 Oct 2019 14:37:03 +0200 Subject: [PATCH] Adds HTML to post template + fix attempt --- news/templates/news/index.html | 4 +++- news/templates/news/post.html | 30 ++++++++++++++++++++---------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/news/templates/news/index.html b/news/templates/news/index.html index 1cfa0f9..6e0b12c 100644 --- a/news/templates/news/index.html +++ b/news/templates/news/index.html @@ -105,7 +105,9 @@ {% elif post.style == 4 %} - {{ post.body |safe }} + {% autoescape off %} + {{ post.body }} + {% endautoescape %}
diff --git a/news/templates/news/post.html b/news/templates/news/post.html index 700ee7a..ac18a40 100644 --- a/news/templates/news/post.html +++ b/news/templates/news/post.html @@ -10,15 +10,25 @@
- {% if post.style == 1 %} -
- {% endif %} - {% if post.style != 2 %} -

{{ post.title }}

- {% endif %} - {% if post.style == 1 %} -
- {% endif %} +{% if post.style == 4 %} +{% autoescape off %} +{{ post.body }} +{% endautoescape %} +{% else %} + +{% if post.style == 1 %} +
+{% endif %} +{% if post.style != 2 %} +

{{ post.title }}

+{% endif %} +{% if post.style == 1 %} +
+{% endif %} + +{% endif %} + +
{{ post.date }} - {{ post.author.username }} @@ -27,7 +37,7 @@ {% if post.style == 3 %} - {% elif post.style != 1 %} + {% elif post.style != 1 and post.style != 4 %} {% endif %}