From 0ce084abce0489e83be6746c75c53d83d979a94a Mon Sep 17 00:00:00 2001 From: plumass Date: Fri, 26 Sep 2025 07:41:36 +0000 Subject: [PATCH 1/2] =?UTF-8?q?Ajout=20de=20nouvelles=20activit=C3=A9s=20e?= =?UTF-8?q?xtrascolaires=20et=20v=C3=A9rification=20de=20l'inscription=20d?= =?UTF-8?q?es=20participants?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) 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}"} From 45ec12b78eaff336c07351e4c187562175949c3e Mon Sep 17 00:00:00 2001 From: plumass Date: Fri, 26 Sep 2025 07:58:49 +0000 Subject: [PATCH 2/2] =?UTF-8?q?Ajout=20d'une=20section=20pour=20afficher?= =?UTF-8?q?=20les=20participants=20dans=20la=20carte=20d'activit=C3=A9=20e?= =?UTF-8?q?t=20styles=20associ=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/static/app.js | 8 ++++++++ src/static/styles.css | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) 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
+
    + ${details.participants.length === 0 + ? '
  • Aucun participant pour le moment
  • ' + : details.participants.map(p => `
  • ${p}
  • `).join('')} +
+
`; 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; }