diff --git a/src/app.py b/src/app.py index fd0c462..a6e38ec 100644 --- a/src/app.py +++ b/src/app.py @@ -38,6 +38,42 @@ "schedule": "Mondays, Wednesdays, Fridays, 2:00 PM - 3:00 PM", "max_participants": 30, "participants": ["john@mergington.edu", "olivia@mergington.edu"] + }, + "Soccer Team": { + "description": "Join the school soccer team and compete in matches", + "schedule": "Tuesdays and Thursdays, 4:00 PM - 5:30 PM", + "max_participants": 22, + "participants": ["liam@mergington.edu", "noah@mergington.edu"] + }, + "Basketball Team": { + "description": "Practice and compete in basketball games", + "schedule": "Wednesdays and Fridays, 3:30 PM - 5:00 PM", + "max_participants": 15, + "participants": ["ava@mergington.edu", "mia@mergington.edu"] + }, + "Art Club": { + "description": "Explore various art techniques and create projects", + "schedule": "Thursdays, 3:30 PM - 5:00 PM", + "max_participants": 15, + "participants": ["amelia@mergington.edu", "isabella@mergington.edu"] + }, + "Drama Club": { + "description": "Participate in plays and improve acting skills", + "schedule": "Mondays and Wednesdays, 4:00 PM - 5:30 PM", + "max_participants": 20, + "participants": ["lucas@mergington.edu", "harper@mergington.edu"] + }, + "Math Club": { + "description": "Solve challenging math problems and compete in math contests", + "schedule": "Tuesdays, 3:30 PM - 4:30 PM", + "max_participants": 10, + "participants": ["elijah@mergington.edu", "charlotte@mergington.edu"] + }, + "Debate Team": { + "description": "Develop public speaking and argumentation skills", + "schedule": "Fridays, 4:00 PM - 5:30 PM", + "max_participants": 12, + "participants": ["james@mergington.edu", "sophia@mergington.edu"] } } @@ -62,6 +98,10 @@ def signup_for_activity(activity_name: str, email: str): # Get the specificy activity activity = activities[activity_name] + # Validate student is not already signed up + if email in activity["participants"]: + raise HTTPException(status_code=400, detail="Already signed up for this activity") + # Add student activity["participants"].append(email) return {"message": f"Signed up {email} for {activity_name}"} diff --git a/src/static/app.js b/src/static/app.js index dcc1e38..b3bc91d 100644 --- a/src/static/app.js +++ b/src/static/app.js @@ -25,6 +25,12 @@ document.addEventListener("DOMContentLoaded", () => {

${details.description}

Schedule: ${details.schedule}

Availability: ${spotsLeft} spots left

+
+ Participants: + +
`; activitiesList.appendChild(activityCard); diff --git a/src/static/styles.css b/src/static/styles.css index a533b32..01f3f01 100644 --- a/src/static/styles.css +++ b/src/static/styles.css @@ -142,3 +142,28 @@ footer { padding: 20px; color: #666; } + +.participants { + margin-top: 10px; + padding: 10px; + background-color: #eef7ff; + border: 1px solid #cce4ff; + border-radius: 5px; +} + +.participants strong { + display: block; + margin-bottom: 5px; + color: #0056b3; +} + +.participants ul { + list-style-type: disc; + padding-left: 20px; + margin: 0; +} + +.participants li { + margin-bottom: 5px; + color: #333; +}