@{
    ViewData["Title"] = "Home Page";
}

<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000">
    <ol class="carousel-indicators">
        @{
            int i=0;
            
            foreach (var act in Model) { 
                if (i==0) {
        <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                } else {
        <li data-target="#myCarousel" data-slide-to="@i"></li>
                }
                i++;
            }
        }
    </ol>
    <div class="carousel-inner" role="listbox"> 
        @{
            i=0;
            foreach (var act in Model) { 
                string cls = (i==0) ? "item active":"item";
        <div class="@cls">
            <img src="@act.Photo" alt="@act.Name" class="img-responsive" />
            <div class="carousel-caption">
                
                <p><em>@act.Name</em><br/>
                @act.Description </p>
                <p>
                @foreach (var form in act.Forms) {
                    <a class="btn btn-default" asp-controller="FrontOffice" asp-action="@form.Action" asp-route-id="@act.Code">
                    @form.Title
                    </a>
                }
                </p>
            </div>
        </div>
            i++; }
        }
    </div>
    <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
        <span class="sr-only">Précédent</span>
    </a>
    <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
        <span class="sr-only">Suivant</span>
    </a>
</div>
