Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
}

Expand All @@ -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")

Copilot AI Sep 26, 2025

Copy link

Choose a reason for hiding this comment

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

There's trailing whitespace at the end of this line. Consider removing it for cleaner code formatting.

Suggested change
raise HTTPException(status_code=400, detail="Already signed up for this activity")
raise HTTPException(status_code=400, detail="Already signed up for this activity")

Copilot uses AI. Check for mistakes.

# Add student
activity["participants"].append(email)
return {"message": f"Signed up {email} for {activity_name}"}
8 changes: 8 additions & 0 deletions src/static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ document.addEventListener("DOMContentLoaded", () => {
<p>${details.description}</p>
<p><strong>Schedule:</strong> ${details.schedule}</p>
<p><strong>Availability:</strong> ${spotsLeft} spots left</p>
<div class="activity-card-participants">
<h5>Participants</h5>
<ul>
${details.participants.length === 0
? '<li><em>Aucun participant pour le moment</em></li>'

Copilot AI Sep 26, 2025

Copy link

Choose a reason for hiding this comment

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

The text 'Aucun participant pour le moment' is in French, which appears inconsistent with the rest of the application that uses English. Consider changing to 'No participants yet' for consistency.

Suggested change
? '<li><em>Aucun participant pour le moment</em></li>'
? '<li><em>No participants yet</em></li>'

Copilot uses AI. Check for mistakes.
: details.participants.map(p => `<li>${p}</li>`).join('')}
</ul>
</div>
`;

activitiesList.appendChild(activityCard);
Expand Down
38 changes: 38 additions & 0 deletions src/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down