|
|
|
@ -56,8 +56,23 @@ |
|
|
|
</MudPaper> |
|
|
|
</MudPaper> |
|
|
|
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8" Style="margin-top: 64px"> |
|
|
|
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8" Style="margin-top: 64px"> |
|
|
|
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid"> |
|
|
|
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid"> |
|
|
|
|
|
|
|
@{ var letters = new System.Collections.Generic.HashSet<char>(); } |
|
|
|
@foreach (MovieCardViewModel card in _data.Cards.Where(m => !string.IsNullOrWhiteSpace(m.Title)).OrderBy(m => m.SortTitle)) |
|
|
|
@foreach (MovieCardViewModel card in _data.Cards.Where(m => !string.IsNullOrWhiteSpace(m.Title)).OrderBy(m => m.SortTitle)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
@if (!letters.Contains(card.SortTitle.Head())) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Option<char> maybeLetter = card.SortTitle.ToLowerInvariant().HeadOrNone(); |
|
|
|
|
|
|
|
if (maybeLetter.IsSome) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
char letter = maybeLetter.ValueUnsafe(); |
|
|
|
|
|
|
|
if (letter >= '0' && letter <= '9') |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
letter = '#'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
letters.Add(letter); |
|
|
|
|
|
|
|
<div id="@($"letter-{letter}")" style="scroll-margin-top: 128px"></div> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
<MediaCard Data="@card" |
|
|
|
<MediaCard Data="@card" |
|
|
|
Link="@($"/media/movies/{card.MovieId}")" |
|
|
|
Link="@($"/media/movies/{card.MovieId}")" |
|
|
|
AddToCollectionClicked="@AddToCollection" |
|
|
|
AddToCollectionClicked="@AddToCollection" |
|
|
|
@ -131,10 +146,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
private void SelectClicked(MediaCardViewModel card, MouseEventArgs e) |
|
|
|
private void SelectClicked(MediaCardViewModel card, MouseEventArgs e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
List<MediaCardViewModel> GetSortedItems() |
|
|
|
List<MediaCardViewModel> GetSortedItems() => _data.Cards.OrderBy(m => m.SortTitle).ToList<MediaCardViewModel>(); |
|
|
|
{ |
|
|
|
|
|
|
|
return _data.Cards.OrderBy(m => m.SortTitle).ToList<MediaCardViewModel>(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SelectClicked(GetSortedItems, card, e); |
|
|
|
SelectClicked(GetSortedItems, card, e); |
|
|
|
} |
|
|
|
} |
|
|
|
|