diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/DatabasePageComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/DatabasePageComponent.razor
index 576aa68..2df7f44 100644
--- a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/DatabasePageComponent.razor
+++ b/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/DatabasePageComponent.razor
@@ -48,29 +48,40 @@
{
if (string.IsNullOrWhiteSpace(_error))
{
- foreach (TItem item in _items)
+ if (_items.Count > 0)
{
-
NavigationManager.NavigateTo(string.Format(UrlIdTemplate, IdSource(item))))">
-
-
+ foreach (TItem item in _items)
+ {
+ NavigationManager.NavigateTo(string.Format(UrlIdTemplate, IdSource(item))))">
+
+
+ }
+ if (!_allItemsLoaded)
+ {
+
+
+ @if (!_itemsLoading)
+ {
+ Load more
+ }
+ else
+ {
+
+ Loading...
+ }
+
+
+ }
}
- if (!_allItemsLoaded)
+ else
{
-
+
- @if (!_itemsLoading)
- {
- Load more
- }
- else
- {
-
- Loading...
- }
+ No items found
}
diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/PersonsFilterFormComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/PersonsFilterFormComponent.razor
new file mode 100644
index 0000000..7f251bf
--- /dev/null
+++ b/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/PersonsFilterFormComponent.razor
@@ -0,0 +1,71 @@
+@using WatchIt.Common.Model.Genders
+@inherits FilterFormComponent
+
+
+
+
+
+
+
+
+
+
+ Birth date
+
+ -
+
+
+
+
+
+ Death date
+
+ -
+
+
+
+
+
+ Gender
+
+
+ @foreach (GenderResponse gender in _genders)
+ {
+
+ }
+
+
+
+
+
+ Rating (count)
+
+ -
+
+
+
+
+
+ Rating (average)
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/PersonsFilterFormComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/PersonsFilterFormComponent.razor.cs
new file mode 100644
index 0000000..ca4f085
--- /dev/null
+++ b/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/PersonsFilterFormComponent.razor.cs
@@ -0,0 +1,48 @@
+using Microsoft.AspNetCore.Components;
+using WatchIt.Common.Model.Genders;
+using WatchIt.Common.Model.Persons;
+using WatchIt.Website.Services.WebAPI.Genders;
+
+namespace WatchIt.Website.Components.Pages.DatabasePage.Subcomponents;
+
+public partial class PersonsFilterFormComponent : FilterFormComponent
+{
+ #region SERVICES
+
+ [Inject] private IGendersWebAPIService GendersWebAPIService { get; set; } = default!;
+
+ #endregion
+
+
+
+ #region FIELDS
+
+ private IEnumerable _genders = [];
+
+ #endregion
+
+
+
+ #region PRIVATE METHODS
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ if (firstRender)
+ {
+ List endTasks = new List();
+
+ // STEP 0
+ endTasks.AddRange(
+ [
+ GendersWebAPIService.GetAllGenders(successAction: data => _genders = data)
+ ]);
+
+ // END
+ await Task.WhenAll(endTasks);
+
+ StateHasChanged();
+ }
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor
index d6e9886..63f25b6 100644
--- a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor
+++ b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor
@@ -37,6 +37,7 @@
Movies
TV Series
+ People
diff --git a/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor b/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor
index c553f1e..0d46cb7 100644
--- a/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor
+++ b/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor
@@ -1,4 +1,5 @@
@using WatchIt.Common.Model.Movies
+@using WatchIt.Common.Model.Persons
@using WatchIt.Common.Model.Series
@using WatchIt.Website.Components.Pages.DatabasePage
@using WatchIt.Website.Components.Pages.DatabasePage.Subcomponents
@@ -17,63 +18,78 @@
case "series":
@("Series");
break;
+ case "people":
+ @("People");
+ break;
}
@(" database")
-@if (_loaded)
+
+@switch (Type)
{
- switch (Type)
- {
- case "movies":
-
-
-
- break;
- case "series":
-
-
-
- break;
- }
-
-}
-else
-{
-
-
-
+ case "movies":
+
+
+
+ break;
+ case "series":
+
+
+
+ break;
+ case "people":
+
+
+
+ break;
}
\ No newline at end of file
diff --git a/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor.cs
index e9e4e9c..3f9f6d9 100644
--- a/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor.cs
+++ b/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor.cs
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Components;
using WatchIt.Website.Services.WebAPI.Media;
using WatchIt.Website.Services.WebAPI.Movies;
+using WatchIt.Website.Services.WebAPI.Persons;
using WatchIt.Website.Services.WebAPI.Series;
namespace WatchIt.Website.Pages;
@@ -13,6 +14,7 @@ public partial class DatabasePage : ComponentBase
[Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!;
[Inject] private IMoviesWebAPIService MoviesWebAPIService { get; set; } = default!;
[Inject] private ISeriesWebAPIService SeriesWebAPIService { get; set; } = default!;
+ [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!;
#endregion
@@ -28,9 +30,7 @@ public partial class DatabasePage : ComponentBase
#region FIELDS
- private static IEnumerable _databaseTypes = ["movies", "series"];
-
- private bool _loaded;
+ private static IEnumerable _databaseTypes = ["movies", "series", "people"];
#endregion
@@ -38,18 +38,11 @@ public partial class DatabasePage : ComponentBase
#region PRIVATE METHODS
- protected override async Task OnAfterRenderAsync(bool firstRender)
+ protected override void OnParametersSet()
{
- if (firstRender)
+ if (!_databaseTypes.Contains(Type))
{
- // INIT
- if (!_databaseTypes.Contains(Type))
- {
- NavigationManager.NavigateTo($"/database/{_databaseTypes.First()}");
- }
-
- _loaded = true;
- StateHasChanged();
+ NavigationManager.NavigateTo($"/database/{_databaseTypes.First()}");
}
}