From: Guillaume Pellerin Date: Wed, 24 Aug 2016 10:55:40 +0000 (+0200) Subject: CustomPage: add automatic lorem ipsum content, fix blocks X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=bf6645f387a707729c90875b5981794d7d142648;p=mezzo.git CustomPage: add automatic lorem ipsum content, fix blocks --- diff --git a/app/templates/pages/custompage.html b/app/templates/pages/custompage.html index 2710b00b..4e37acf1 100644 --- a/app/templates/pages/custompage.html +++ b/app/templates/pages/custompage.html @@ -20,11 +20,9 @@ {% endblock %} {% block page_title %} - {% editable page.custompage.title %}

{{ page.custompage.title }}

{% endeditable %} - {% endblock %} {% block page_content %} @@ -37,9 +35,13 @@ {% endeditable %} {% endif %} - {% editable page.custompage.content %} + {% if page.custompage.content %} + {% editable page.custompage.content %} {{ page.custompage.content|richtext_filters|safe }} - {% endeditable %} + {% endeditable %} + {% else %} + {% lorem 3 p %} + {% endif %} {% if page.get_ascendants|length == 1 %} {% children_pages page.id as childrens %} @@ -57,20 +59,24 @@ {% endblock %} {% block page_sub_content %} - {% if page.custompage.pageblock_set.all %} + {% if page.custompage.page_blocks.all %}

- {% for pageblock in page.custompage.pageblock_set.all %} + {% for pageblock in page.custompage.page_blocks.all %}
{% if not forloop.first and pageblock.with_separator %}
{% endif %}

{{ pageblock.title }}

- {{ pageblock.content|richtext_filters|safe }} + {% if pageblock.content %} + {{ pageblock.content|richtext_filters|safe }} + {% else %} + {% lorem 3 p %} + {% endif %}
{% endfor %}