From b34c8e41df88235a7d87d19f43ec103972f4b2e2 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 25 Aug 2016 18:17:00 +0200 Subject: [PATCH] Add a generic block template (see custompage.html) --- app/templates/core/inc/block.html | 27 +++++++++++++++++++++++++ app/templates/pages/custompage.html | 31 ++++------------------------- 2 files changed, 31 insertions(+), 27 deletions(-) create mode 100644 app/templates/core/inc/block.html diff --git a/app/templates/core/inc/block.html b/app/templates/core/inc/block.html new file mode 100644 index 00000000..b404dcc7 --- /dev/null +++ b/app/templates/core/inc/block.html @@ -0,0 +1,27 @@ +{% load i18n mezzanine_tags keyword_tags pages_tags organization_tags %} +{% if blocks %} +
+
+
+
+
+ {% for block in blocks %} +
+
+ {% if not forloop.first and block.with_separator %} +
+ {% endif %} +

{{ block.title }}

+ {% if block.content %} + {{ block.content|richtext_filters|safe }} + {% else %} + {% lorem 3 p %} + {% endif %} +
+
+ {% endfor %} +
+
+
+
+{% endif %} diff --git a/app/templates/pages/custompage.html b/app/templates/pages/custompage.html index f71622a1..c2674c93 100644 --- a/app/templates/pages/custompage.html +++ b/app/templates/pages/custompage.html @@ -1,5 +1,5 @@ {% extends "pages/page.html" %} -{% load i18n mezzanine_tags keyword_tags pages_tags organization_tags %} +{% load i18n mezzanine_tags keyword_tags pages_tags organization_tags %} {% block meta_title %}{{ page.meta_title }}{% endblock %} @@ -59,30 +59,7 @@ {% endblock %} {% block page_sub_content %} - {% if page.custompage.blocks.all %} -
-
-
-
-
- {% for pageblock in page.custompage.blocks.all %} -
-
- {% if not forloop.first and pageblock.with_separator %} -
- {% endif %} -

{{ pageblock.title }}

- {% if pageblock.content %} - {{ pageblock.content|richtext_filters|safe }} - {% else %} - {% lorem 3 p %} - {% endif %} -
-
- {% endfor %} -
-
-
-
- {% endif %} + {% with page.custompage.blocks.all as blocks %} + {% include "core/inc/block.html" %} + {% endwith %} {% endblock %} -- 2.39.5