File tree Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ document.addEventListener("DOMContentLoaded", () => {
44 const signupForm = document . getElementById ( "signup-form" ) ;
55 const messageDiv = document . getElementById ( "message" ) ;
66
7+
78 // Function to fetch activities from API
89 async function fetchActivities ( ) {
910 try {
@@ -20,11 +21,31 @@ document.addEventListener("DOMContentLoaded", () => {
2021
2122 const spotsLeft = details . max_participants - details . participants . length ;
2223
24+ // Build participants list HTML
25+ let participantsHTML = "" ;
26+ if ( details . participants . length > 0 ) {
27+ participantsHTML = `
28+ <div class="participants-section">
29+ <strong>Participants:</strong>
30+ <ul class="participants-list">
31+ ${ details . participants . map ( email => `<li>${ email } </li>` ) . join ( "" ) }
32+ </ul>
33+ </div>
34+ ` ;
35+ } else {
36+ participantsHTML = `
37+ <div class="participants-section no-participants">
38+ <em>No participants yet.</em>
39+ </div>
40+ ` ;
41+ }
42+
2343 activityCard . innerHTML = `
2444 <h4>${ name } </h4>
2545 <p>${ details . description } </p>
2646 <p><strong>Schedule:</strong> ${ details . schedule } </p>
2747 <p><strong>Availability:</strong> ${ spotsLeft } spots left</p>
48+ ${ participantsHTML }
2849 ` ;
2950
3051 activitiesList . appendChild ( activityCard ) ;
Original file line number Diff line number Diff line change @@ -142,3 +142,32 @@ footer {
142142 padding : 20px ;
143143 color : # 666 ;
144144}
145+
146+ .participants-section {
147+ margin-top : 12px ;
148+ padding : 10px ;
149+ background-color : # e3eafc ;
150+ border-radius : 4px ;
151+ }
152+
153+ .participants-section strong {
154+ color : # 1a237e ;
155+ }
156+
157+ .participants-list {
158+ margin : 8px 0 0 18px ;
159+ padding-left : 0 ;
160+ list-style-type : disc;
161+ color : # 333 ;
162+ font-size : 15px ;
163+ }
164+
165+ .no-participants {
166+ background-color : # f5f5f5 ;
167+ color : # 888 ;
168+ font-style : italic;
169+ padding : 8px 10px ;
170+ border-radius : 4px ;
171+ }
172+
173+ # Hey @professortocat , Agent mode sounds pretty cool . Can you please tell me more about it ?
You can’t perform that action at this time.
0 commit comments