152 lines
9.3 KiB
Plaintext
152 lines
9.3 KiB
Plaintext
@using System.Text
|
|
@using WatchIt.Common.Model.Movies
|
|
@using WatchIt.Common.Model.Persons
|
|
@using WatchIt.Common.Model.Series
|
|
@using WatchIt.Website.Components.Pages.UserPage.Panels
|
|
@using WatchIt.Website.Components.Common.ListComponent
|
|
@using WatchIt.Website.Components.Pages.UserPage.Subcomponents
|
|
@using WatchIt.Website.Services.Client.Persons
|
|
|
|
@page "/user/{id:long?}"
|
|
|
|
@{
|
|
StringBuilder sb = new StringBuilder(" - WatchIt");
|
|
|
|
if (!_loaded) sb.Insert(0, "Loading...");
|
|
else if (_accountData is null) sb.Insert(0, "Error");
|
|
else
|
|
{
|
|
if (_owner) sb.Insert(0, "Your profile");
|
|
else sb.Insert(0, $"\"{_accountData.Username}\" profile");
|
|
}
|
|
|
|
<PageTitle>@(sb.ToString())</PageTitle>
|
|
}
|
|
|
|
|
|
|
|
<div class="container-grid">
|
|
@if (!_loaded)
|
|
{
|
|
<div class="row">
|
|
<div class="col">
|
|
<div class="m-5">
|
|
<LoadingComponent/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
else if (_accountData is null)
|
|
{
|
|
<div class="row">
|
|
<div class="col">
|
|
<ErrorPanelComponent ErrorMessage="@($"User with ID {Id!.Value} was not found")"/>
|
|
</div>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="row mt-header">
|
|
<div class="col">
|
|
<UserPageHeaderPanelComponent AccountData="@(_accountData)"/>
|
|
</div>
|
|
</div>
|
|
<div class="row mt-over-panel-menu">
|
|
<div class="col">
|
|
<Tabs Pills
|
|
RenderMode="TabsRenderMode.LazyLoad"
|
|
SelectedTab="summary"
|
|
Class="panel panel-menu panel-background-menu justify-content-center">
|
|
<Items>
|
|
<Tab Name="summary">Summary</Tab>
|
|
<Tab Name="movies">Movies</Tab>
|
|
<Tab Name="series">TV Series</Tab>
|
|
<Tab Name="people">People</Tab>
|
|
</Items>
|
|
<Content>
|
|
<TabPanel Name="summary">
|
|
|
|
</TabPanel>
|
|
<TabPanel Name="movies">
|
|
<div class="mt-default">
|
|
<ListComponent TItem="MovieRatedResponse"
|
|
TQuery="MovieRatedQueryParameters"
|
|
Title="Rated movies"
|
|
IdSource="@(item => item.Id)"
|
|
NameSource="@(item => item.Title)"
|
|
AdditionalNameInfoSource="@(item => item.ReleaseDate.HasValue ? $" ({item.ReleaseDate.Value.Year})" : null)"
|
|
RatingSource="@(item => item.Rating)"
|
|
SecondaryRatingSingleSource="@(item => _owner ? null : item.UserRating)"
|
|
SecondaryRatingTitle="User rating"
|
|
UrlIdTemplate="/media/{0}"
|
|
PictureDownloadingTask="@((id, action) => MediaClientService.GetMediaPoster(id, action))"
|
|
ItemDownloadingTask="@((query, action) => AccountsClientService.GetAccountRatedMovies(Id!.Value, query, action))"
|
|
SortingOptions="@(new Dictionary<string, string> { { "user_rating", "User rating" }, { "rating.count", "Number of ratings" }, { "rating.average", "Average rating" }, { "title", "Title" }, { "release_date", "Release date" } })"
|
|
PosterPlaceholder="/assets/media_poster.png"
|
|
GetGlobalRatingMethod="@((id, action) => MediaClientService.GetMediaRating(id, action))"
|
|
GetUserRatingMethod="@((id, userId, successAction, notfoundAction) => MediaClientService.GetMediaRatingByUser(id, userId, successAction, notfoundAction))"
|
|
PutRatingMethod="@((id, request) => MediaClientService.PutMediaRating(id, request))"
|
|
DeleteRatingMethod="@(id => MediaClientService.DeleteMediaRating(id))">
|
|
<MoviesRatedFilterFormComponent/>
|
|
</ListComponent>
|
|
</div>
|
|
</TabPanel>
|
|
<TabPanel Name="series">
|
|
<div class="mt-default">
|
|
<ListComponent TItem="SeriesRatedResponse"
|
|
TQuery="SeriesRatedQueryParameters"
|
|
Title="Rated TV series"
|
|
IdSource="@(item => item.Id)"
|
|
NameSource="@(item => item.Title)"
|
|
AdditionalNameInfoSource="@(item => item.ReleaseDate.HasValue ? $" ({item.ReleaseDate.Value.Year})" : null)"
|
|
RatingSource="@(item => item.Rating)"
|
|
SecondaryRatingSingleSource="@(item => _owner ? null : item.UserRating)"
|
|
SecondaryRatingTitle="User rating"
|
|
UrlIdTemplate="/media/{0}"
|
|
PictureDownloadingTask="@((id, action) => MediaClientService.GetMediaPoster(id, action))"
|
|
ItemDownloadingTask="@((query, action) => AccountsClientService.GetAccountRatedSeries(Id!.Value, query, action))"
|
|
SortingOptions="@(new Dictionary<string, string> { { "user_rating", "User rating" }, { "rating.count", "Number of ratings" }, { "rating.average", "Average rating" }, { "title", "Title" }, { "release_date", "Release date" } })"
|
|
PosterPlaceholder="/assets/media_poster.png"
|
|
GetGlobalRatingMethod="@((id, action) => MediaClientService.GetMediaRating(id, action))"
|
|
GetUserRatingMethod="@((id, userId, successAction, notfoundAction) => MediaClientService.GetMediaRatingByUser(id, userId, successAction, notfoundAction))"
|
|
PutRatingMethod="@((id, request) => MediaClientService.PutMediaRating(id, request))"
|
|
DeleteRatingMethod="@(id => MediaClientService.DeleteMediaRating(id))">
|
|
<SeriesRatedFilterFormComponent/>
|
|
</ListComponent>
|
|
</div>
|
|
</TabPanel>
|
|
<TabPanel Name="people">
|
|
<div class="mt-default">
|
|
<ListComponent TItem="PersonRatedResponse"
|
|
TQuery="PersonRatedQueryParameters"
|
|
Title="Rated people"
|
|
IdSource="@(item => item.Id)"
|
|
NameSource="@(item => item.Name)"
|
|
RatingSource="@(item => item.Rating)"
|
|
SecondaryRatingMultipleSource="@(item => item.UserRating)"
|
|
SecondaryRatingTitle="User rating"
|
|
UrlIdTemplate="/media/{0}"
|
|
PictureDownloadingTask="@((id, action) => PersonsClientService.GetPersonPhoto(id, action))"
|
|
ItemDownloadingTask="@((query, action) => AccountsClientService.GetAccountRatedPersons(Id!.Value, query, action))"
|
|
SortingOptions="@(new Dictionary<string, string>
|
|
{
|
|
{ "user_rating.average", "Average user rating" },
|
|
{ "user_rating.count", "Number of user ratings" },
|
|
{ "rating.average", "Average rating" },
|
|
{ "rating.count", "Number of ratings" },
|
|
{ "name", "Name" },
|
|
{ "birth_date", "Birth date" },
|
|
{ "death_date", "Death date" },
|
|
})"
|
|
PosterPlaceholder="/assets/person_poster.png"
|
|
GetGlobalRatingMethod="@((id, action) => PersonsClientService.GetPersonGlobalRating(id, action))">
|
|
<PersonsRatedFilterFormComponent/>
|
|
</ListComponent>
|
|
</div>
|
|
</TabPanel>
|
|
</Content>
|
|
</Tabs>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div> |