File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,22 @@ document.addEventListener("DOMContentLoaded", () => {
19
19
activityCard . className = "activity-card" ;
20
20
21
21
const spotsLeft = details . max_participants - details . participants . length ;
22
+
23
+ const participantsList = details . participants . length > 0
24
+ ? `<div class="participants-section">
25
+ <h5>Participantes:</h5>
26
+ <ul>
27
+ ${ details . participants . map ( email => `<li>${ email } </li>` ) . join ( '' ) }
28
+ </ul>
29
+ </div>`
30
+ : '<p class="no-participants">Nenhum participante inscrito ainda</p>' ;
22
31
23
32
activityCard . innerHTML = `
24
33
<h4>${ name } </h4>
25
34
<p>${ details . description } </p>
26
35
<p><strong>Schedule:</strong> ${ details . schedule } </p>
27
36
<p><strong>Availability:</strong> ${ spotsLeft } spots left</p>
37
+ ${ participantsList }
28
38
` ;
29
39
30
40
activitiesList . appendChild ( activityCard ) ;
@@ -62,6 +72,7 @@ document.addEventListener("DOMContentLoaded", () => {
62
72
messageDiv . textContent = result . message ;
63
73
messageDiv . className = "success" ;
64
74
signupForm . reset ( ) ;
75
+ fetchActivities ( ) ; // Atualizar a lista de atividades
65
76
} else {
66
77
messageDiv . textContent = result . detail || "An error occurred" ;
67
78
messageDiv . className = "error" ;
Original file line number Diff line number Diff line change @@ -142,3 +142,33 @@ footer {
142
142
padding : 20px ;
143
143
color : # 666 ;
144
144
}
145
+
146
+ .participants-section {
147
+ margin-top : 15px ;
148
+ padding-top : 15px ;
149
+ border-top : 1px solid # ddd ;
150
+ }
151
+
152
+ .participants-section h5 {
153
+ color : # 1a237e ;
154
+ margin-bottom : 8px ;
155
+ font-size : 0.95em ;
156
+ }
157
+
158
+ .participants-section ul {
159
+ list-style-position : inside;
160
+ padding-left : 10px ;
161
+ }
162
+
163
+ .participants-section li {
164
+ color : # 555 ;
165
+ font-size : 0.9em ;
166
+ margin-bottom : 4px ;
167
+ }
168
+
169
+ .no-participants {
170
+ color : # 666 ;
171
+ font-style : italic;
172
+ font-size : 0.9em ;
173
+ margin-top : 15px ;
174
+ }
You can’t perform that action at this time.
0 commit comments