]> git.parisson.com Git - mezzo.git/commitdiff
Use event.parent images
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 10 Oct 2016 15:37:59 +0000 (17:37 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 10 Oct 2016 15:37:59 +0000 (17:37 +0200)
app/templates/agenda/includes/event_linecard.html

index bebd2e3bd09956bf68fa810131b51a87458c360d..e8199f67ce54c3e2f8e8d84e4b600d07a6568d58 100644 (file)
                         <a href="{{ event.get_absolute_url }}">
                             <img class="event-line-box__image" src="{{ MEDIA_URL }}{% thumbnail images.0.file 203 140 %}" width="203" height="140">
                         </a>
+                    {% else %}
+                        {% with event.parent.images.all|get_type:'card' as images %}
+                            {% if images %}
+                                <a href="{{ event.get_absolute_url }}">
+                                    <img class="event-line-box__image" src="{{ MEDIA_URL }}{% thumbnail images.0.file 203 140 %}" width="203" height="140">
+                                </a>
+                            {% endif %}
+                        {% endwith %}
                     {% endif %}
                 {% endwith %}
             </div>