From b090c1d9fbcb9c1cd6147d65822223a8901451e6 Mon Sep 17 00:00:00 2001 From: Berkan Sasmaz Date: Wed, 5 May 2021 02:45:29 +0300 Subject: [PATCH] Improve pagination and filtering for event list --- .../Events/Components/EventsArea/Default.cshtml | 4 +++- .../Components/EventsArea/EventsAreaViewComponent.cs | 6 ++++++ src/EventHub.Web/Pages/Events/Index.cshtml | 8 ++++---- src/EventHub.Web/Pages/Events/Index.js | 12 ++++++------ src/EventHub.Web/Pages/Organizations/Profile.cshtml | 4 ++-- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/EventHub.Web/Pages/Events/Components/EventsArea/Default.cshtml b/src/EventHub.Web/Pages/Events/Components/EventsArea/Default.cshtml index 5c5c25c..2762308 100644 --- a/src/EventHub.Web/Pages/Events/Components/EventsArea/Default.cshtml +++ b/src/EventHub.Web/Pages/Events/Components/EventsArea/Default.cshtml @@ -6,7 +6,7 @@ - @if (Model.IsPagination && Model.TotalCount >= 10) + @if (Model.IsPagination && Model.TotalCount >= 10 && Model.TotalCount > Model.Events.Count) {
@@ -19,6 +19,8 @@ maxDate = Model.MaxDate, organizationId = Model.OrganizationId, isOnline = Model.IsOnline, + language = Model.Language, + countryId = Model.CountryId, maxResultCount = Model.MaxResultCount })"> Load More diff --git a/src/EventHub.Web/Pages/Events/Components/EventsArea/EventsAreaViewComponent.cs b/src/EventHub.Web/Pages/Events/Components/EventsArea/EventsAreaViewComponent.cs index 8761bc6..73348ca 100644 --- a/src/EventHub.Web/Pages/Events/Components/EventsArea/EventsAreaViewComponent.cs +++ b/src/EventHub.Web/Pages/Events/Components/EventsArea/EventsAreaViewComponent.cs @@ -57,6 +57,8 @@ namespace EventHub.Web.Pages.Events.Components.EventsArea MinDate = minDate, MaxDate = maxDate, IsOnline = isOnline, + Language = language, + CountryId = countryId, SkipCount = skipCount.GetValueOrDefault(), MaxResultCount = maxResultCount, IsPagination = isPagination @@ -78,6 +80,10 @@ namespace EventHub.Web.Pages.Events.Components.EventsArea public bool? IsOnline { get; set; } + public string Language { get; set; } + + public Guid? CountryId { get; set; } + public int SkipCount { get; set; } public int MaxResultCount { get; set; } diff --git a/src/EventHub.Web/Pages/Events/Index.cshtml b/src/EventHub.Web/Pages/Events/Index.cshtml index 956f790..8179ccb 100644 --- a/src/EventHub.Web/Pages/Events/Index.cshtml +++ b/src/EventHub.Web/Pages/Events/Index.cshtml @@ -43,15 +43,15 @@
- - + +
@@ -59,7 +59,7 @@
@* ToDo: System of tags or categories needs to be implemented *@