File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,31 @@ document.addEventListener("DOMContentLoaded", () => {
2020
2121 const spotsLeft = details . max_participants - details . participants . length ;
2222
23+ // Build participants list HTML
24+ let participantsHTML = "" ;
25+ if ( details . participants . length > 0 ) {
26+ participantsHTML = `
27+ <div class="participants-section">
28+ <strong>Participants:</strong>
29+ <ul class="participants-list">
30+ ${ details . participants . map ( email => `<li>${ email } </li>` ) . join ( "" ) }
31+ </ul>
32+ </div>
33+ ` ;
34+ } else {
35+ participantsHTML = `
36+ <div class="participants-section no-participants">
37+ <em>No participants yet.</em>
38+ </div>
39+ ` ;
40+ }
41+
2342 activityCard . innerHTML = `
2443 <h4>${ name } </h4>
2544 <p>${ details . description } </p>
2645 <p><strong>Schedule:</strong> ${ details . schedule } </p>
2746 <p><strong>Availability:</strong> ${ spotsLeft } spots left</p>
47+ ${ participantsHTML }
2848 ` ;
2949
3050 activitiesList . appendChild ( activityCard ) ;
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ section h3 {
6363 border : 1px solid # ddd ;
6464 border-radius : 5px ;
6565 background-color : # f9f9f9 ;
66+ position : relative;
6667}
6768
6869.activity-card h4 {
@@ -142,3 +143,32 @@ footer {
142143 padding : 20px ;
143144 color : # 666 ;
144145}
146+
147+ .participants-section {
148+ margin-top : 12px ;
149+ padding : 10px ;
150+ background-color : # eef3fb ;
151+ border-radius : 4px ;
152+ border : 1px solid # dbeafe ;
153+ }
154+
155+ .participants-section strong {
156+ color : # 1a237e ;
157+ font-size : 15px ;
158+ }
159+
160+ .participants-list {
161+ margin : 8px 0 0 18px ;
162+ padding : 0 ;
163+ list-style-type : disc;
164+ color : # 333 ;
165+ font-size : 15px ;
166+ }
167+
168+ .no-participants {
169+ background-color : # f9f9f9 ;
170+ color : # 888 ;
171+ border : none;
172+ font-style : italic;
173+ padding-left : 0 ;
174+ }
You can’t perform that action at this time.
0 commit comments