Skip to content

Conversation

@PuskarC
Copy link
Contributor

@PuskarC PuskarC commented Jun 30, 2025

Issue Description

Fixes #1540

  • The original create event page had only one location field, which worked for single events but was inconvenient for adding multiple events with different locations using the weekly offerings modal.

Changes

  • Added a new Location field inside the weekly event offerings modal (weekly_offerings_modal.html).
  • Removed the single Location field from the main create event when the user clicks the 'series of events' toggle.
  • Updated JavaScript logic to handle the dynamic location field input and ensure it's tied to the correct event entry.
  • Made it mandatory to enter an event name before toggling the multi-offering modal (to avoid blank entries).
  • Adjusted modal logic to ensure each event listing now includes Name, Date, Time, and Location.
  • Also added session number for every event added when we click on 'This is a series of events' and then click on Add Occurrence

Testing

  • Navigate to the CELTS Website and go to 'Create Event' from the dashboard.
  • Select a Program and then check the event creation form
  • Confirm the main Location field is no longer present when we click on the toggle for 'This is a series of events'
  • Toggle weekly event offerings and add multiple weekly events.
  • Each entry should now have its own Location field alongside Name, Date, and Time.
  • Look for session number for every event added by clicking 'Add Occurrence'
    -Try entering different locations for each event and save.
  • After submission, verify that all event details, including locations, are stored correctly in the database.

BEFORE

image

In the modal when we click on 'Add Occurrence', we don't see a textbox for Event Location and then the Location textbox still appears outside the modal.

image

There's no Event Location in this modal too when we click on 'This series repeats weekly'

image

There's no session name like session 1, session 2..... when we click on 'Add Occurrence'

AFTER

image

image

image

image

@bakobagassas
Copy link
Contributor

When we save an occurrence without inputting a location, it still saves, although there is that red star that indicates that the location input is compulsory. The user should not be able to save when the location field is empty

@bakobagassas
Copy link
Contributor

When we save an event that repeats weekly for 1 month for instance, the location fields remain undefined even though we inputted a location while creating the weekly event. We should have that location appearing on each of the weekly events (or have the option to select different locations too, I guess?)

@Jonimz Jonimz reopened this Jul 1, 2025
@Karina-Agliullova
Copy link
Contributor

The code is broken. As Sara mentioned above, first of all, it lets me save weekly event even without inputting location. But when I hit save, it outputs a broken table with nothing in it. And if I hit save that whole event, it throws a validation error
Screenshot (101)
Screenshot (102)

@Shenderaz Shenderaz requested review from Shenderaz and mathew2005 July 2, 2025 18:47
@BesherKitaz
Copy link
Contributor

The modal does not allow two events with the same date, name and time even though the location is different. For example, if there is an event that happens in two separate locations, but the other details are identical, they should be able to add it without a problem. We can see in the picture below that the location is different for each, yet still showing an error.
image

Also, when all details are identical, the validation message says "Event listing cannot have the same event name, date, and start time" and does not mention location. We should clarify to the user that the location is also part of the problem:
image

@admin_bp.route('/eventTemplates')
def templateSelect():
if g.current_user.isCeltsAdmin or g.current_user.isCeltsStudentStaff:
if g.current_user.isCeltsAdmin or g.current_user.isCeltsStudentStaff or g.current_user.isStudent:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure we should let students access this page to create new events? Just checking because I don't know if that's a new thing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. We actually spoke with Dr. Heggen and confirmed that it should remain this way. The reasoning is that if it's the same session occurring at the same time and on the same date, but in different locations, while possible, it defeats the purpose of having a single, coherent event. At that point, users likely wouldn’t be going to the website to look up which location to attend, especially in a worst-case scenario.

function setViewForSingleOffering(){
$(".startDatePicker").prop('required', true);
$("#multipleOfferingTableDiv").addClass('d-none');
$("#eventLocation-main").removeClass('d-none');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it was initially my idea to use removeClass() and addClass(), but Brian later said that we should try to use .hide() and .show(). So I would recommend using them here if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion! We updated the code to use .show() and .hide() instead of .addClass('d-none') / .removeClass('d-none') as recommended. However, we noticed that in some cases, especially with elements like #multipleOfferingTableDiv, replacing class toggling with .show()/.hide() caused the table to not appear and broke the expected functionality.

To resolve this, we’re now using a combination of .hide()/.show() and .addClass('d-none')/.removeClass('d-none') where necessary to ensure everything works as intended.

$(".startDatePicker").prop('required', false);
$("#multipleOfferingTableDiv").removeClass('d-none');
$("#eventLocation-main").addClass('d-none');
$("#inputEventLocation-main").prop('required', false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as comment above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!!

PuskarC added 2 commits July 3, 2025 16:24
…removeClass() and addClass(), and changed the message for flash
@Jonimz Jonimz force-pushed the locationFieldChange branch from 39e2505 to a23aa23 Compare July 19, 2025 05:42
@github-actions
Copy link

View Code Coverage

Copy link
Contributor

@Karina-Agliullova Karina-Agliullova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@Jonimz Jonimz requested a review from BrianRamsay July 22, 2025 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding a Location field for every single event listing

8 participants