]> git.parisson.com Git - mezzo.git/commitdiff
Fix price 0 display
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 8 Dec 2016 17:29:38 +0000 (18:29 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 8 Dec 2016 17:29:38 +0000 (18:29 +0100)
app/templates/agenda/includes/event_metainfo.html
app/templates/agenda/includes/event_metainfo_line.html

index af37ea4ad860542c7fb599ba5fdd765cc3201f0c..00f5ae72aff6ea85dd04e77ef227d93ea3a3a105 100644 (file)
 {% endif %}
 
 {% if unit_booking %}
-    {% if event.prices.all|length > 0 %}
-        {% for price in event.prices.all %}
-            {% if forloop.first %}
-                <div class="page__meta-title page__meta-title--small">{% trans "Prices" %}</div>
-                <p class="page__meta-text">
-            {% endif %}
-            {% if price.event_price_description.description %}
-                {{ price.event_price_description.description }} :
-            {% endif %}
-            {{ price.value|floatformat:"-2" }} {{ price.unit }} {% if not forloop.last %} <br /> {% endif %}
-            {% if forloop.last %}
-                </p>
-            {% endif %}
-        {% endfor %}
+    {% if event.prices.all %}
+        {% if event.prices.all.0|floatformat != '0' %}
+            {% for price in event.prices.all %}
+                {% if forloop.first %}
+                    <div class="page__meta-title page__meta-title--small">{% trans "Prices" %}</div>
+                    <p class="page__meta-text">
+                {% endif %}
+                {% if price.event_price_description.description %}
+                    {{ price.event_price_description.description }} :
+                {% endif %}
+                {{ price.value|floatformat:"-2" }} {{ price.unit }} {% if not forloop.last %} <br /> {% endif %}
+                {% if forloop.last %}
+                    </p>
+                {% endif %}
+            {% endfor %}
+        {% else %}
+            <p>
+                {{ event.no_price_comments }}
+            </p>
+        {% endif %}
         <p>
             {% if event.trainings.all|length %}
                 {% with event.links.all as links %}
                 </a>
             {% endif %}
         </p>
-    {% else %}
-        {% if event.prices.all.0 and event.prices.all.0|floatformat != '0' %}
-            <p>
-                {{ price.unit }}
-            </p>
-        {% elif event.no_price_comments %}
-            <p>
-                {{ event.no_price_comments }}
-            </p>
-        {% endif %}
     {% endif %}
 {% endif %}
index ca525bdffd1c7bf43cd738e70e4be5a797391451..39ba95b8119b1cdae87f4d0916c7cbda914d3990 100644 (file)
@@ -14,7 +14,7 @@
 
 {% if unit_booking %}
 
-    {% if event.prices.all.0|floatformat != '0' and event.prices.all|length > 0 and not is_archive %}
+    {% if event.prices.all and not is_archive %}
         <p>
             {% if event.trainings.all|length %}
                 {% with event.links.all as links %}