diff --git a/src/app.py b/src/app.py index 4ebb1d9..27ea0e6 100644 --- a/src/app.py +++ b/src/app.py @@ -38,6 +38,45 @@ "schedule": "Mondays, Wednesdays, Fridays, 2:00 PM - 3:00 PM", "max_participants": 30, "participants": ["john@mergington.edu", "olivia@mergington.edu"] + }, + # Sports related activities + "Soccer Team": { + "description": "Join the school soccer team and compete in matches", + "schedule": "Wednesdays, 4:00 PM - 5:30 PM", + "max_participants": 18, + "participants": ["alex@mergington.edu", "lucas@mergington.edu"] + }, + "Basketball Club": { + "description": "Practice basketball skills and play friendly games", + "schedule": "Thursdays, 3:30 PM - 5:00 PM", + "max_participants": 15, + "participants": ["mia@mergington.edu", "noah@mergington.edu"] + }, + # Artistic activities + "Art Workshop": { + "description": "Explore painting, drawing, and sculpture techniques", + "schedule": "Mondays, 4:00 PM - 5:30 PM", + "max_participants": 16, + "participants": ["ava@mergington.edu", "liam@mergington.edu"] + }, + "Drama Club": { + "description": "Act, direct, and produce school plays and performances", + "schedule": "Tuesdays, 3:30 PM - 5:00 PM", + "max_participants": 20, + "participants": ["ella@mergington.edu", "jack@mergington.edu"] + }, + # Intellectual activities + "Mathletes": { + "description": "Compete in math competitions and solve challenging problems", + "schedule": "Fridays, 4:00 PM - 5:00 PM", + "max_participants": 10, + "participants": ["oliver@mergington.edu", "isabella@mergington.edu"] + }, + "Science Club": { + "description": "Conduct experiments and explore scientific concepts", + "schedule": "Wednesdays, 3:30 PM - 4:30 PM", + "max_participants": 14, + "participants": ["charlotte@mergington.edu", "benjamin@mergington.edu"] } } @@ -62,6 +101,10 @@ def signup_for_activity(activity_name: str, email: str): # Get the specific activity activity = activities[activity_name] + # Check if 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..548ac31 100644 --- a/src/static/app.js +++ b/src/static/app.js @@ -25,6 +25,14 @@ 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..30923ad 100644 --- a/src/static/styles.css +++ b/src/static/styles.css @@ -74,6 +74,44 @@ section h3 { margin-bottom: 8px; } +.activity-card-participants { + margin-top: 15px; + padding: 12px 15px; + border-radius: 4px; + background-color: white; + border-top: 1px solid #e3e7ef; + box-shadow: 0 1px 2px rgba(26, 35, 126, 0.04); +} + +.activity-card-participants h5 { + margin-bottom: 10px; + color: #1a237e; + font-size: 1.05rem; + font-weight: bold; + letter-spacing: 0.5px; +} + +.activity-card-participants ul { + list-style-type: disc; + padding-left: 22px; + margin-bottom: 0; +} + +.activity-card-participants li { + margin-bottom: 6px; + color: #3949ab; + font-size: 0.98rem; + font-weight: 500; + background: transparent; + border-radius: 2px; + transition: background 0.2s; +} + +.activity-card-participants li:hover { + background: #e3eafc; + padding-left: 2px; +} + .form-group { margin-bottom: 15px; }