From f6cf62b76e6fd91739a799b24e1a5c1b5e1c828f Mon Sep 17 00:00:00 2001
From: Tom Teichler <tom.teichler@teckids.org>
Date: Sun, 1 Mar 2020 16:37:54 +0100
Subject: [PATCH] Allow images from content. Closes #2.

---
 templates/page_with_carousel.html | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/templates/page_with_carousel.html b/templates/page_with_carousel.html
index f3bdb78..f42b916 100644
--- a/templates/page_with_carousel.html
+++ b/templates/page_with_carousel.html
@@ -3,13 +3,14 @@
 {% block template_content %}
     <div id="myCarousel" class="carousel slide" data-ride="carousel">
         <div class="carousel-inner">
-            {% for text, image in CAROUSEL_ITEMS %}
-                <div class="item {% if loop.first %} active {% endif %}">
-                    <img class="center-block carousel-image" src="{{ image }}" alt="{{ text }}">
-                    <div class="carousel-caption d-none d-md-block">
-                        <h3>{{ text }}</h3>
+            {% for item in page.images %}
+                {% set image = item.split('|') %}
+                    <div class="item {% if loop.first %} active {% endif %}">
+                        <img class="center-block carousel-image" src="{{ image[1] }}" alt="{{ image[0] }}">
+                        <div class="carousel-caption d-none d-md-block">
+                            <h3>{{ image[0] }}</h3>
+                        </div>
                     </div>
-                </div>
              {% endfor %}
         </div>
      <a class="left carousel-control" href="#myCarousel" data-slide="prev">
-- 
GitLab