diff --git a/src/EventHub.Application.Contracts/Events/Registrations/IEventRegistrationAppService.cs b/src/EventHub.Application.Contracts/Events/Registrations/IEventRegistrationAppService.cs index f27c22b..d7e8cbe 100644 --- a/src/EventHub.Application.Contracts/Events/Registrations/IEventRegistrationAppService.cs +++ b/src/EventHub.Application.Contracts/Events/Registrations/IEventRegistrationAppService.cs @@ -14,5 +14,7 @@ namespace EventHub.Events.Registrations Task IsRegisteredAsync(Guid eventId); Task> GetAttendeesAsync(Guid eventId); + + Task GetAttendeeCountAsync(Guid eventId); } } diff --git a/src/EventHub.Application/Events/Registrations/EventRegistrationAppService.cs b/src/EventHub.Application/Events/Registrations/EventRegistrationAppService.cs index 1e3321b..34d3659 100644 --- a/src/EventHub.Application/Events/Registrations/EventRegistrationAppService.cs +++ b/src/EventHub.Application/Events/Registrations/EventRegistrationAppService.cs @@ -80,5 +80,14 @@ namespace EventHub.Events.Registrations ObjectMapper.Map, List>(users) ); } + + public async Task GetAttendeeCountAsync(Guid eventId) + { + var eventRegistrationQueryable = await _eventRegistrationRepository.GetQueryableAsync(); + + var query = eventRegistrationQueryable.Where(x => x.EventId == eventId); + + return await AsyncExecuter.CountAsync(query); + } } } diff --git a/src/EventHub.Domain.Shared/Localization/EventHub/en.json b/src/EventHub.Domain.Shared/Localization/EventHub/en.json index d9ede49..a485c8c 100644 --- a/src/EventHub.Domain.Shared/Localization/EventHub/en.json +++ b/src/EventHub.Domain.Shared/Localization/EventHub/en.json @@ -70,6 +70,19 @@ "ChooseEventCoverImage": "Choose event cover image...", "EventCoverImageSizeExceedMessage": "The image is too large to upload. Max image size: 1MB.", "EventCoverImageExtensionNotAllowed": "This image extension is not allowed. Allowed extensions: png, jpg, jpeg", - "ChooseEventCoverImageInfo": "Maximum image size: 1MB." + "ChooseEventCoverImageInfo": "Maximum image size: 1MB.", + "ProfilePicturePreview": "Profile Picture Preview", + "EditEvent": "Edit Event", + "EventInformation": "Event Information", + "EventCapacityLabel": "Capacity (Optional)", + "EventCapacityInfo": "Capacity can not be lower than the currently registered user count : {0}", + "EventTiming": "Event Timing", + "Note": "Note", + "EventTimingChangeCountWarningMessage": "You can not change the event timing more than two times.", + "EventTimingChangeEmailNotificationMessage": "If you change the event times, an informational email will be sent to all attendees.", + "EventCoverImage": "Event Cover Image", + "EventTimingPreview": "Event Timing Preview", + "CoverImagePreview": "Cover Image Preview", + "EventTimingChangeSuccessMessage": "The time of the event has been changed successfully!" } } diff --git a/src/EventHub.Web/Pages/Events/Edit.cshtml b/src/EventHub.Web/Pages/Events/Edit.cshtml index b706e87..d1978e5 100644 --- a/src/EventHub.Web/Pages/Events/Edit.cshtml +++ b/src/EventHub.Web/Pages/Events/Edit.cshtml @@ -11,10 +11,10 @@
-

Edit Event

+

@L["EditEvent"]

- -
+ + @@ -30,17 +30,17 @@
- + - +
@@ -50,7 +50,7 @@
- +
@@ -71,9 +71,9 @@ - + - If you change the event times, an informational email will be sent to all attendees. + @L["EventTimingChangeEmailNotificationMessage"] @@ -82,7 +82,7 @@ - + event-cover-image-preview diff --git a/src/EventHub.Web/Pages/Events/Edit.cshtml.cs b/src/EventHub.Web/Pages/Events/Edit.cshtml.cs index ee1b9ad..1aa2b6f 100644 --- a/src/EventHub.Web/Pages/Events/Edit.cshtml.cs +++ b/src/EventHub.Web/Pages/Events/Edit.cshtml.cs @@ -6,6 +6,7 @@ using System.Globalization; using System.Linq; using System.Threading.Tasks; using EventHub.Events; +using EventHub.Events.Registrations; using EventHub.Web.Helpers; using JetBrains.Annotations; using Microsoft.AspNetCore.Http; @@ -26,15 +27,19 @@ namespace EventHub.Web.Pages.Events [BindProperty] public EditEventTimingViewModel EventTiming { get; set; } + + public int AttendeeCount { get; set; } public List Countries { get; private set; } public List Languages { get; private set; } private readonly IEventAppService _eventAppService; + private readonly IEventRegistrationAppService _eventRegistrationAppService; - public EditPageModel(IEventAppService eventAppService) + public EditPageModel(IEventAppService eventAppService, IEventRegistrationAppService eventRegistrationAppService) { _eventAppService = eventAppService; + _eventRegistrationAppService = eventRegistrationAppService; } public async Task OnGetAsync() @@ -48,6 +53,8 @@ namespace EventHub.Web.Pages.Events FillLanguages(); await FillCountriesAsync(); await GetLocationInfoAsync(); + + AttendeeCount = await _eventRegistrationAppService.GetAttendeeCountAsync(Event.Id); } public async Task OnPostAsync() diff --git a/src/EventHub.Web/Pages/Events/Edit.js b/src/EventHub.Web/Pages/Events/Edit.js index b57c847..2aa93bb 100644 --- a/src/EventHub.Web/Pages/Events/Edit.js +++ b/src/EventHub.Web/Pages/Events/Edit.js @@ -48,7 +48,7 @@ $(function () { data: data, success: function (data) { abp.message - .success("Timing changed successfully!") //TODO: localize it! + .success(l("EventTimingChangeSuccessMessage")) .then(data => window.location.href = "/events/" + $("#event-detail-url").val()); }, error: function (data) { diff --git a/src/EventHub.Web/Pages/Organizations/Edit.cshtml b/src/EventHub.Web/Pages/Organizations/Edit.cshtml index 3de96e1..c4be1a5 100644 --- a/src/EventHub.Web/Pages/Organizations/Edit.cshtml +++ b/src/EventHub.Web/Pages/Organizations/Edit.cshtml @@ -40,7 +40,7 @@ - +