]> git.parisson.com Git - mezzo.git/commitdiff
Task #257: display block if content exists
authorEmilie <zawadzki@ircam.fr>
Wed, 26 Oct 2016 13:06:56 +0000 (15:06 +0200)
committerEmilie <zawadzki@ircam.fr>
Wed, 26 Oct 2016 13:06:56 +0000 (15:06 +0200)
app/templates/core/inc/block.html

index a969e76bf171214fd0f9ed98e1ad11398ff1c17c..fc60592f52119dedcfa1985fd2f6835eb875cfb1 100644 (file)
@@ -1,28 +1,32 @@
 {% load i18n mezzanine_tags keyword_tags pages_tags organization_tags %}
 {% if blocks %}
     <div class="white-bg pb2">
+        {% if blocks.first.content %}
         <hr class="mt0" />
+        {% endif %}
         {% for block in blocks %}
-            {% if not forloop.first and block.with_separator %}
-                <hr />
-            {% endif %}
-            <div class="page__block{% if block.background_color %} page__block--{{ block.background_color }}{% endif %}">
-                <div class="container">
-                    <div class="row" data-summary-content>
-                        <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2">
-                            <h2 class="dotted">{{ block.title }}</h2>
-                            {% if block.description %}
-                                <div class="chapo">
-                                    {{ block.description }}
-                                </div>
-                            {% endif %}
-                            {% if block.content %}
-                                 {{ block.content|richtext_filters|safe }}
-                            {% endif %}
+            {% if block.content %}
+                {% if not forloop.first and block.with_separator %}
+                    <hr />
+                {% endif %}
+                <div class="page__block{% if block.background_color %} page__block--{{ block.background_color }}{% endif %}">
+                    <div class="container">
+                        <div class="row" data-summary-content>
+                            <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2">
+                                <h2 class="dotted">{{ block.title }}</h2>
+                                {% if block.description %}
+                                    <div class="chapo">
+                                        {{ block.description }}
+                                    </div>
+                                {% endif %}
+                                {% if block.content %}
+                                     {{ block.content|richtext_filters|safe }}
+                                {% endif %}
+                            </div>
                         </div>
                     </div>
                 </div>
-            </div>
+            {% endif %}
         {% endfor %}
     </div>
 {% endif %}