From: Guillaume Pellerin Date: Thu, 25 Aug 2016 16:17:00 +0000 (+0200) Subject: Add a generic block template (see custompage.html) X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=b34c8e41df88235a7d87d19f43ec103972f4b2e2;p=mezzo.git Add a generic block template (see custompage.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 %}