more mobile layout updates (#2141)
* update trash layout * cleanup block and yaml playout editors * spacing cleanup * rework multi-collection editor * rework deco template editor * rework template editor
This commit is contained in:
@@ -6,84 +6,80 @@
|
||||
@inject ISnackbar Snackbar
|
||||
@inject IMediator Mediator
|
||||
@inject IEntityLocker EntityLocker;
|
||||
@inject ILogger<BlockPlayoutEditor> Logger
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8">
|
||||
<MudText Typo="Typo.h4" Class="mb-4">Edit Block Playout - @_channelName</MudText>
|
||||
<MudGrid Class="mt-4">
|
||||
<MudCard Class="mr-6 mb-6" Style="width: 400px">
|
||||
<MudCardHeader>
|
||||
<CardHeaderContent>
|
||||
<MudText Typo="Typo.h5">Playout Templates</MudText>
|
||||
</CardHeaderContent>
|
||||
</MudCardHeader>
|
||||
<MudCardContent>
|
||||
<MudButton Disabled="@EntityLocker.IsPlayoutLocked(Id)" Variant="Variant.Filled" Color="Color.Primary" Href="@($"playouts/{Id}/templates")" Class="mt-4">
|
||||
<MudForm Style="max-height: 100%">
|
||||
<MudPaper Square="true" Style="display: flex; height: 64px; min-height: 64px; width: 100%; z-index: 100; align-items: center">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="ml-8" OnClick="@(_ => SaveDefaultDeco())" StartIcon="@Icons.Material.Filled.Save">
|
||||
Save Default Deco
|
||||
</MudButton>
|
||||
</MudPaper>
|
||||
<div class="d-flex flex-column" style="height: 100vh; overflow-x: auto">
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8">
|
||||
<MudText Typo="Typo.h5" Class="mb-2">@_channelName - Block Playout</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Playout Templates</MudText>
|
||||
</div>
|
||||
<MudButton Disabled="@EntityLocker.IsPlayoutLocked(Id)" Variant="Variant.Filled" Color="Color.Primary" Href="@($"playouts/{Id}/templates")" StartIcon="@Icons.Material.Filled.Edit">
|
||||
Edit Templates
|
||||
</MudButton>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
<MudCard Class="mr-6 mb-6" Style="width: 400px">
|
||||
<MudCardHeader>
|
||||
<CardHeaderContent>
|
||||
<MudText Typo="Typo.h5">Playout Items and History</MudText>
|
||||
</CardHeaderContent>
|
||||
</MudCardHeader>
|
||||
<MudCardContent>
|
||||
<div>
|
||||
<MudButton Disabled="@EntityLocker.IsPlayoutLocked(Id)" Variant="Variant.Filled" Color="Color.Warning" OnClick="@(_ => EraseItems(eraseHistory: false))" Class="mt-4">
|
||||
Erase Items
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">Default Deco</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Enable Default Deco</MudText>
|
||||
</div>
|
||||
<div>
|
||||
<MudButton Disabled="@EntityLocker.IsPlayoutLocked(Id)" Variant="Variant.Filled" Color="Color.Error" OnClick="@(_ => EraseItems(eraseHistory: true))" Class="mt-4">
|
||||
Erase Items and History
|
||||
</MudButton>
|
||||
<MudCheckBox @bind-Value="_enableDefaultDeco" Color="Color.Primary" Dense="true"/>
|
||||
</MudStack>
|
||||
@if (_enableDefaultDeco)
|
||||
{
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Deco Group</MudText>
|
||||
</div>
|
||||
<MudSelect T="DecoGroupViewModel"
|
||||
Value="@_selectedDefaultDecoGroup"
|
||||
ValueChanged="@(vm => UpdateDefaultDecoTemplateGroupItems(vm))">
|
||||
@foreach (DecoGroupViewModel decoGroup in _decoGroups)
|
||||
{
|
||||
<MudSelectItem Value="@decoGroup">@decoGroup.Name</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Deco</MudText>
|
||||
</div>
|
||||
<MudSelect @bind-Value="_defaultDeco" For="@(() => _defaultDeco)">
|
||||
@foreach (DecoViewModel deco in _decos)
|
||||
{
|
||||
<MudSelectItem Value="@deco">@deco.Name</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudStack>
|
||||
}
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">Maintenance</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Playout Items and History</MudText>
|
||||
</div>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
<MudCard Class="mr-6 mb-6" Style="width: 400px">
|
||||
<MudCardHeader>
|
||||
<CardHeaderContent>
|
||||
<MudText Typo="Typo.h5">Default Deco</MudText>
|
||||
</CardHeaderContent>
|
||||
</MudCardHeader>
|
||||
<MudCardContent>
|
||||
<MudElement HtmlTag="div" Class="mt-3">
|
||||
<MudSwitch T="bool" Label="Enable Default Deco" @bind-Value="_enableDefaultDeco" Color="Color.Primary"/>
|
||||
</MudElement>
|
||||
@if (_enableDefaultDeco)
|
||||
{
|
||||
<MudElement HtmlTag="div" Class="mt-2">
|
||||
<MudSelect T="DecoGroupViewModel"
|
||||
Label="Deco Group"
|
||||
Value="@_selectedDefaultDecoGroup"
|
||||
ValueChanged="@(vm => UpdateDefaultDecoTemplateGroupItems(vm))">
|
||||
@foreach (DecoGroupViewModel decoGroup in _decoGroups)
|
||||
{
|
||||
<MudSelectItem Value="@decoGroup">@decoGroup.Name</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudElement>
|
||||
<MudElement HtmlTag="div" Class="mt-2">
|
||||
<MudSelect Label="Deco"
|
||||
@bind-Value="_defaultDeco"
|
||||
For="@(() => _defaultDeco)">
|
||||
@foreach (DecoViewModel deco in _decos)
|
||||
{
|
||||
<MudSelectItem Value="@deco">@deco.Name</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudElement>
|
||||
}
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(_ => SaveDefaultDeco())">
|
||||
Save Changes
|
||||
<MudButton Disabled="@EntityLocker.IsPlayoutLocked(Id)" Variant="Variant.Filled" Color="Color.Warning" OnClick="@(_ => EraseItems(eraseHistory: false))" StartIcon="@Icons.Material.Filled.Delete">
|
||||
Erase Items
|
||||
</MudButton>
|
||||
</MudCardActions>
|
||||
</MudCard>
|
||||
</MudGrid>
|
||||
</MudContainer>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex"></div>
|
||||
<MudButton Disabled="@EntityLocker.IsPlayoutLocked(Id)" Variant="Variant.Filled" Color="Color.Error" OnClick="@(_ => EraseItems(eraseHistory: true))" StartIcon="@Icons.Material.Filled.Delete">
|
||||
Erase Items and History
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
</MudContainer>
|
||||
</div>
|
||||
</MudForm>
|
||||
|
||||
@code {
|
||||
private readonly CancellationTokenSource _cts = new();
|
||||
@@ -152,7 +148,17 @@
|
||||
private async Task SaveDefaultDeco()
|
||||
{
|
||||
int? decoId = _enableDefaultDeco ? _defaultDeco?.Id : null;
|
||||
await Mediator.Send(new UpdateDefaultDeco(Id, decoId), _cts.Token);
|
||||
Option<BaseError> result = await Mediator.Send(new UpdateDefaultDeco(Id, decoId), _cts.Token);
|
||||
result.Match(
|
||||
error =>
|
||||
{
|
||||
Snackbar.Add($"Unexpected error saving default deco: {error.Value}", Severity.Error);
|
||||
Logger.LogError("Unexpected error saving default deco: {Error}", error.Value);
|
||||
},
|
||||
() =>
|
||||
{
|
||||
Snackbar.Add($"Saved default deco for playout {_channelName}", Severity.Success);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -116,7 +116,7 @@
|
||||
</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" UserAttributes="@(new Dictionary<string, object> { { "id", "sortable-collection" } })">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" UserAttributes="@(new Dictionary<string, object> { { "id", "sortable-collection" } })" Class="mb-10">
|
||||
@foreach (MovieCardViewModel card in OrderMovies(_data.MovieCards))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -140,7 +140,7 @@
|
||||
</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (TelevisionShowCardViewModel card in _data.ShowCards.OrderBy(m => m.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -164,7 +164,7 @@
|
||||
</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (TelevisionSeasonCardViewModel card in _data.SeasonCards.OrderBy(m => m.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -190,7 +190,7 @@
|
||||
</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (TelevisionEpisodeCardViewModel card in _data.EpisodeCards.OrderBy(e => e.Aired))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -215,7 +215,7 @@
|
||||
</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (ArtistCardViewModel card in _data.ArtistCards.OrderBy(e => e.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -240,7 +240,7 @@
|
||||
</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (MusicVideoCardViewModel card in _data.MusicVideoCards.OrderBy(e => e.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -265,7 +265,7 @@
|
||||
</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (OtherVideoCardViewModel card in _data.OtherVideoCards.OrderBy(e => e.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -290,7 +290,7 @@
|
||||
</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (SongCardViewModel card in _data.SongCards.OrderBy(e => e.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -315,7 +315,7 @@
|
||||
</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (ImageCardViewModel card in _data.ImageCards.OrderBy(e => e.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
|
||||
@@ -7,112 +7,115 @@
|
||||
@inject ISnackbar Snackbar
|
||||
@inject IMediator Mediator
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8">
|
||||
<MudText Typo="Typo.h4" Class="mb-4">Edit Deco Template</MudText>
|
||||
<MudGrid>
|
||||
<MudItem xs="4">
|
||||
<div style="max-width: 400px">
|
||||
<MudCard>
|
||||
<MudCardContent>
|
||||
<MudTextField Label="Name" @bind-Value="_decoTemplate.Name" For="@(() => _decoTemplate.Name)"/>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
</div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(_ => SaveChanges())" Class="mt-4">
|
||||
Save Changes
|
||||
</MudButton>
|
||||
</MudItem>
|
||||
<MudItem xs="4">
|
||||
<div style="max-width: 400px">
|
||||
<MudCard>
|
||||
<MudCardContent>
|
||||
<MudSelect T="DecoGroupViewModel"
|
||||
Label="Deco Group"
|
||||
ValueChanged="@(vm => UpdateDecoGroupItems(vm))">
|
||||
@foreach (DecoGroupViewModel decoGroup in _decoGroups)
|
||||
{
|
||||
<MudSelectItem Value="@decoGroup">@decoGroup.Name</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<MudSelect Class="mt-3"
|
||||
T="DecoViewModel"
|
||||
Label="Deco"
|
||||
@bind-value="_selectedDeco">
|
||||
@foreach (DecoViewModel deco in _decos)
|
||||
{
|
||||
<MudSelectItem Value="@deco">@deco.Name</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<MudSelect Class="mt-3"
|
||||
T="DateTime"
|
||||
Label="Start Time On Or After"
|
||||
@bind-value="_selectedDecoStart">
|
||||
@foreach (DateTime startTime in _startTimes)
|
||||
{
|
||||
<MudSelectItem Value="@startTime">
|
||||
@startTime.ToString(CultureInfo.CurrentUICulture.DateTimeFormat.ShortTimePattern)
|
||||
</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<MudGrid Class="mt-3" Style="align-items: center" Justify="Justify.Center">
|
||||
<MudItem xs="6">
|
||||
<MudTextField T="int"
|
||||
Label="Duration"
|
||||
@bind-Value="_durationHours"
|
||||
Adornment="Adornment.End"
|
||||
AdornmentText="hours"/>
|
||||
</MudItem>
|
||||
<MudItem xs="6">
|
||||
<MudSelect T="int" @bind-Value="_durationMinutes" Adornment="Adornment.End" AdornmentText="minutes">
|
||||
<MudSelectItem Value="0"/>
|
||||
<MudSelectItem Value="5"/>
|
||||
<MudSelectItem Value="10"/>
|
||||
<MudSelectItem Value="15"/>
|
||||
<MudSelectItem Value="20"/>
|
||||
<MudSelectItem Value="25"/>
|
||||
<MudSelectItem Value="30"/>
|
||||
<MudSelectItem Value="35"/>
|
||||
<MudSelectItem Value="40"/>
|
||||
<MudSelectItem Value="45"/>
|
||||
<MudSelectItem Value="50"/>
|
||||
<MudSelectItem Value="55"/>
|
||||
</MudSelect>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(_ => AddDecoToDecoTemplate())" Disabled="@(_selectedDeco is null)">
|
||||
Add Deco To Deco Template
|
||||
</MudButton>
|
||||
</MudCardActions>
|
||||
</MudCard>
|
||||
</div>
|
||||
</MudItem>
|
||||
<MudItem xs="4">
|
||||
<div style="max-width: 400px">
|
||||
<MudCard>
|
||||
<MudCardContent>
|
||||
<MudSelect T="DecoTemplateItemEditViewModel"
|
||||
Label="Deco To Remove"
|
||||
@bind-Value="_decoToRemove">
|
||||
<MudSelectItem Value="@((DecoTemplateItemEditViewModel)null)">(none)</MudSelectItem>
|
||||
@foreach (DecoTemplateItemEditViewModel item in _decoTemplate.Items.OrderBy(i => i.Start))
|
||||
{
|
||||
<MudSelectItem Value="@item">@item.Start.ToShortTimeString() - @item.Text</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(_ => RemoveDecoFromDecoTemplate())" Disabled="@(_decoToRemove is null)">
|
||||
Remove Deco From Deco Template
|
||||
</MudButton>
|
||||
</MudCardActions>
|
||||
</MudCard>
|
||||
</div>
|
||||
</MudItem>
|
||||
<MudItem xs="8">
|
||||
<MudForm Style="max-height: 100%">
|
||||
<MudPaper Square="true" Style="display: flex; height: 64px; min-height: 64px; width: 100%; z-index: 100; align-items: center">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="ml-8" OnClick="@(_ => SaveChanges())" StartIcon="@Icons.Material.Filled.Save">
|
||||
Save Deco Template
|
||||
</MudButton>
|
||||
</MudPaper>
|
||||
<div class="d-flex flex-column" style="height: 100vh; overflow-x: auto">
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8">
|
||||
<MudText Typo="Typo.h5" Class="mb-2">General</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Name</MudText>
|
||||
</div>
|
||||
<MudTextField @bind-Value="_decoTemplate.Name" For="@(() => _decoTemplate.Name)"/>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">Add Content</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Deco Group</MudText>
|
||||
</div>
|
||||
<MudSelect T="DecoGroupViewModel" ValueChanged="@(vm => UpdateDecoGroupItems(vm))">
|
||||
@foreach (DecoGroupViewModel decoGroup in _decoGroups)
|
||||
{
|
||||
<MudSelectItem Value="@decoGroup">@decoGroup.Name</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Deco</MudText>
|
||||
</div>
|
||||
<MudSelect T="DecoViewModel" @bind-value="_selectedDeco">
|
||||
@foreach (DecoViewModel deco in _decos)
|
||||
{
|
||||
<MudSelectItem Value="@deco">@deco.Name</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Start Time On Or After</MudText>
|
||||
</div>
|
||||
<MudSelect T="DateTime" @bind-value="_selectedDecoStart">
|
||||
@foreach (DateTime startTime in _startTimes)
|
||||
{
|
||||
<MudSelectItem Value="@startTime">
|
||||
@startTime.ToString(CultureInfo.CurrentUICulture.DateTimeFormat.ShortTimePattern)
|
||||
</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Duration</MudText>
|
||||
</div>
|
||||
<MudTextField T="int"
|
||||
@bind-Value="_durationHours"
|
||||
Adornment="Adornment.End"
|
||||
AdornmentText="hours"/>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex"></div>
|
||||
<MudSelect T="int" @bind-Value="_durationMinutes" Adornment="Adornment.End" AdornmentText="minutes">
|
||||
<MudSelectItem Value="0"/>
|
||||
<MudSelectItem Value="5"/>
|
||||
<MudSelectItem Value="10"/>
|
||||
<MudSelectItem Value="15"/>
|
||||
<MudSelectItem Value="20"/>
|
||||
<MudSelectItem Value="25"/>
|
||||
<MudSelectItem Value="30"/>
|
||||
<MudSelectItem Value="35"/>
|
||||
<MudSelectItem Value="40"/>
|
||||
<MudSelectItem Value="45"/>
|
||||
<MudSelectItem Value="50"/>
|
||||
<MudSelectItem Value="55"/>
|
||||
</MudSelect>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex"></div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(_ => AddDecoToDecoTemplate())" Disabled="@(_selectedDeco is null)" StartIcon="@Icons.Material.Filled.Add">
|
||||
Add Deco To Template
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">Remove Content</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Deco To Remove</MudText>
|
||||
</div>
|
||||
<MudSelect T="DecoTemplateItemEditViewModel" @bind-Value="_decoToRemove">
|
||||
<MudSelectItem Value="@((DecoTemplateItemEditViewModel)null)">(none)</MudSelectItem>
|
||||
@foreach (DecoTemplateItemEditViewModel item in _decoTemplate.Items.OrderBy(i => i.Start))
|
||||
{
|
||||
<MudSelectItem Value="@item">@item.Start.ToShortTimeString() - @item.Text</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex"></div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(_ => RemoveDecoFromDecoTemplate())" Disabled="@(_decoToRemove is null)" StartIcon="@Icons.Material.Filled.Remove">
|
||||
Remove Deco From Template
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">Content</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudCalendar T="CalendarItem"
|
||||
Class="mt-4"
|
||||
Class="mb-6"
|
||||
Items="@_decoTemplate.Items"
|
||||
ShowMonth="false"
|
||||
ShowWeek="false"
|
||||
@@ -124,9 +127,9 @@
|
||||
EnableDragItems="true"
|
||||
EnableResizeItems="false"
|
||||
ItemChanged="@(ci => CalendarItemChanged(ci))"/>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudContainer>
|
||||
</MudContainer>
|
||||
</div>
|
||||
</MudForm>
|
||||
|
||||
@code {
|
||||
private readonly CancellationTokenSource _cts = new();
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
</MudTd>
|
||||
</RowTemplate>
|
||||
</MudTable>
|
||||
<MudText Typo="Typo.h5" Class="mb-2">External Collections</MudText>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">External Collections</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
@if (_externalCollections.Any())
|
||||
{
|
||||
|
||||
@@ -7,103 +7,108 @@
|
||||
@inject ISnackbar Snackbar
|
||||
@inject ILogger<MultiCollectionEditor> Logger
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8">
|
||||
<div style="max-width: 400px;">
|
||||
<MudText Typo="Typo.h4" Class="mb-4">@(IsEdit ? "Edit Multi Collection" : "Add Multi Collection")</MudText>
|
||||
|
||||
@if (_editContext is not null)
|
||||
{
|
||||
<EditForm EditContext="_editContext" OnSubmit="@HandleSubmitAsync">
|
||||
<FluentValidationValidator/>
|
||||
<MudCard>
|
||||
<MudCardContent>
|
||||
<MudTextField Class="mt-3" Label="Name" @bind-Value="_model.Name" For="@(() => _model.Name)"/>
|
||||
<MudSelect @ref="_collectionSelect"
|
||||
Class="mt-4"
|
||||
T="MediaCollectionViewModel"
|
||||
Label="Collection"
|
||||
@bind-value="_selectedCollection"
|
||||
HelperText="Disabled collections are already present in this multi collection">
|
||||
@foreach (MediaCollectionViewModel collection in _collections)
|
||||
{
|
||||
<MudSelectItem Disabled="@(_model.Items.Any(i => i.Collection.CollectionType == collection.CollectionType && i.Collection.Id == collection.Id))"
|
||||
Value="@collection">
|
||||
@collection.Name
|
||||
</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" OnClick="@(_ => AddCollection())" Class="mt-4 mr-auto">
|
||||
Add Collection
|
||||
</MudButton>
|
||||
<MudSelect @ref="_smartCollectionSelect"
|
||||
Class="mt-4"
|
||||
T="SmartCollectionViewModel"
|
||||
Label="Smart Collection"
|
||||
@bind-value="_selectedSmartCollection"
|
||||
HelperText="Disabled collections are already present in this multi collection">
|
||||
@foreach (SmartCollectionViewModel collection in _smartCollections)
|
||||
{
|
||||
<MudSelectItem Disabled="@(_model.Items.Any(i => i.Collection.CollectionType == ProgramScheduleItemCollectionType.SmartCollection && i.Collection.Id == collection.Id))"
|
||||
Value="@collection">
|
||||
@collection.Name
|
||||
</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" OnClick="@(_ => AddSmartCollection())" Class="mt-4 mr-auto">
|
||||
Add Smart Collection
|
||||
</MudButton>
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Primary" Class="mr-2 ml-auto">
|
||||
@(IsEdit ? "Save Changes" : "Add Multi Collection")
|
||||
</MudButton>
|
||||
</MudCardActions>
|
||||
</MudCard>
|
||||
</EditForm>
|
||||
}
|
||||
<MudForm @ref="_form" @bind-IsValid="@_success" Style="max-height: 100%">
|
||||
<MudPaper Square="true" Style="display: flex; height: 64px; min-height: 64px; width: 100%; z-index: 100; align-items: center">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(_ => HandleSubmitAsync())" Class="ml-8" StartIcon="@Icons.Material.Filled.Save">
|
||||
@(IsEdit ? "Save Multi Collection" : "Add Multi Collection")
|
||||
</MudButton>
|
||||
</MudPaper>
|
||||
<div class="d-flex flex-column" style="height: 100vh; overflow-x: auto">
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8">
|
||||
<MudText Typo="Typo.h5" Class="mb-2">Multi Collection</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Name</MudText>
|
||||
</div>
|
||||
<MudTextField @bind-Value="_model.Name" For="@(() => _model.Name)" Required="true" RequiredError="Multi-collection name is required!"/>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Collections</MudText>
|
||||
</div>
|
||||
<MudSelect @ref="_collectionSelect"
|
||||
T="MediaCollectionViewModel"
|
||||
@bind-value="_selectedCollection"
|
||||
HelperText="Disabled collections are already present in this multi collection">
|
||||
@foreach (MediaCollectionViewModel collection in _collections)
|
||||
{
|
||||
<MudSelectItem Disabled="@(_model.Items.Any(i => i.Collection.CollectionType == collection.CollectionType && i.Collection.Id == collection.Id))"
|
||||
Value="@collection">
|
||||
@collection.Name
|
||||
</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex"></div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" OnClick="@(_ => AddCollection())" StartIcon="@Icons.Material.Filled.Add">
|
||||
Add Collection
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Smart Collections</MudText>
|
||||
</div>
|
||||
<MudSelect @ref="_smartCollectionSelect"
|
||||
T="SmartCollectionViewModel"
|
||||
@bind-value="_selectedSmartCollection"
|
||||
HelperText="Disabled collections are already present in this multi collection">
|
||||
@foreach (SmartCollectionViewModel collection in _smartCollections)
|
||||
{
|
||||
<MudSelectItem Disabled="@(_model.Items.Any(i => i.Collection.CollectionType == ProgramScheduleItemCollectionType.SmartCollection && i.Collection.Id == collection.Id))"
|
||||
Value="@collection">
|
||||
@collection.Name
|
||||
</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex"></div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Secondary" OnClick="@(_ => AddSmartCollection())" StartIcon="@Icons.Material.Filled.Add">
|
||||
Add Smart Collection
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">@_model.Name Items</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudTable Hover="true" Items="_model.Items.OrderBy(i => i.Collection.Name, StringComparer.CurrentCultureIgnoreCase)" Dense="true">
|
||||
<ColGroup>
|
||||
<MudHidden Breakpoint="Breakpoint.Xs">
|
||||
<col/>
|
||||
<col style="width: 20%"/>
|
||||
<col style="width: 30%"/>
|
||||
<col style="width: 60px;"/>
|
||||
</MudHidden>
|
||||
</ColGroup>
|
||||
<HeaderContent>
|
||||
<MudTh>Collection</MudTh>
|
||||
<MudTh>Schedule As Group</MudTh>
|
||||
<MudTh>Playback Order</MudTh>
|
||||
<MudTh/>
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd>
|
||||
@context.Collection.Name
|
||||
</MudTd>
|
||||
<MudTd>
|
||||
<MudCheckBox @bind-Value="@context.ScheduleAsGroup" For="@(() => context.ScheduleAsGroup)"/>
|
||||
</MudTd>
|
||||
<MudTd>
|
||||
@if (context.ScheduleAsGroup)
|
||||
{
|
||||
@(context.Collection.UseCustomPlaybackOrder ? "Custom" : "Chronological")
|
||||
}
|
||||
</MudTd>
|
||||
<MudTd>
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
||||
OnClick="@(_ => RemoveCollection(context))">
|
||||
</MudIconButton>
|
||||
</MudTd>
|
||||
</RowTemplate>
|
||||
</MudTable>
|
||||
</MudContainer>
|
||||
</div>
|
||||
|
||||
<MudTable Hover="true" Items="_model.Items.OrderBy(i => i.Collection.Name, StringComparer.CurrentCultureIgnoreCase)" Dense="true" Class="mt-6">
|
||||
<ToolBarContent>
|
||||
<MudText Typo="Typo.h6">@_model.Name Items</MudText>
|
||||
</ToolBarContent>
|
||||
<ColGroup>
|
||||
<col/>
|
||||
<col style="width: 20%"/>
|
||||
<col style="width: 30%"/>
|
||||
<col style="width: 60px;"/>
|
||||
</ColGroup>
|
||||
<HeaderContent>
|
||||
<MudTh>Collection</MudTh>
|
||||
<MudTh>Schedule As Group</MudTh>
|
||||
<MudTh>Playback Order</MudTh>
|
||||
<MudTh/>
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd DataLabel="Collection">
|
||||
<MudText Typo="Typo.body2">
|
||||
@context.Collection.Name
|
||||
</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Schedule As Group">
|
||||
<MudCheckBox @bind-Value="@context.ScheduleAsGroup" For="@(() => context.ScheduleAsGroup)"/>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Playback Order">
|
||||
@if (context.ScheduleAsGroup)
|
||||
{
|
||||
<MudText Typo="Typo.body2">
|
||||
@(context.Collection.UseCustomPlaybackOrder ? "Custom" : "Chronological")
|
||||
</MudText>
|
||||
}
|
||||
</MudTd>
|
||||
<MudTd>
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
||||
OnClick="@(_ => RemoveCollection(context))">
|
||||
</MudIconButton>
|
||||
</MudTd>
|
||||
</RowTemplate>
|
||||
</MudTable>
|
||||
</MudContainer>
|
||||
</MudForm>
|
||||
|
||||
@code {
|
||||
private readonly CancellationTokenSource _cts = new();
|
||||
@@ -114,8 +119,8 @@
|
||||
private readonly MultiCollectionEditViewModel _model =
|
||||
new() { Items = new List<MultiCollectionItemEditViewModel>() };
|
||||
|
||||
private EditContext _editContext;
|
||||
private ValidationMessageStore _messageStore;
|
||||
private MudForm _form;
|
||||
private bool _success;
|
||||
private List<MediaCollectionViewModel> _collections = new();
|
||||
private List<SmartCollectionViewModel> _smartCollections = new();
|
||||
private MediaCollectionViewModel _selectedCollection;
|
||||
@@ -169,18 +174,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
_editContext = new EditContext(_model);
|
||||
_messageStore = new ValidationMessageStore(_editContext);
|
||||
}
|
||||
|
||||
private bool IsEdit => Id != 0;
|
||||
|
||||
private async Task HandleSubmitAsync()
|
||||
{
|
||||
_messageStore.Clear();
|
||||
if (_editContext.Validate())
|
||||
await _form.Validate();
|
||||
if (_success)
|
||||
{
|
||||
Seq<BaseError> errorMessage = IsEdit ? (await Mediator.Send(new UpdateMultiCollection(Id, _model.Name, GetUpdateItems()), _cts.Token)).LeftToSeq() : (await Mediator.Send(new CreateMultiCollection(_model.Name, GetCreateItems()), _cts.Token)).LeftToSeq();
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (MovieCardViewModel card in _movies.Cards.OrderBy(m => m.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -176,7 +176,7 @@
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (TelevisionShowCardViewModel card in _shows.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -202,7 +202,7 @@
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (TelevisionSeasonCardViewModel card in _seasons.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -228,7 +228,7 @@
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (TelevisionEpisodeCardViewModel card in _episodes.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -255,7 +255,7 @@
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (ArtistCardViewModel card in _artists.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -282,7 +282,7 @@
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (MusicVideoCardViewModel card in _musicVideos.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -309,7 +309,7 @@
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (OtherVideoCardViewModel card in _otherVideos.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -336,7 +336,7 @@
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (SongCardViewModel card in _songs.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
@@ -363,7 +363,7 @@
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap">
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (ImageCardViewModel card in _images.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
|
||||
@@ -7,87 +7,89 @@
|
||||
@inject ISnackbar Snackbar
|
||||
@inject IMediator Mediator
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8">
|
||||
<MudText Typo="Typo.h4" Class="mb-4">Edit Template</MudText>
|
||||
<MudGrid>
|
||||
<MudItem xs="4">
|
||||
<div style="max-width: 400px">
|
||||
<MudCard>
|
||||
<MudCardContent>
|
||||
<MudTextField Label="Name" @bind-Value="_template.Name" For="@(() => _template.Name)"/>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
</div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(_ => SaveChanges())" Class="mt-4">
|
||||
Save Changes
|
||||
</MudButton>
|
||||
</MudItem>
|
||||
<MudItem xs="4">
|
||||
<div style="max-width: 400px">
|
||||
<MudCard>
|
||||
<MudCardContent>
|
||||
<MudSelect T="BlockGroupViewModel"
|
||||
Label="Block Group"
|
||||
ValueChanged="@(vm => UpdateBlockGroupItems(vm))">
|
||||
@foreach (BlockGroupViewModel blockGroup in _blockGroups)
|
||||
{
|
||||
<MudSelectItem Value="@blockGroup">@blockGroup.Name</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<MudSelect Class="mt-3"
|
||||
T="BlockViewModel"
|
||||
Label="Block"
|
||||
@bind-value="_selectedBlock">
|
||||
@foreach (BlockViewModel block in _blocks)
|
||||
{
|
||||
<MudSelectItem Value="@block">@block.Name</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<MudSelect Class="mt-3"
|
||||
T="DateTime"
|
||||
Label="Start Time On Or After"
|
||||
@bind-value="_selectedBlockStart">
|
||||
@foreach (DateTime startTime in _startTimes)
|
||||
{
|
||||
<MudSelectItem Value="@startTime">
|
||||
@startTime.ToString(CultureInfo.CurrentUICulture.DateTimeFormat.ShortTimePattern)
|
||||
</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(_ => AddBlockToTemplate())" Disabled="@(_selectedBlock is null)">
|
||||
Add Block To Template
|
||||
</MudButton>
|
||||
</MudCardActions>
|
||||
</MudCard>
|
||||
</div>
|
||||
</MudItem>
|
||||
<MudItem xs="4">
|
||||
<div style="max-width: 400px">
|
||||
<MudCard>
|
||||
<MudCardContent>
|
||||
<MudSelect T="TemplateItemEditViewModel"
|
||||
Label="Block To Remove"
|
||||
@bind-Value="_blockToRemove">
|
||||
<MudSelectItem Value="@((TemplateItemEditViewModel)null)">(none)</MudSelectItem>
|
||||
@foreach (TemplateItemEditViewModel item in _template.Items.OrderBy(i => i.Start))
|
||||
{
|
||||
<MudSelectItem Value="@item">@item.Start.ToShortTimeString() - @item.Text</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudCardContent>
|
||||
<MudCardActions>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(_ => RemoveBlockFromTemplate())" Disabled="@(_blockToRemove is null)">
|
||||
Remove Block From Template
|
||||
</MudButton>
|
||||
</MudCardActions>
|
||||
</MudCard>
|
||||
</div>
|
||||
</MudItem>
|
||||
<MudItem xs="8">
|
||||
<MudForm Style="max-height: 100%">
|
||||
<MudPaper Square="true" Style="display: flex; height: 64px; min-height: 64px; width: 100%; z-index: 100; align-items: center">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="ml-8" OnClick="@(_ => SaveChanges())" StartIcon="@Icons.Material.Filled.Save">
|
||||
Save Template
|
||||
</MudButton>
|
||||
</MudPaper>
|
||||
<div class="d-flex flex-column" style="height: 100vh; overflow-x: auto">
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8">
|
||||
<MudText Typo="Typo.h5" Class="mb-2">General</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Name</MudText>
|
||||
</div>
|
||||
<MudTextField @bind-Value="_template.Name" For="@(() => _template.Name)"/>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">Add Content</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Block Group</MudText>
|
||||
</div>
|
||||
<MudSelect T="BlockGroupViewModel" ValueChanged="@(vm => UpdateBlockGroupItems(vm))">
|
||||
@foreach (BlockGroupViewModel blockGroup in _blockGroups)
|
||||
{
|
||||
<MudSelectItem Value="@blockGroup">@blockGroup.Name</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Block</MudText>
|
||||
</div>
|
||||
<MudSelect T="BlockViewModel" @bind-value="_selectedBlock">
|
||||
@foreach (BlockViewModel block in _blocks)
|
||||
{
|
||||
<MudSelectItem Value="@block">@block.Name</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Start Time On Or After</MudText>
|
||||
</div>
|
||||
<MudSelect T="DateTime" @bind-value="_selectedBlockStart">
|
||||
@foreach (DateTime startTime in _startTimes)
|
||||
{
|
||||
<MudSelectItem Value="@startTime">
|
||||
@startTime.ToString(CultureInfo.CurrentUICulture.DateTimeFormat.ShortTimePattern)
|
||||
</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex"></div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(_ => AddBlockToTemplate())" Disabled="@(_selectedBlock is null)" StartIcon="@Icons.Material.Filled.Add">
|
||||
Add Block To Template
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">Remove Content</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Block To Remove</MudText>
|
||||
</div>
|
||||
<MudSelect T="TemplateItemEditViewModel" @bind-Value="_blockToRemove">
|
||||
<MudSelectItem Value="@((TemplateItemEditViewModel)null)">(none)</MudSelectItem>
|
||||
@foreach (TemplateItemEditViewModel item in _template.Items.OrderBy(i => i.Start))
|
||||
{
|
||||
<MudSelectItem Value="@item">@item.Start.ToShortTimeString() - @item.Text</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex"></div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="@(_ => RemoveBlockFromTemplate())" Disabled="@(_blockToRemove is null)" StartIcon="@Icons.Material.Filled.Remove">
|
||||
Remove Block From Template
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">Content</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudCalendar T="CalendarItem"
|
||||
Class="mt-4"
|
||||
Class="mb-6"
|
||||
Items="@_template.Items"
|
||||
ShowMonth="false"
|
||||
ShowWeek="false"
|
||||
@@ -99,9 +101,9 @@
|
||||
EnableDragItems="true"
|
||||
EnableResizeItems="false"
|
||||
ItemChanged="@(ci => CalendarItemChanged(ci))"/>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudContainer>
|
||||
</MudContainer>
|
||||
</div>
|
||||
</MudForm>
|
||||
|
||||
@code {
|
||||
private readonly CancellationTokenSource _cts = new();
|
||||
@@ -113,7 +115,7 @@
|
||||
public int Id { get; set; }
|
||||
|
||||
private TemplateItemsEditViewModel _template = new();
|
||||
private TemplateItemEditViewModel _blockToRemove = new();
|
||||
private TemplateItemEditViewModel _blockToRemove;
|
||||
private BlockGroupViewModel _selectedBlockGroup;
|
||||
private BlockViewModel _selectedBlock;
|
||||
private DateTime _selectedBlockStart;
|
||||
|
||||
+359
-345
@@ -7,351 +7,365 @@
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject PersistentComponentState ApplicationState
|
||||
|
||||
<MudPaper Square="true" Style="display: flex; height: 64px; width: 100%; z-index: 100;">
|
||||
<div style="display: flex; flex-direction: row; margin-bottom: auto; margin-top: auto; width: 100%" class="ml-6 mr-6">
|
||||
@if (IsSelectMode())
|
||||
{
|
||||
<MudText Typo="Typo.h6" Color="Color.Primary">@SelectionLabel()</MudText>
|
||||
<div style="margin-left: auto">
|
||||
<MudButton Variant="Variant.Filled"
|
||||
Color="Color.Error"
|
||||
StartIcon="@Icons.Material.Filled.Delete"
|
||||
OnClick="@(_ => DeleteFromDatabase())">
|
||||
Delete From Database
|
||||
</MudButton>
|
||||
<MudButton Class="ml-3"
|
||||
Variant="Variant.Filled"
|
||||
Color="Color.Secondary"
|
||||
StartIcon="@Icons.Material.Filled.Check"
|
||||
OnClick="@(_ => ClearSelection())">
|
||||
Clear Selection
|
||||
</MudButton>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_movies?.Cards.Count > 0)
|
||||
<MudForm Style="max-height: 100%">
|
||||
<MudPaper Square="true" Style="display: flex; height: 64px; min-height: 64px; width: 100%; z-index: 100;">
|
||||
<div style="display: flex; flex-direction: row; margin-bottom: auto; margin-top: auto; width: 100%; align-items: center" class="ml-6 mr-6">
|
||||
@if (IsSelectMode())
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#movies")" Style="margin-bottom: auto; margin-top: auto">@_movies.Count Movies</MudLink>
|
||||
}
|
||||
|
||||
if (_shows?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#shows")" Style="margin-bottom: auto; margin-top: auto">@_shows.Count Shows</MudLink>
|
||||
}
|
||||
|
||||
if (_seasons?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#seasons")" Style="margin-bottom: auto; margin-top: auto">@_seasons.Count Seasons</MudLink>
|
||||
}
|
||||
|
||||
if (_episodes?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#episodes")" Style="margin-bottom: auto; margin-top: auto">@_episodes.Count Episodes</MudLink>
|
||||
}
|
||||
|
||||
if (_artists?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#artists")" Style="margin-bottom: auto; margin-top: auto">@_artists.Count Artists</MudLink>
|
||||
}
|
||||
|
||||
if (_musicVideos?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#music_videos")" Style="margin-bottom: auto; margin-top: auto">@_musicVideos.Count Music Videos</MudLink>
|
||||
}
|
||||
|
||||
if (_otherVideos?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#other_videos")" Style="margin-bottom: auto; margin-top: auto">@_otherVideos.Count Other Videos</MudLink>
|
||||
}
|
||||
|
||||
if (_songs?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#songs")" Style="margin-bottom: auto; margin-top: auto">@_songs.Count Songs</MudLink>
|
||||
}
|
||||
|
||||
if (_images?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#images")" Style="margin-bottom: auto; margin-top: auto">@_images.Count Images</MudLink>
|
||||
}
|
||||
|
||||
if (IsNotEmpty)
|
||||
{
|
||||
<div style="margin-left: auto">
|
||||
<MudButton Variant="@Variant.Filled"
|
||||
Color="@Color.Error"
|
||||
StartIcon="@Icons.Material.Filled.DeleteForever"
|
||||
OnClick="@(_ => EmptyTrash())">
|
||||
Empty Trash
|
||||
<div class="flex-grow-1">
|
||||
<MudText Typo="Typo.h6" Color="Color.Primary">@SelectionLabel()</MudText>
|
||||
</div>
|
||||
<div style="margin-left: auto" class="d-none d-md-flex">
|
||||
<MudButton Variant="Variant.Filled"
|
||||
Color="Color.Error"
|
||||
StartIcon="@Icons.Material.Filled.Delete"
|
||||
OnClick="@(_ => DeleteFromDatabase())">
|
||||
Delete From Database
|
||||
</MudButton>
|
||||
<MudButton Class="ml-3"
|
||||
Variant="Variant.Filled"
|
||||
Color="Color.Secondary"
|
||||
StartIcon="@Icons.Material.Filled.Check"
|
||||
OnClick="@(_ => ClearSelection())">
|
||||
Clear Selection
|
||||
</MudButton>
|
||||
</div>
|
||||
<div style="align-items: center; display: flex; margin-left: auto;" class="d-md-none">
|
||||
<div class="flex-grow-1"></div>
|
||||
<MudMenu Icon="@Icons.Material.Filled.MoreVert">
|
||||
<MudMenuItem Icon="@Icons.Material.Filled.Delete" Label="Delete From Database" OnClick="DeleteFromDatabase"/>
|
||||
<MudMenuItem Icon="@Icons.Material.Filled.Check" Label="Clear Selection" OnClick="ClearSelection"/>
|
||||
</MudMenu>
|
||||
</div>
|
||||
}
|
||||
else if (IsNotEmpty)
|
||||
{
|
||||
<div style="align-items: center; display: flex; width: 100%" class="d-none d-md-flex">
|
||||
@if (_movies?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#movies")" Style="margin-bottom: auto; margin-top: auto">@_movies.Count Movies</MudLink>
|
||||
}
|
||||
|
||||
@if (_shows?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#shows")" Style="margin-bottom: auto; margin-top: auto">@_shows.Count Shows</MudLink>
|
||||
}
|
||||
|
||||
@if (_seasons?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#seasons")" Style="margin-bottom: auto; margin-top: auto">@_seasons.Count Seasons</MudLink>
|
||||
}
|
||||
|
||||
@if (_episodes?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#episodes")" Style="margin-bottom: auto; margin-top: auto">@_episodes.Count Episodes</MudLink>
|
||||
}
|
||||
|
||||
@if (_artists?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#artists")" Style="margin-bottom: auto; margin-top: auto">@_artists.Count Artists</MudLink>
|
||||
}
|
||||
|
||||
@if (_musicVideos?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#music_videos")" Style="margin-bottom: auto; margin-top: auto">@_musicVideos.Count Music Videos</MudLink>
|
||||
}
|
||||
|
||||
@if (_otherVideos?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#other_videos")" Style="margin-bottom: auto; margin-top: auto">@_otherVideos.Count Other Videos</MudLink>
|
||||
}
|
||||
|
||||
@if (_songs?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#songs")" Style="margin-bottom: auto; margin-top: auto">@_songs.Count Songs</MudLink>
|
||||
}
|
||||
|
||||
@if (_images?.Cards.Count > 0)
|
||||
{
|
||||
<MudLink Class="ml-4" Href="@(NavigationManager.Uri.Split("#").Head() + "#images")" Style="margin-bottom: auto; margin-top: auto">@_images.Count Images</MudLink>
|
||||
}
|
||||
<div class="flex-grow-1 d-none d-md-flex"></div>
|
||||
<div>
|
||||
<MudButton Variant="@Variant.Filled"
|
||||
Color="@Color.Error"
|
||||
StartIcon="@Icons.Material.Filled.DeleteForever"
|
||||
OnClick="@(_ => EmptyTrash())">
|
||||
Empty Trash
|
||||
</MudButton>
|
||||
</div>
|
||||
</div>
|
||||
<div style="align-items: center; display: flex; width: 100%" class="d-md-none">
|
||||
<div class="flex-grow-1"></div>
|
||||
<div>
|
||||
<MudButton Variant="@Variant.Filled"
|
||||
Color="@Color.Error"
|
||||
StartIcon="@Icons.Material.Filled.DeleteForever"
|
||||
OnClick="@(_ => EmptyTrash())">
|
||||
Empty Trash
|
||||
</MudButton>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudText>Nothing to see here...</MudText>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</MudPaper>
|
||||
<div class="d-flex flex-column" style="height: 100vh; overflow-x: auto">
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8">
|
||||
@if (_movies?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4" UserAttributes="@(new Dictionary<string, object> { { "id", "movies" } })">
|
||||
Movies
|
||||
</MudText>
|
||||
@if (_movies.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetMoviesLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (MovieCardViewModel card in _movies.Cards.OrderBy(m => m.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href="@($"media/movies/{card.MovieId}")"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudStack>
|
||||
}
|
||||
|
||||
@if (_shows?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4" UserAttributes="@(new Dictionary<string, object> { { "id", "shows" } })">
|
||||
Shows
|
||||
</MudText>
|
||||
@if (_shows.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetShowsLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (TelevisionShowCardViewModel card in _shows.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href="@($"media/tv/shows/{card.TelevisionShowId}")"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudStack>
|
||||
}
|
||||
|
||||
@if (_seasons?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4" UserAttributes="@(new Dictionary<string, object> { { "id", "seasons" } })">
|
||||
Seasons
|
||||
</MudText>
|
||||
@if (_seasons.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetSeasonsLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (TelevisionSeasonCardViewModel card in _seasons.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href="@($"media/tv/seasons/{card.TelevisionSeasonId}")"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudStack>
|
||||
}
|
||||
|
||||
@if (_episodes?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4" UserAttributes="@(new Dictionary<string, object> { { "id", "episodes" } })">
|
||||
Episodes
|
||||
</MudText>
|
||||
@if (_episodes.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetEpisodesLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (TelevisionEpisodeCardViewModel card in _episodes.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
Href="@($"media/tv/seasons/{card.SeasonId}#episode-{card.EpisodeId}")"
|
||||
Subtitle="@($"{card.ShowTitle} - S{card.Season} E{card.Episode}")"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudStack>
|
||||
}
|
||||
|
||||
@if (_artists?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4" UserAttributes="@(new Dictionary<string, object> { { "id", "artists" } })">
|
||||
Artists
|
||||
</MudText>
|
||||
@if (_artists.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetArtistsLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (ArtistCardViewModel card in _artists.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href="@($"media/music/artists/{card.ArtistId}")"
|
||||
ArtworkKind="ArtworkKind.Thumbnail"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudStack>
|
||||
}
|
||||
|
||||
@if (_musicVideos?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4" UserAttributes="@(new Dictionary<string, object> { { "id", "music_videos" } })">
|
||||
Music Videos
|
||||
</MudText>
|
||||
@if (_musicVideos.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetMusicVideosLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (MusicVideoCardViewModel card in _musicVideos.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href=""
|
||||
ArtworkKind="ArtworkKind.Thumbnail"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudStack>
|
||||
}
|
||||
|
||||
@if (_otherVideos?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4" UserAttributes="@(new Dictionary<string, object> { { "id", "other_videos" } })">
|
||||
Other Videos
|
||||
</MudText>
|
||||
@if (_otherVideos.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetOtherVideosLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (OtherVideoCardViewModel card in _otherVideos.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href=""
|
||||
ArtworkKind="ArtworkKind.Thumbnail"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudStack>
|
||||
}
|
||||
|
||||
@if (_songs?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4" UserAttributes="@(new Dictionary<string, object> { { "id", "songs" } })">
|
||||
Songs
|
||||
</MudText>
|
||||
@if (_songs.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetSongsLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (SongCardViewModel card in _songs.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href=""
|
||||
ArtworkKind="ArtworkKind.Thumbnail"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudStack>
|
||||
}
|
||||
|
||||
@if (_images?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4" UserAttributes="@(new Dictionary<string, object> { { "id", "images" } })">
|
||||
Songs
|
||||
</MudText>
|
||||
@if (_images.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetImagesLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
<MudDivider Class="mb-6"/>
|
||||
|
||||
<MudStack Row="true" Wrap="Wrap.Wrap" Class="mb-10">
|
||||
@foreach (ImageCardViewModel card in _images.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href=""
|
||||
ArtworkKind="ArtworkKind.Thumbnail"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudStack>
|
||||
}
|
||||
</MudContainer>
|
||||
</div>
|
||||
</MudPaper>
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Style="margin-top: 96px">
|
||||
@if (_movies?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4"
|
||||
Style="scroll-margin-top: 160px"
|
||||
UserAttributes="@(new Dictionary<string, object> { { "id", "movies" } })">
|
||||
Movies
|
||||
</MudText>
|
||||
@if (_movies.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetMoviesLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
|
||||
@foreach (MovieCardViewModel card in _movies.Cards.OrderBy(m => m.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href="@($"media/movies/{card.MovieId}")"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudContainer>
|
||||
}
|
||||
|
||||
@if (_shows?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4"
|
||||
Style="scroll-margin-top: 160px"
|
||||
UserAttributes="@(new Dictionary<string, object> { { "id", "shows" } })">
|
||||
Shows
|
||||
</MudText>
|
||||
@if (_shows.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetShowsLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
|
||||
@foreach (TelevisionShowCardViewModel card in _shows.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href="@($"media/tv/shows/{card.TelevisionShowId}")"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudContainer>
|
||||
}
|
||||
|
||||
@if (_seasons?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4"
|
||||
Style="scroll-margin-top: 160px"
|
||||
UserAttributes="@(new Dictionary<string, object> { { "id", "seasons" } })">
|
||||
Seasons
|
||||
</MudText>
|
||||
@if (_seasons.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetSeasonsLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
|
||||
@foreach (TelevisionSeasonCardViewModel card in _seasons.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href="@($"media/tv/seasons/{card.TelevisionSeasonId}")"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudContainer>
|
||||
}
|
||||
|
||||
@if (_episodes?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4"
|
||||
Style="scroll-margin-top: 160px"
|
||||
UserAttributes="@(new Dictionary<string, object> { { "id", "episodes" } })">
|
||||
Episodes
|
||||
</MudText>
|
||||
@if (_episodes.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetEpisodesLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
|
||||
@foreach (TelevisionEpisodeCardViewModel card in _episodes.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
Href="@($"media/tv/seasons/{card.SeasonId}#episode-{card.EpisodeId}")"
|
||||
Subtitle="@($"{card.ShowTitle} - S{card.Season} E{card.Episode}")"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudContainer>
|
||||
}
|
||||
|
||||
@if (_artists?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4"
|
||||
Style="scroll-margin-top: 160px"
|
||||
UserAttributes="@(new Dictionary<string, object> { { "id", "artists" } })">
|
||||
Artists
|
||||
</MudText>
|
||||
@if (_artists.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetArtistsLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
|
||||
@foreach (ArtistCardViewModel card in _artists.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href="@($"media/music/artists/{card.ArtistId}")"
|
||||
ArtworkKind="ArtworkKind.Thumbnail"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudContainer>
|
||||
}
|
||||
|
||||
@if (_musicVideos?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4"
|
||||
Style="scroll-margin-top: 160px"
|
||||
UserAttributes="@(new Dictionary<string, object> { { "id", "music_videos" } })">
|
||||
Music Videos
|
||||
</MudText>
|
||||
@if (_musicVideos.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetMusicVideosLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
|
||||
@foreach (MusicVideoCardViewModel card in _musicVideos.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href=""
|
||||
ArtworkKind="ArtworkKind.Thumbnail"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudContainer>
|
||||
}
|
||||
|
||||
@if (_otherVideos?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4"
|
||||
Style="scroll-margin-top: 160px"
|
||||
UserAttributes="@(new Dictionary<string, object> { { "id", "other_videos" } })">
|
||||
Other Videos
|
||||
</MudText>
|
||||
@if (_otherVideos.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetOtherVideosLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
|
||||
@foreach (OtherVideoCardViewModel card in _otherVideos.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href=""
|
||||
ArtworkKind="ArtworkKind.Thumbnail"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudContainer>
|
||||
}
|
||||
|
||||
@if (_songs?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4"
|
||||
Style="scroll-margin-top: 160px"
|
||||
UserAttributes="@(new Dictionary<string, object> { { "id", "songs" } })">
|
||||
Songs
|
||||
</MudText>
|
||||
@if (_songs.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetSongsLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
|
||||
@foreach (SongCardViewModel card in _songs.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href=""
|
||||
ArtworkKind="ArtworkKind.Thumbnail"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudContainer>
|
||||
}
|
||||
|
||||
@if (_images?.Cards.Count > 0)
|
||||
{
|
||||
<div class="mb-4" style="align-items: baseline; display: flex; flex-direction: row;">
|
||||
<MudText Typo="Typo.h4"
|
||||
Style="scroll-margin-top: 160px"
|
||||
UserAttributes="@(new Dictionary<string, object> { { "id", "images" } })">
|
||||
Songs
|
||||
</MudText>
|
||||
@if (_images.Count > 50)
|
||||
{
|
||||
<MudLink Href="@GetImagesLink()" Class="ml-4">See All >></MudLink>
|
||||
}
|
||||
</div>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.False" Class="media-card-grid">
|
||||
@foreach (ImageCardViewModel card in _images.Cards.OrderBy(s => s.SortTitle))
|
||||
{
|
||||
<MediaCard Data="@card"
|
||||
Href=""
|
||||
ArtworkKind="ArtworkKind.Thumbnail"
|
||||
DeleteClicked="@DeleteItemFromDatabase"
|
||||
SelectColor="@Color.Error"
|
||||
SelectClicked="@(e => SelectClicked(card, e))"
|
||||
IsSelected="@IsSelected(card)"
|
||||
IsSelectMode="@IsSelectMode()"/>
|
||||
}
|
||||
</MudContainer>
|
||||
}
|
||||
</MudContainer>
|
||||
</MudForm>
|
||||
|
||||
@code {
|
||||
private readonly CancellationTokenSource _cts = new();
|
||||
@@ -660,39 +674,39 @@
|
||||
switch (vm)
|
||||
{
|
||||
case MovieCardViewModel movie:
|
||||
request = new DeleteItemsFromDatabase(new List<int> { movie.MovieId });
|
||||
request = new DeleteItemsFromDatabase([movie.MovieId]);
|
||||
await DeleteItemsWithConfirmation("movie", $"{movie.Title} ({movie.Subtitle})", request);
|
||||
break;
|
||||
case TelevisionShowCardViewModel show:
|
||||
request = new DeleteItemsFromDatabase(new List<int> { show.TelevisionShowId });
|
||||
request = new DeleteItemsFromDatabase([show.TelevisionShowId]);
|
||||
await DeleteItemsWithConfirmation("show", $"{show.Title} ({show.Subtitle})", request);
|
||||
break;
|
||||
case TelevisionSeasonCardViewModel season:
|
||||
request = new DeleteItemsFromDatabase(new List<int> { season.TelevisionSeasonId });
|
||||
request = new DeleteItemsFromDatabase([season.TelevisionSeasonId]);
|
||||
await DeleteItemsWithConfirmation("season", $"{season.Title} ({season.Subtitle})", request);
|
||||
break;
|
||||
case TelevisionEpisodeCardViewModel episode:
|
||||
request = new DeleteItemsFromDatabase(new List<int> { episode.EpisodeId });
|
||||
request = new DeleteItemsFromDatabase([episode.EpisodeId]);
|
||||
await DeleteItemsWithConfirmation("episode", $"{episode.Title} ({episode.Subtitle})", request);
|
||||
break;
|
||||
case ArtistCardViewModel artist:
|
||||
request = new DeleteItemsFromDatabase(new List<int> { artist.ArtistId });
|
||||
request = new DeleteItemsFromDatabase([artist.ArtistId]);
|
||||
await DeleteItemsWithConfirmation("artist", $"{artist.Title} ({artist.Subtitle})", request);
|
||||
break;
|
||||
case MusicVideoCardViewModel musicVideo:
|
||||
request = new DeleteItemsFromDatabase(new List<int> { musicVideo.MusicVideoId });
|
||||
request = new DeleteItemsFromDatabase([musicVideo.MusicVideoId]);
|
||||
await DeleteItemsWithConfirmation("music video", $"{musicVideo.Title} ({musicVideo.Subtitle})", request);
|
||||
break;
|
||||
case OtherVideoCardViewModel otherVideo:
|
||||
request = new DeleteItemsFromDatabase(new List<int> { otherVideo.OtherVideoId });
|
||||
request = new DeleteItemsFromDatabase([otherVideo.OtherVideoId]);
|
||||
await DeleteItemsWithConfirmation("other video", $"{otherVideo.Title} ({otherVideo.Subtitle})", request);
|
||||
break;
|
||||
case SongCardViewModel song:
|
||||
request = new DeleteItemsFromDatabase(new List<int> { song.SongId });
|
||||
request = new DeleteItemsFromDatabase([song.SongId]);
|
||||
await DeleteItemsWithConfirmation("song", $"{song.Title} ({song.Subtitle})", request);
|
||||
break;
|
||||
case ImageCardViewModel image:
|
||||
request = new DeleteItemsFromDatabase(new List<int> { image.ImageId });
|
||||
request = new DeleteItemsFromDatabase([image.ImageId]);
|
||||
await DeleteItemsWithConfirmation("image", $"{image.Title} ({image.Subtitle})", request);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3,28 +3,38 @@
|
||||
@using ErsatzTV.Application.Playouts
|
||||
@using ErsatzTV.Application.Scheduling
|
||||
@implements IDisposable
|
||||
@inject IDialogService Dialog
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject ISnackbar Snackbar
|
||||
@inject IMediator Mediator
|
||||
@inject IEntityLocker EntityLocker;
|
||||
@inject ILogger<YamlPlayoutEditor> Logger
|
||||
|
||||
<MudForm Style="max-height: 100%">
|
||||
<MudPaper Square="true" Style="display: flex; height: 64px; min-height: 64px; width: 100%; z-index: 100; align-items: center">
|
||||
<MudText Class="ml-8" >Edit YAML Playout - @_channelName</MudText>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="ml-8" OnClick="@(_ => SaveChanges())" StartIcon="@Icons.Material.Filled.Save">
|
||||
Save YAML File
|
||||
</MudButton>
|
||||
</MudPaper>
|
||||
<div class="d-flex flex-column" style="height: 100vh; overflow-x: auto">
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="pt-8">
|
||||
<MudText Typo="Typo.h5" Class="mb-2">YAML File</MudText>
|
||||
<MudText Typo="Typo.h5" Class="mb-2">@_channelName - YAML Playout</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudButton Disabled="@EntityLocker.IsPlayoutLocked(Id)" Variant="Variant.Filled" Color="Color.Primary" OnClick="@(_ => EditYamlFile())">
|
||||
Edit YAML File
|
||||
</MudButton>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">Playout Items and History</MudText>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>YAML File</MudText>
|
||||
</div>
|
||||
<MudTextField @bind-Value="@_playout.TemplateFile" For="@(() => _playout.TemplateFile)"/>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">Maintenance</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudButton Disabled="@EntityLocker.IsPlayoutLocked(Id)" Variant="Variant.Filled" Color="Color.Error" OnClick="@(_ => EraseItems(eraseHistory: true))">
|
||||
Erase Items and History
|
||||
</MudButton>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
<div class="d-flex">
|
||||
<MudText>Playout Items and History</MudText>
|
||||
</div>
|
||||
<MudButton Disabled="@EntityLocker.IsPlayoutLocked(Id)" Variant="Variant.Filled" Color="Color.Error" OnClick="@(_ => EraseItems(eraseHistory: true))" StartIcon="@Icons.Material.Filled.Delete">
|
||||
Erase Items and History
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
</MudContainer>
|
||||
</div>
|
||||
</MudForm>
|
||||
@@ -74,22 +84,26 @@
|
||||
Snackbar.Add(message, Severity.Info);
|
||||
}
|
||||
|
||||
private async Task EditYamlFile()
|
||||
private async Task SaveChanges()
|
||||
{
|
||||
if (_playout is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var parameters = new DialogParameters { { "YamlFile", $"{_playout.TemplateFile}" } };
|
||||
var options = new DialogOptions { CloseButton = true, MaxWidth = MaxWidth.ExtraLarge };
|
||||
Either<BaseError, PlayoutNameViewModel> result =
|
||||
await Mediator.Send(new UpdateYamlPlayout(_playout.PlayoutId, _playout.TemplateFile), _cts.Token);
|
||||
|
||||
IDialogReference dialog = await Dialog.ShowAsync<EditYamlFileDialog>("Edit YAML File", parameters, options);
|
||||
DialogResult result = await dialog.Result;
|
||||
if (result is not null && !result.Canceled)
|
||||
{
|
||||
await Mediator.Send(new UpdateYamlPlayout(_playout.PlayoutId, result.Data as string ?? _playout.TemplateFile), _cts.Token);
|
||||
}
|
||||
result.Match(
|
||||
_ =>
|
||||
{
|
||||
Snackbar.Add($"Saved YAML file for playout {_channelName}", Severity.Success);
|
||||
},
|
||||
error =>
|
||||
{
|
||||
Snackbar.Add($"Unexpected error saving YAML file: {error.Value}", Severity.Error);
|
||||
Logger.LogError("Unexpected error saving YAML file: {Error}", error.Value);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
@implements IDisposable
|
||||
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudContainer Class="mb-6">
|
||||
<MudText>
|
||||
Edit the playout's YAML file
|
||||
</MudText>
|
||||
</MudContainer>
|
||||
<MudTextField Label="YAML File" @bind-Value="_yamlFile"/>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel" ButtonType="ButtonType.Reset">Cancel</MudButton>
|
||||
<MudButton Color="Color.Primary" Variant="Variant.Filled" Disabled="@(string.IsNullOrWhiteSpace(_yamlFile))" OnClick="Submit">
|
||||
Save Changes
|
||||
</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
|
||||
@code {
|
||||
private readonly CancellationTokenSource _cts = new();
|
||||
|
||||
[Parameter]
|
||||
public string YamlFile { get; set; }
|
||||
|
||||
[CascadingParameter]
|
||||
IMudDialogInstance MudDialog { get; set; }
|
||||
|
||||
private string _yamlFile;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Cancel();
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
protected override void OnParametersSet() => _yamlFile = YamlFile;
|
||||
|
||||
private void Submit() => MudDialog.Close(DialogResult.Ok(_yamlFile));
|
||||
|
||||
private void Cancel() => MudDialog.Cancel();
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using ErsatzTV.ViewModels;
|
||||
using FluentValidation;
|
||||
|
||||
namespace ErsatzTV.Validators;
|
||||
|
||||
public class MultiCollectionEditViewModelValidator : AbstractValidator<MultiCollectionEditViewModel>
|
||||
{
|
||||
public MultiCollectionEditViewModelValidator() => RuleFor(c => c.Name).NotEmpty();
|
||||
}
|
||||
Reference in New Issue
Block a user