From 124d23a42f7e6153c8b4de59dd337bdd98a9d893 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 22 Jul 2019 11:14:59 +0200 Subject: [PATCH 1/1] Banner fixes. --- src/social/templates/social/carousel.html | 8 +++++--- src/social/templatetags/social_tags.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/social/templates/social/carousel.html b/src/social/templates/social/carousel.html index ed63b5bf1..64380bc50 100644 --- a/src/social/templates/social/carousel.html +++ b/src/social/templates/social/carousel.html @@ -5,9 +5,11 @@ data-cycle-pause-on-hover="true" > -
-
-
+ {% if banners|length > 1 %} +
+
+
+ {% endif %} {% for banner in banners %} {% if banner %} diff --git a/src/social/templatetags/social_tags.py b/src/social/templatetags/social_tags.py index 90ed51817..0af1da285 100644 --- a/src/social/templatetags/social_tags.py +++ b/src/social/templatetags/social_tags.py @@ -57,7 +57,7 @@ def carousel(context, slug): carousel = Carousel.objects.get(slug=slug) except Carousel.DoesNotExist: # TODO: add sanity check for install. - carousel = None + carousel = Carousel.objects.create(slug=slug) banners = [ item.get_banner() for item in carousel.carouselitem_set.all().select_related('banner') -- 2.20.1