{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template theme_boost/carousel


    Example context (json):
    {
        "slides": [
         {
             "index": 1,
             "active": "",
             "name": "slide_one",
             "image": "",
             "title": "Slide title",
             "subtitle": "Slide subtitle"
         },
         {
             "index": 2,
             "active": "",
             "name": "slide_two",
             "image": "",
             "title": "Slide title",
             "subtitle": "Slide subtitle"
         }
        ]
    }
}}

<section id="snap-site-carousel" class="carousel slide" data-ride="carousel" aria-label="{{covercarousellabel}}">
    <span class="sr-only">{{carouselsronlytext}}</span>

    <div class="carousel-inner" id="snap-carousel-container">
        <!-- Previous and next buttons. -->
        <div class="carousel-controls">
            <a class="carousel-control-prev" href="#snap-site-carousel" role="button" data-slide="prev">
                <i class="carousel-control-prev-icon fa-solid fa-circle-arrow-left" aria-hidden="true"></i>
                <span class="sr-only">Previous slide</span>
            </a>
            <a class="carousel-control-next" href="#snap-site-carousel" role="button" data-slide="next">
                <i class="carousel-control-next-icon fa-solid fa-circle-arrow-right" aria-hidden="true"></i>
                <span class="sr-only">Next slide</span>
            </a>
        </div>
        <!-- Carousel slides. -->
        {{#slides}}
            <div class="carousel-item carousel-{{name}} {{active}}">
                <div class="carousel-slide" style="background-image:url({{{image}}});">
                    <div class="carousel-caption d-md-block">
                        <h1>{{title}}</h1>
                        <p>{{subtitle}}</p>
                    </div>
                </div>
            </div>
        {{/slides}}
    </div>

    <!-- Pause/resume button. -->
        <div id="carousel-play-resume-buttons" class="{{carouselhidecontrols}}">
            <button id="play-button" role="button" class="btn btn-default btn-xs" aria-label="{{carouselplaybutton}}">
                <span class="icon fa fa-play fa-fw"></span>
            </button>
            <button id="pause-button" role="button" class="btn btn-default btn-xs" aria-label="{{carouselpausebutton}}">
                <span class="icon fa fa-pause fa-fw"></span>
            </button>
        </div>

    <div class="carousel-indicators js-only">
        {{#slides}}
            <button data-target="#snap-site-carousel" data-slide-to="{{index}}" class="{{active}}" aria-label="slide-{{index}}"></button>
        {{/slides}}
    </div>
</section>
