From ce8407274be5e35f1afd0da9070b0c6d8ffcffb9 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 8 Dec 2016 18:29:38 +0100 Subject: [PATCH] Fix price 0 display --- .../agenda/includes/event_metainfo.html | 44 +++++++++---------- .../agenda/includes/event_metainfo_line.html | 2 +- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/app/templates/agenda/includes/event_metainfo.html b/app/templates/agenda/includes/event_metainfo.html index af37ea4a..00f5ae72 100644 --- a/app/templates/agenda/includes/event_metainfo.html +++ b/app/templates/agenda/includes/event_metainfo.html @@ -41,20 +41,26 @@ {% endif %} {% if unit_booking %} - {% if event.prices.all|length > 0 %} - {% for price in event.prices.all %} - {% if forloop.first %} -
{% trans "Prices" %}
-

- {% endif %} - {% if price.event_price_description.description %} - {{ price.event_price_description.description }} : - {% endif %} - {{ price.value|floatformat:"-2" }} {{ price.unit }} {% if not forloop.last %}
{% endif %} - {% if forloop.last %} -

- {% endif %} - {% endfor %} + {% if event.prices.all %} + {% if event.prices.all.0|floatformat != '0' %} + {% for price in event.prices.all %} + {% if forloop.first %} +
{% trans "Prices" %}
+

+ {% endif %} + {% if price.event_price_description.description %} + {{ price.event_price_description.description }} : + {% endif %} + {{ price.value|floatformat:"-2" }} {{ price.unit }} {% if not forloop.last %}
{% endif %} + {% if forloop.last %} +

+ {% endif %} + {% endfor %} + {% else %} +

+ {{ event.no_price_comments }} +

+ {% endif %}

{% if event.trainings.all|length %} {% with event.links.all as links %} @@ -70,15 +76,5 @@ {% endif %}

- {% else %} - {% if event.prices.all.0 and event.prices.all.0|floatformat != '0' %} -

- {{ price.unit }} -

- {% elif event.no_price_comments %} -

- {{ event.no_price_comments }} -

- {% endif %} {% endif %} {% endif %} diff --git a/app/templates/agenda/includes/event_metainfo_line.html b/app/templates/agenda/includes/event_metainfo_line.html index ca525bdf..39ba95b8 100644 --- a/app/templates/agenda/includes/event_metainfo_line.html +++ b/app/templates/agenda/includes/event_metainfo_line.html @@ -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 %}

{% if event.trainings.all|length %} {% with event.links.all as links %} -- 2.39.5