63 lines
1.9 KiB
Plaintext
63 lines
1.9 KiB
Plaintext
@using Dvd.Data
|
|
@if (Series != null)
|
|
{
|
|
<div class="modal @ModalClass" tabindex="-1" style="display:@ModalDisplay">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<select @onchange="ChangeSeason">
|
|
@foreach (var s in Seasons)
|
|
{
|
|
<option value=@s>@s</option>
|
|
}
|
|
</select>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" @onclick="Close"></button>
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
@foreach (var episode in currentSeason.Episodes.Episode)
|
|
{
|
|
<EpisodeComponent Episode="@episode"></EpisodeComponent>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
@code {
|
|
[Parameter]
|
|
public DvdSeries Series { get; set; }
|
|
private List<string> Seasons { get; set; } = new();
|
|
private DvdSeason currentSeason { get; set; }
|
|
private string ModalClass = "";
|
|
private string ModalDisplay = "none";
|
|
|
|
public void Close()
|
|
{
|
|
Series = null;
|
|
}
|
|
protected override void OnParametersSet()
|
|
{
|
|
ModalClass = "";
|
|
if (Series != null)
|
|
{
|
|
currentSeason = Series.Seasons.Season[0];
|
|
Seasons.Clear();
|
|
foreach (var item in Series.Seasons.Season)
|
|
{
|
|
Seasons.Add(item.Season_name);
|
|
}
|
|
ModalClass = "Show";
|
|
ModalDisplay = "block";
|
|
StateHasChanged();
|
|
}
|
|
base.OnParametersSet();
|
|
|
|
}
|
|
private void ChangeSeason(ChangeEventArgs e)
|
|
{
|
|
currentSeason = Series.Seasons.Season.FirstOrDefault(s => s.Season_name == (string)e.Value);
|
|
}
|
|
}
|