1
0
mirror of synced 2024-12-04 19:07:58 +01:00
TaikoLocalServer/TaikoWebUI/Pages/Song.razor

63 lines
2.3 KiB
Plaintext
Raw Normal View History

2024-03-10 04:48:26 +01:00
@page "/Users/{baid:int}/Songs/{songId:int}"
@inject IGameDataService GameDataService
@inject HttpClient Client
@inject LoginService LoginService
@inject NavigationManager NavigationManager
@inject IJSRuntime JSRuntime
@if (LoginService.LoginRequired && (!LoginService.IsLoggedIn || (LoginService.GetLoggedInUser().Baid != Baid && !LoginService.IsAdmin)))
{
if (!LoginService.IsLoggedIn)
{
NavigationManager.NavigateTo("/Login");
}
else
{
NavigationManager.NavigateTo("/");
}
}
else
{
if (response is not null)
{
<MudBreadcrumbs Items="breadcrumbs" Class="p-0 mb-3"></MudBreadcrumbs>
<MudText Typo="Typo.h5">@SongTitle</MudText>
<MudText Typo="Typo.body2">@SongArtist</MudText>
<MudGrid Class="my-4 pb-10">
2024-03-10 05:49:47 +01:00
<MudItem xs="12">
<MudCard Outlined="true" Elevation="0">
<MudCardHeader>
<MudText Typo="Typo.h6">Recent Plays</MudText>
</MudCardHeader>
2024-03-10 05:55:30 +01:00
<MudCardContent Class="p-0">
2024-03-10 05:49:47 +01:00
@if (SongBestData is not null && SongBestData.RecentPlayData is not null && SongBestData.RecentPlayData.Count > 0)
{
2024-03-10 05:55:30 +01:00
<MudTable Items="@SongBestData.RecentPlayData" Class="table-striped" Elevation="0">
2024-03-10 05:49:47 +01:00
<HeaderContent>
<MudTh>Play Time</MudTh>
<MudTh>Difficulty</MudTh>
<MudTh>Score</MudTh>
2024-03-10 05:55:30 +01:00
<MudTh>Crown</MudTh>
<MudTh>Rank</MudTh>
2024-03-10 05:49:47 +01:00
</HeaderContent>
<RowTemplate>
<MudTd>@context.PlayTime</MudTd>
<MudTd>@context.Difficulty</MudTd>
<MudTd>@context.Score</MudTd>
2024-03-10 05:55:30 +01:00
<MudTd>@context.Crown</MudTd>
<MudTd>@context.ScoreRank</MudTd>
2024-03-10 05:49:47 +01:00
</RowTemplate>
</MudTable>
}
else
{
<MudText Typo="Typo.body2">No recent plays</MudText>
}
</MudCardContent>
</MudCard>
</MudItem>
2024-03-10 04:48:26 +01:00
</MudGrid>
}
}