96 lines
4.6 KiB
Plaintext
96 lines
4.6 KiB
Plaintext
<div class="row">
|
|
<div class="col-auto rounded-3 panel panel-regular m-1 p-3">
|
|
<img class="rounded-2 shadow mb-1" src="@(_posterBase64 is not null ? $"data:{_posterMediaType};base64,{_posterBase64}" : "assets/poster.png")" alt="poster" width="300" height="500"/>
|
|
<br/>
|
|
<InputFile id="posterInput" class="form-control my-1" OnChange="LoadPoster" disabled=@(!Id.HasValue) autocomplete="off"/>
|
|
|
|
@if (_posterChanged || !string.IsNullOrWhiteSpace(_actualPosterBase64))
|
|
{
|
|
<div id="posterButtons" class="container-fluid mt-2 p-0">
|
|
<div class="row gx-1">
|
|
@if (_posterChanged)
|
|
{
|
|
<div class="col">
|
|
<button type="button" class="btn btn-secondary btn-block btn-stretch-x" @onclick="SavePoster" disabled=@(!Id.HasValue || _posterLoading) autocomplete="off">Save poster</button>
|
|
</div>
|
|
<div class="col">
|
|
<button type="button" class="btn btn-danger btn-block btn-stretch-x" @onclick="CancelPoster" disabled=@(!Id.HasValue || _posterLoading) autocomplete="off">Drop changes</button>
|
|
</div>
|
|
}
|
|
else if (!string.IsNullOrWhiteSpace(_actualPosterBase64))
|
|
{
|
|
<div class="col">
|
|
<button type="button" class="btn btn-danger btn-block btn-stretch-x" @onclick="DeletePoster" disabled=@(!Id.HasValue || _posterLoading) autocomplete="off">Delete poster</button>
|
|
</div>
|
|
}
|
|
@if (_posterLoading)
|
|
{
|
|
<div class="col-auto">
|
|
<div class="d-flex align-items-center justify-content-center">
|
|
<div class="spinner-border" role="status"></div>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="col rounded-3 panel panel-regular m-1 p-3">
|
|
<EditForm Model="Data" FormName="MediaInfo">
|
|
<AntiforgeryToken/>
|
|
<div class="form-group row my-1">
|
|
<label for="title" class="col-2 col-form-label">Title*</label>
|
|
<div class="col-10">
|
|
<InputText id="title" class="form-control" @bind-Value="Data!.Title"/>
|
|
</div>
|
|
</div>
|
|
<div class="form-group row my-1">
|
|
<label for="originalTitle" class="col-2 col-form-label">Original title</label>
|
|
<div class="col-10">
|
|
<InputText id="originalTitle" class="form-control" @bind-Value="Data!.OriginalTitle"/>
|
|
</div>
|
|
</div>
|
|
<div class="form-group row my-1">
|
|
<label for="description" class="col-2 col-form-label">Description</label>
|
|
<div class="col-10">
|
|
<InputTextArea id="description" class="form-control" rows="14" @bind-Value="Data!.Description"/>
|
|
</div>
|
|
</div>
|
|
<div class="form-group row my-1">
|
|
<label for="releaseDate" class="col-2 col-form-label">Release date</label>
|
|
<div class="col-10">
|
|
<InputDate TValue="DateOnly?" id="releaseDate" class="form-control" @bind-Value="Data!.ReleaseDate"/>
|
|
</div>
|
|
</div>
|
|
<div class="form-group row my-1">
|
|
<label for="length" class="col-2 col-form-label">Length</label>
|
|
<div class="col-10">
|
|
<InputNumber TValue="short?" id="length" class="form-control" @bind-Value="Data!.Length"/>
|
|
</div>
|
|
</div>
|
|
<div class="row my-1 mt-3">
|
|
<div class="col d-flex align-items-center">
|
|
@if (SaveDataErrors is not null && SaveDataErrors.Any())
|
|
{
|
|
<p class="text-danger m-0">@(SaveDataErrors.ElementAt(0))</p>
|
|
}
|
|
else if (!string.IsNullOrWhiteSpace(SaveDataInfo))
|
|
{
|
|
<p class="text-success m-0">@(SaveDataInfo)</p>
|
|
}
|
|
</div>
|
|
<div class="col-auto">
|
|
<button type="button" class="btn btn-secondary" @onclick="SaveDataAction">Save data</button>
|
|
</div>
|
|
</div>
|
|
</EditForm>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
#posterInput, #posterButtons {
|
|
width: 300px;
|
|
}
|
|
</style> |