2022-09-11 18:28:12 +02:00
|
|
|
@inject IGameDataService GameDataService
|
2022-09-09 14:31:45 +02:00
|
|
|
@inject HttpClient Client
|
2023-10-16 11:38:27 +02:00
|
|
|
@inject LoginService LoginService
|
2024-03-08 21:11:54 +01:00
|
|
|
@inject IJSRuntime JSRuntime
|
2024-03-09 20:13:56 +01:00
|
|
|
@inject NavigationManager NavigationManager
|
2024-03-14 05:38:26 +01:00
|
|
|
@using TaikoWebUI.Utilities;
|
|
|
|
@using TaikoWebUI.Shared.Models;
|
|
|
|
@using SharedProject.Enums;
|
2022-09-09 14:31:45 +02:00
|
|
|
|
2024-03-10 04:48:26 +01:00
|
|
|
@page "/Users/{baid:int}/Songs"
|
2022-09-09 14:31:45 +02:00
|
|
|
|
2024-03-09 20:13:56 +01:00
|
|
|
<MudBreadcrumbs Items="breadcrumbs" Class="p-0 mb-2"></MudBreadcrumbs>
|
2024-03-08 09:06:08 +01:00
|
|
|
<MudText Typo="Typo.h4">@Localizer["Key_01"]</MudText>
|
2023-11-12 00:12:26 +01:00
|
|
|
|
2022-09-10 06:56:53 +02:00
|
|
|
<MudGrid Class="my-8">
|
2022-09-10 17:45:18 +02:00
|
|
|
@if (response is null)
|
|
|
|
{
|
2024-03-14 03:27:55 +01:00
|
|
|
<MudContainer Style="display:flex;margin:50px 0;align-items:center;justify-content:center;">
|
|
|
|
<MudProgressCircular Indeterminate="true" Size="Size.Large" Color="Color.Primary" />
|
|
|
|
</MudContainer>
|
2022-09-10 17:45:18 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-11-12 00:12:26 +01:00
|
|
|
@if (LoginService.LoginRequired && (!LoginService.IsLoggedIn || (LoginService.GetLoggedInUser().Baid != Baid && !LoginService.IsAdmin)))
|
2023-10-16 11:38:27 +02:00
|
|
|
{
|
2024-03-09 20:13:56 +01:00
|
|
|
if (!LoginService.IsLoggedIn)
|
|
|
|
{
|
|
|
|
NavigationManager.NavigateTo("/Login");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
NavigationManager.NavigateTo("/");
|
|
|
|
}
|
2023-10-16 11:38:27 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<MudItem xs="12">
|
2024-03-14 05:38:26 +01:00
|
|
|
<MudTable Items="musicMap" Elevation="0" Outlined="true" Filter="@FilterSongs" Striped="true">
|
|
|
|
<ToolBarContent>
|
|
|
|
<MudGrid Spacing="2">
|
|
|
|
<MudItem xs="12" md="8">
|
|
|
|
<MudTextField @bind-Value="Search"
|
|
|
|
Placeholder="@Localizer["Search by Title or Artist"]"
|
|
|
|
Variant="Variant.Outlined"
|
|
|
|
Margin="Margin.Dense"
|
|
|
|
Adornment="Adornment.Start"
|
|
|
|
AdornmentIcon="@Icons.Material.Filled.Search"
|
|
|
|
IconSize="Size.Medium" />
|
|
|
|
</MudItem>
|
|
|
|
<MudItem xs="12" md="4">
|
|
|
|
<MudSelect @bind-Value="GenreFilter" T="string" Label="@Localizer["Filter by Genre"]" Variant="Variant.Outlined" Margin="Margin.Dense" Clearable="true">
|
|
|
|
@foreach (var genre in Enum.GetValues(typeof(SongGenre)))
|
|
|
|
{
|
|
|
|
var genreValue = (SongGenre)genre;
|
|
|
|
<MudSelectItem Value="@genreValue.ToString()" Label="@Localizer[$"Key_{genreValue}"]">
|
|
|
|
@ScoreUtils.GetGenreTitle(genreValue)
|
|
|
|
</MudSelectItem>
|
|
|
|
}
|
|
|
|
</MudSelect>
|
|
|
|
</MudItem>
|
|
|
|
</MudGrid>
|
|
|
|
</ToolBarContent>
|
2024-03-14 03:27:55 +01:00
|
|
|
<HeaderContent>
|
2024-03-14 05:38:26 +01:00
|
|
|
<MudTh>
|
|
|
|
<MudTableSortLabel T="MusicDetail" SortBy="context => GameDataService.GetMusicNameBySongId(context.SongId, CurrentLanguage)">
|
|
|
|
Song Title / Artist
|
|
|
|
</MudTableSortLabel>
|
|
|
|
</MudTh>
|
2024-03-14 03:27:55 +01:00
|
|
|
</HeaderContent>
|
|
|
|
<RowTemplate>
|
2024-03-14 05:38:26 +01:00
|
|
|
<MudTd>
|
2024-03-14 03:27:55 +01:00
|
|
|
<a href="@($"/Users/{Baid}/Songs/{context.SongId}")">
|
2024-03-14 05:38:26 +01:00
|
|
|
<MudText Typo="Typo.body2">
|
|
|
|
@GameDataService.GetMusicNameBySongId(context.SongId, CurrentLanguage)
|
|
|
|
</MudText>
|
|
|
|
<MudText Typo="Typo.caption">
|
|
|
|
@GameDataService.GetMusicArtistBySongId(context.SongId, CurrentLanguage)
|
|
|
|
</MudText>
|
2024-03-14 03:27:55 +01:00
|
|
|
</a>
|
2024-03-14 05:38:26 +01:00
|
|
|
</MudTd>
|
2024-03-14 03:27:55 +01:00
|
|
|
</RowTemplate>
|
2024-03-14 05:38:26 +01:00
|
|
|
<PagerContent>
|
|
|
|
<MudTablePager />
|
|
|
|
</PagerContent>
|
2024-03-14 03:27:55 +01:00
|
|
|
</MudTable>
|
2023-10-16 11:38:27 +02:00
|
|
|
</MudItem>
|
|
|
|
}
|
2022-09-10 17:45:18 +02:00
|
|
|
}
|
2022-09-11 18:28:12 +02:00
|
|
|
</MudGrid>
|