diff options
author | Matthew Lemon <y@yulqen.org> | 2024-07-04 17:41:35 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-07-04 17:41:35 +0100 |
commit | 5d37566a4352e4ba3f6db10627d1650dc21f804a (patch) | |
tree | 9d70b13baffa602999b591e832b75da8599d8f5d /pyblackbird_cc/templates | |
parent | 0936a9743e87c5c5571e7a37b6142f46ea3725d5 (diff) |
Basic implementation of a carousel
Needs lots of work and tidying up mind...
Diffstat (limited to 'pyblackbird_cc/templates')
-rw-r--r-- | pyblackbird_cc/templates/resources/resource_detail.html | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/pyblackbird_cc/templates/resources/resource_detail.html b/pyblackbird_cc/templates/resources/resource_detail.html index 8391cca..2cdebd4 100644 --- a/pyblackbird_cc/templates/resources/resource_detail.html +++ b/pyblackbird_cc/templates/resources/resource_detail.html @@ -52,25 +52,44 @@ </div> </div> </div> + + {% for snapshot_filename, snapshot_urls in resource.snapshot_urls.items %} <div class="row my-4"> <div class="col bg-white pt-3 border border-success border-opacity-25 rounded"> <h4>File preview:</h4> <p>{{ snapshot_filename|cut:".pdf" }}</p> - <div> - <div class="d-flex flex-row justify-content-center flex-wrap"> + + + <div id="carouselExampleControls" class="carousel slide" data-bs-ride="carousel"> + <div class="carousel-inner bg-primary"> + {% for snapshot_url in snapshot_urls %} - <div class="m-4"> - <img class="img-thumbnail rounded" - src="{{ snapshot_url }}" - alt="{{ snapshot_filename }}" /> + {% if forloop.first %} + <div class="carousel-item active"> + {% else %} + <div class="carousel-item"> + {% endif %} + <img src="{{ snapshot_url }}" class="d-block w-50 mx-auto img-thumbnail rounded" alt="{{ snapshot_name }}"> </div> - {% endfor %} + {% endfor %} + </div> + <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="prev"> + <span class="carousel-control-prev-icon" aria-hidden="true"></span> + <span class="visually-hidden">Previous</span> + </button> + <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="next"> + <span class="carousel-control-next-icon" aria-hidden="true"></span> + <span class="visually-hidden">Next</span> + </button> </div> + </div> </div> - </div> - {% endfor %} + + {% endfor %} + + <div class="row my-5"> <div class="col bg-white pt-3 border border-success border-opacity-25 rounded"> <div>{{ resource.description | markdown | safe }}</div> |