Files
WatchIt/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/CreatorRolesPanelComponent.razor

42 lines
2.3 KiB
Plaintext

@using WatchIt.Common.Model.Persons
@using WatchIt.Common.Model.Roles
<div class="panel panel-padding-regular panel-radius-regular panel-background-regular @(Class)">
@if (_loaded)
{
<div class="vstack gap-3">
<span class="panel-text-title">Creators</span>
<div class="d-flex justify-content-center">
<RadioGroup TValue="short" Color="Color.Default" Buttons Size="Size.Small" CheckedValue="@(_query.TypeId!.Value)" CheckedValueChanged="CheckedTypeChanged">
@foreach (RoleTypeResponse roleType in _roleTypes)
{
<Radio Value="@(roleType.Id)">@roleType.Name</Radio>
}
</RadioGroup>
</div>
<RoleListComponent @ref=@(_roleListComponent)
TRole="CreatorRoleResponse"
TQuery="CreatorRoleMediaQueryParameters"
TRoleParent="PersonResponse"
Id="@(Id)"
Query="@(_query)"
GetRolesAction="@(MediaWebAPIService.GetMediaAllCreatorRoles)"
NameSource="@((_, parent) => parent.Name)"
GetRoleParentMethod="@((id, action) => PersonsWebAPIService.GetPerson(id, action))"
ParentItemIdSource="@(item => item.PersonId)"
ParentUrlTemplate="/person/{0}"
PosterPlaceholder="/assets/person_poster.png"
PosterDownloadingTask="@((id, action) => PersonsWebAPIService.GetPersonPhoto(id, action))"
GetGlobalRatingMethod="@((id, action) => RolesWebAPIService.GetCreatorRoleRating(id, action))"
GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesWebAPIService.GetCreatorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))"
PutRatingMethod="@((id, request) => RolesWebAPIService.PutCreatorRoleRating(id, request))"
DeleteRatingMethod="@((id) => RolesWebAPIService.DeleteCreatorRoleRating(id))"/>
</div>
}
else
{
<LoadingComponent Color="@(LoadingComponent.LoadingComponentColors.Light)"/>
}
</div>