]> git.parisson.com Git - mezzo.git/commitdiff
Task #340: training link
authorEmilie <zawadzki@ircam.fr>
Thu, 3 Nov 2016 15:02:52 +0000 (16:02 +0100)
committerEmilie <zawadzki@ircam.fr>
Thu, 3 Nov 2016 15:02:52 +0000 (16:02 +0100)
app/templates/agenda/includes/event_metainfo.html

index b280134627c1557d508acab483ebb22dbd24a76b..20185c6436c4dab38be82b701ae2617cabdab908 100644 (file)
@@ -1,4 +1,4 @@
-{% load i18n mezzanine_tags event_tags  %}
+{% load i18n mezzanine_tags event_tags organization_tags %}
 
 <div class="page__meta-date">
     {% include 'agenda/includes/event_date.html' %}
             {% endif %}
         {% endfor %}
         <p>
-            <a class="button button--block" href="{% url 'event_booking' event.slug %}" class="event__meta__btn">
-                {% trans "Reserve" %}
-            </a>
+            {% if event.trainings.all|length %}
+                {% with event.links.all as links %}
+                    {% if links %}
+                        <a class="button button--block" href="{{ links|get_type_link:'link'|first }}" class="event__meta__btn">
+                            {% trans "Reserve" %}
+                        </a>
+                    {% else %}
+                        <a class="button button--block" href="{% url 'event_booking' event.slug %}" class="event__meta__btn">
+                            {% trans "Reserve" %}
+                        </a>
+                    {% endif %}
+                {% endwith %}
+            {% endif %}
         </p>
     {% else %}
         {% if event.prices.all.0|floatformat != '0' %}