From 1d19d1006dffb8fdfbbf7dd1824ffc67703e915e Mon Sep 17 00:00:00 2001 From: Val Skordin Date: Thu, 7 Nov 2024 17:12:43 -0800 Subject: [PATCH] Modifications for Calendar & Schedule Editor: 1) Calendar.razor & EventView.razor - added Group Name & compact month view 2) Event Schedule Editor: modified page layout, added duration (hours) and Date & time are separated to two controls 3) updated translation resource files --- BedBrigade.Client/Components/EventView.razor | 98 ++++--- .../Components/Pages/Calendar.razor | 2 +- .../Components/Pages/Calendar.razor.cs | 1 + .../Components/ScheduleGrid.razor | 262 +++++++++--------- .../Components/ScheduleGrid.razor.cs | 25 +- BedBrigade.Client/Resources/en-US.yml | 10 +- BedBrigade.Client/Resources/es-MX.yml | 10 +- BedBrigade.Common/Models/AppointmentData.cs | 1 + 8 files changed, 228 insertions(+), 181 deletions(-) diff --git a/BedBrigade.Client/Components/EventView.razor b/BedBrigade.Client/Components/EventView.razor index a26f268..0ebf625 100644 --- a/BedBrigade.Client/Components/EventView.razor +++ b/BedBrigade.Client/Components/EventView.razor @@ -2,8 +2,21 @@ @using BedBrigade.Common.Logic @using BedBrigade.SpeakIt; -
-
+ @{ + if (RequestedView == "month"){ +
+ @_translateLogic.GetTranslation(EventData.Subject)
+ @EventData.StartTime.ToString("hh:mm tt") + - @EventData.EndTime.ToString("hh:mm tt") + @if (!string.IsNullOrEmpty(EventData.GroupName)){ +
@EventData.GroupName + } +
+ } + else + { +
+
@{ switch(RequestedView){ @@ -17,12 +30,7 @@ @_translateLogic.GetTranslation(EventData.Subject) - break; - case "month": -
- @_translateLogic.GetTranslation(EventData.Subject) -
- break; + break; case "week": default:
@@ -52,10 +60,9 @@  @EventData.StartTime.ToString("hh:mm tt") - @EventData.EndTime.ToString("hh:mm tt")
} - - + - @if (!string.IsNullOrEmpty(EventData.Location)) + @if (!string.IsNullOrEmpty(EventData.Location)) {
  @@ -72,37 +79,46 @@
} - @if (!string.IsNullOrEmpty(EventData.OrganizerName)) - { -
- - @_lc.Keys["OrganizerColon"] @EventData.OrganizerName -
- } + @if (!string.IsNullOrEmpty(EventData.GroupName)) + { +
+ + @_lc.Keys["Group"]: @EventData.GroupName +
+ } - @if (!string.IsNullOrEmpty(EventData.OrganizerEmail)) - { - - } - @if (!string.IsNullOrEmpty(EventData.OrganizerPhone)) - { - - } + @if (!string.IsNullOrEmpty(EventData.OrganizerName)) + { +
+ + @_lc.Keys["OrganizerColon"] @EventData.OrganizerName +
+ } - @if (!string.IsNullOrEmpty(EventData.Volunteers)) - { -
- - @_lc.Keys["VolunteersRegisteredColon"] @EventData.Volunteers -
- } + @if (!string.IsNullOrEmpty(EventData.OrganizerEmail)) + { + + } - @if (!string.IsNullOrEmpty(EventData.Description)) + @if (!string.IsNullOrEmpty(EventData.OrganizerPhone)) + { + + } + + @if (!string.IsNullOrEmpty(EventData.Volunteers)) + { +
+ + @_lc.Keys["VolunteersRegisteredColon"] @EventData.Volunteers +
+ } + + @if (!string.IsNullOrEmpty(EventData.Description)) { @switch (RequestedView) { @@ -128,9 +144,13 @@
  @((MarkupString)SplitDescription) -
+
} +
+ } +} + @code { diff --git a/BedBrigade.Client/Components/Pages/Calendar.razor b/BedBrigade.Client/Components/Pages/Calendar.razor index 890cfd2..8418a53 100644 --- a/BedBrigade.Client/Components/Pages/Calendar.razor +++ b/BedBrigade.Client/Components/Pages/Calendar.razor @@ -159,7 +159,7 @@ } .e-schedule .e-month-view .e-appointment { - height: 200px; + height: 60px; font-size: smaller; padding-left: 5px; } diff --git a/BedBrigade.Client/Components/Pages/Calendar.razor.cs b/BedBrigade.Client/Components/Pages/Calendar.razor.cs index 067cf2d..a416ea9 100644 --- a/BedBrigade.Client/Components/Pages/Calendar.razor.cs +++ b/BedBrigade.Client/Components/Pages/Calendar.razor.cs @@ -172,6 +172,7 @@ private List GetCalendarAppointments(List BBEvents) EndTime = s.EventDateScheduled.AddHours(s.EventDurationHours), Description = StringUtil.IsNull(s.EventNote,""), Location = FormatAddress(s.Address, s.City, s.State, s.PostalCode), + GroupName = StringUtil.IsNull(s.GroupName, ""), OrganizerName = s.OrganizerName, OrganizerPhone = s.OrganizerPhone, OrganizerEmail = s.OrganizerEmail, diff --git a/BedBrigade.Client/Components/ScheduleGrid.razor b/BedBrigade.Client/Components/ScheduleGrid.razor index b8c532d..989a33a 100644 --- a/BedBrigade.Client/Components/ScheduleGrid.razor +++ b/BedBrigade.Client/Components/ScheduleGrid.razor @@ -66,19 +66,12 @@ ShowDeleteConfirmDialog="true"> @{ - @HeaderTitle + @HeaderTitle } -
-
- * -
-
- - -
-
+ +
diff --git a/BedBrigade.Client/Components/ScheduleGrid.razor.cs b/BedBrigade.Client/Components/ScheduleGrid.razor.cs index 8e22c32..bdc1b76 100644 --- a/BedBrigade.Client/Components/ScheduleGrid.razor.cs +++ b/BedBrigade.Client/Components/ScheduleGrid.razor.cs @@ -41,6 +41,7 @@ public partial class ScheduleGrid : ComponentBase public List? lstEventStatuses { get; private set; } public List? lstEventTypes { get; private set; } public DateTime ScheduleStartDate { get; set; } + public DateTime ScheduleStartTime { get; set; } public DateTime ScheduleEndDate { get; set; } public bool enabledLocationSelector { get; set; } = true; @@ -68,6 +69,8 @@ public partial class ScheduleGrid : ComponentBase private User? _currentUser = new User(); private int _selectedLocationId = 0; + private List? StateList = AddressHelper.GetStateList(); + protected override async Task OnInitializedAsync() { @@ -292,8 +295,8 @@ private async Task Delete(Syncfusion.Blazor.Grids.ActionEventArgs args private void Add() { - HeaderTitle = "Add Schedule"; - ButtonTitle = "Add Schedule"; + HeaderTitle = _lc.Keys["Add"] + " " + _lc.Keys["Schedule"]; + ButtonTitle = _lc.Keys["Add"] + " " + _lc.Keys["Schedule"]; if (isLocationAdmin) { enabledLocationSelector = false; @@ -308,7 +311,10 @@ private void Add() private async Task Save(Syncfusion.Blazor.Grids.ActionEventArgs args) { Schedule editSchedule = args.Data; - + + editSchedule.EventDateScheduled = ScheduleStartDate.Date + ScheduleStartTime.TimeOfDay; + + if (editSchedule.ScheduleId != 0) // Updated schedule { //Update Schedule Record @@ -355,17 +361,18 @@ private async Task Save(Syncfusion.Blazor.Grids.ActionEventArgs args) private void BeginEdit() { - HeaderTitle = "Update Schedule #"+ selectedScheduleId.ToString(); - ButtonTitle = "Update"; + HeaderTitle = _lc.Keys["Update"] + " " + _lc.Keys["Schedule"]+ " #" + selectedScheduleId.ToString(); + ButtonTitle = _lc.Keys["Update"]; enabledLocationSelector = false; } - protected async Task Save(Schedule schedule) - { + public async Task Save(Schedule schedule) { + + await Grid.EndEditAsync(); } - protected async Task Cancel() + public async Task Cancel() { await Grid.CloseEditAsync(); } @@ -454,7 +461,7 @@ private async Task OnFilterChange(ChangeEventArgs args private string cssClass { get; set; } = "e-outline"; protected Dictionary DescriptionHtmlAttribute { get; set; } = new Dictionary() { - { "rows", "7" }, + { "rows", "3" }, }; Dictionary htmlattributeSize = new Dictionary() diff --git a/BedBrigade.Client/Resources/en-US.yml b/BedBrigade.Client/Resources/en-US.yml index d0e23cb..71742c0 100644 --- a/BedBrigade.Client/Resources/en-US.yml +++ b/BedBrigade.Client/Resources/en-US.yml @@ -1,5 +1,6 @@ 5CharactersContainingOnly: (5 characters containing only digits 0-9) Active: Active +Add: Add Address: Address AgesGender: Ages / Gender Amount: Amount @@ -18,7 +19,8 @@ BuildPostalCode: Build Postal Code BuildState: Build State Cancel: Cancel ChangePassword: Change Password -ChooseADate: Choose a Date & Time +ChooseADate: Choose a Date +ChooseATime: Choose a Time City: City ClickToSignup: (Click to Signup) CompareConfirmPasswordToPassword: The passwords do not match. @@ -43,6 +45,7 @@ DeliveryVehicleTruck: I have a full size pickup truck with tie down straps or a DonationDate: Donation Date Donations: Donations DoYouAttendChurch: Do you attend church regularly? +DurationHours: Duration (hours) DynamicApril: April DynamicAprilBedBuild: April Bed Build DynamicAugust: August @@ -92,6 +95,7 @@ EventidColon: 'EventID:' EventName: Event Name EventNote: Event Note EventStatus: Event Status +EventTime: Event Time EventType: Event Type FillOutTheRecaptcha: Fill out the recaptcha checkbox and submit the form. FindABedBrigade: Find a Bed Brigade Near Me @@ -100,6 +104,7 @@ FolderColon: 'Folder:' FoundLocationsWithin: Found {count} locations within {maxMiles} miles of {postalCode} FromStartTimeToEndTime: from {startTime} to {endTime} FutureScheduled: Future Scheduled +Group: Group GroupName: Group Name HaveYouVolunteeredFor: Have you volunteered for Bed Brigade before? IfYouLikeTo: If you like to volunteer with Bed Brigade, please select our Location and complete the Volunteer registration form @@ -208,11 +213,11 @@ RequiredStreet: Street Address is required RequiredSubject: Subject is required. RequiredTranslationId: Translation ID is required RequiredUserId: User Id is required -Resources: Resources ReturnToHome: Return to Home Role: Role Route: Route Save: Save +Schedule: Schedule Scheduling: Scheduling SeachAVolunteerBy: Seach a Volunteer by Name Search: Search @@ -252,6 +257,7 @@ Unauthorized: Unauthorized UpcomingBuilds: Upcoming Builds UpcomingDeliveries: Upcoming Deliveries UpcomingEvents: Upcoming Events +Update: Update UserName: User Name ValidEmail: Please enter a valid email address ValidPhoneNumber: Phone numbers must be 10 digits with a valid area code and prefix diff --git a/BedBrigade.Client/Resources/es-MX.yml b/BedBrigade.Client/Resources/es-MX.yml index 86ef039..2fd5bbf 100644 --- a/BedBrigade.Client/Resources/es-MX.yml +++ b/BedBrigade.Client/Resources/es-MX.yml @@ -1,5 +1,6 @@ 5CharactersContainingOnly: (5 caracteres que contienen solo los dígitos del 0 al 9) Active: Activo +Add: Añadir Address: Dirección AgesGender: Edades / Género Amount: Importe @@ -18,7 +19,8 @@ BuildPostalCode: Construir código postal BuildState: Estado de compilación Cancel: Cancelar ChangePassword: Cambiar contraseña -ChooseADate: Elija una fecha y hora +ChooseADate: Elija una fecha +ChooseATime: Elija una hora City: Ciudad ClickToSignup: (Haga clic para registrarse) CompareConfirmPasswordToPassword: Las contraseñas no coinciden. @@ -43,6 +45,7 @@ DeliveryVehicleTruck: Tengo una camioneta pickup de tamaño completo con correas DonationDate: Fecha de donación Donations: Donaciones DoYouAttendChurch: ¿Asistes a la iglesia regularmente? +DurationHours: Duración (horas) DynamicApril: Abril DynamicAprilBedBuild: Construcción de cama de abril DynamicAugust: Agosto @@ -92,6 +95,7 @@ EventidColon: 'ID de evento:' EventName: Nombre del evento EventNote: Nota del evento EventStatus: Estado del evento +EventTime: Hora del evento EventType: Tipo de evento FillOutTheRecaptcha: Rellena la casilla de verificación recaptcha y envía el formulario. FindABedBrigade: Encuentra una brigada de camas cerca de mí @@ -100,6 +104,7 @@ FolderColon: 'Carpeta:' FoundLocationsWithin: Se han encontrado ubicaciones de {count} dentro de {maxMiles} millas de {postalCode} FromStartTimeToEndTime: de {startTime} a {endTime} FutureScheduled: Futuro Programado +Group: Grupo GroupName: Nombre del grupo HaveYouVolunteeredFor: ¿Has sido voluntario para Bed Brigade antes? IfYouLikeTo: Si desea ser voluntario con Bed Brigade, seleccione nuestra ubicación y complete el formulario de registro de voluntario @@ -208,11 +213,11 @@ RequiredStreet: Se requiere la dirección postal RequiredSubject: El asunto es obligatorio. RequiredTranslationId: Se requiere el ID de traducción RequiredUserId: Se requiere un ID de usuario -Resources: Recursos ReturnToHome: Volver a casa Role: Rol Route: Ruta Save: Salvar +Schedule: Horario Scheduling: Planificación SeachAVolunteerBy: Buscar a un voluntario por su nombre Search: Buscar @@ -252,6 +257,7 @@ Unauthorized: Desautorizado UpcomingBuilds: Próximas compilaciones UpcomingDeliveries: Próximas entregas UpcomingEvents: Próximos eventos +Update: Actualización UserName: Nombre de usuario ValidEmail: Introduzca una dirección de correo electrónico válida ValidPhoneNumber: Los números de teléfono deben tener 10 dígitos con un código de área y un prefijo válidos diff --git a/BedBrigade.Common/Models/AppointmentData.cs b/BedBrigade.Common/Models/AppointmentData.cs index a8fe77e..d5236c7 100644 --- a/BedBrigade.Common/Models/AppointmentData.cs +++ b/BedBrigade.Common/Models/AppointmentData.cs @@ -14,6 +14,7 @@ public class AppointmentData public string? Description { get; set; } public DateTime StartTime { get; set; } public DateTime EndTime { get; set; } + public string? GroupName { get; set; } public string? OrganizerName { get; set; } public string? OrganizerEmail { get; set; } public string? OrganizerPhone { get; set; }