]> git.parisson.com Git - mezzo.git/commitdiff
CustomPage: add automatic lorem ipsum content, fix blocks
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 24 Aug 2016 10:55:40 +0000 (12:55 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 24 Aug 2016 10:55:40 +0000 (12:55 +0200)
app/templates/pages/custompage.html

index 2710b00bef92e977d1a3040933524b4a3c9dac84..4e37acf123be9feca1c12a67db80e890a8c3c786 100644 (file)
 {% endblock %}
 
 {% block page_title %}
-
     {% editable page.custompage.title %}
         <h1 class="dotted">{{ page.custompage.title }}</h1>
     {% endeditable %}
-
 {% endblock %}
 
 {% block page_content %}
         {% 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 %}
 {% endblock %}
 
 {% block page_sub_content %}
-    {% if page.custompage.pageblock_set.all %}
+    {% if page.custompage.page_blocks.all %}
         <div class="white-bg">
             <div class="container">
                 <div class="row">
                     <div class="col-sm-12">
                         <hr class="mt0" />
-                        {% for pageblock in page.custompage.pageblock_set.all %}
+                        {% for pageblock in page.custompage.page_blocks.all %}
                             <div class="row" data-summary-content>
                                 <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2 white-bg">
                                     {% if not forloop.first and pageblock.with_separator %}
                                         <hr />
                                     {% endif %}
                                     <h2 class="dotted">{{ pageblock.title }}</h2>
-                                    {{ pageblock.content|richtext_filters|safe }}
+                                    {% if pageblock.content %}
+                                         {{ pageblock.content|richtext_filters|safe }}
+                                    {% else %}
+                                        {% lorem 3 p %}
+                                    {% endif %}
                                 </div>
                             </div>
                         {% endfor %}