Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
52 lines (51 sloc) 2.4 KB
@inherits BootstrapComponentBase
<Carousel BackgroundColor="NamedColor.Secondary" ShowIndicators="@(this.Items.Count > 0)" AutoStart="true" Interval="5000" PaddingBottom="Spacing.Two" Width="ComponentSize.p100">
@if(this.Items.Count > 0)
{
bool isActive = true;
@foreach(var item in this.Items)
{
<CarouselItem class="@(isActive ? "active": "")" Width="ComponentSize.p100">
<Card Title="@item.Title" Subtitle="@item.Category" ImageUrl="@item.ImageUrl" Text="@item.Description" MarginBottom="Spacing.Five" Width="ComponentSize.p100">
<ImageTemplate>
<Div style="@($"height: 240px; background-position: center; background-size: cover; background-image: url({item.ImageUrl})")">&nbsp;</Div>
</ImageTemplate>
<TitleTemplate>
<CardTitle>
@if (item.Published.HasValue)
{
<Div MarginBottom="Spacing.One" TextColor="NamedColor.Black50">
<small>@item.Published.Value.ToString("d")</small>
</Div>
}
@context
</CardTitle>
</TitleTemplate>
<TextTemplate>
<CardText>
@foreach (var tag in item.Tags)
{
<Badge IsPill="true" Color="NamedColor.Info">@tag</Badge>
}
<Paragraph>
@context
</Paragraph>
<Div MarginTop="Spacing.Three" class="text-right">
<Anchor Url="@item.Url" IsStretched="true" OpenInNewTab="true" class="btn btn-outline-primary">Read more</Anchor>
</Div>
</CardText>
</TextTemplate>
</Card>
</CarouselItem>
isActive = false;
}
}
else
{
<CarouselItem CaptionHeading="Loading..." Width="ComponentSize.p100">
<CaptionBodyTemplate>
<Spinner Type="SpinnerType.Border"></Spinner>
</CaptionBodyTemplate>
</CarouselItem>
}
</Carousel>
You can’t perform that action at this time.