Skip to content

Commit 6e395ff

Browse files
Add participants list display and styling to activity cards
1 parent 4fc1154 commit 6e395ff

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

src/static/app.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,22 @@ document.addEventListener("DOMContentLoaded", () => {
2020

2121
const spotsLeft = details.max_participants - details.participants.length;
2222

23+
// Build participants list HTML
24+
const participantsList = details.participants.length
25+
? `<ul class="activity-card-participants-list">
26+
${details.participants.map(email => `<li>${email}</li>`).join("")}
27+
</ul>`
28+
: `<div class="activity-card-participants-list" style="color:#888;">No participants yet.</div>`;
29+
2330
activityCard.innerHTML = `
2431
<h4>${name}</h4>
2532
<p>${details.description}</p>
2633
<p><strong>Schedule:</strong> ${details.schedule}</p>
2734
<p><strong>Availability:</strong> ${spotsLeft} spots left</p>
35+
<div class="activity-card-participants">
36+
<div class="activity-card-participants-title">Participants</div>
37+
${participantsList}
38+
</div>
2839
`;
2940

3041
activitiesList.appendChild(activityCard);

src/static/styles.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,33 @@ section h3 {
7474
margin-bottom: 8px;
7575
}
7676

77+
.activity-card-participants {
78+
margin-top: 14px;
79+
padding: 10px 14px;
80+
background-color: #e3e9fc;
81+
border-radius: 4px;
82+
border: 1px solid #c5cae9;
83+
}
84+
85+
.activity-card-participants-title {
86+
font-size: 15px;
87+
font-weight: bold;
88+
color: #3949ab;
89+
margin-bottom: 8px;
90+
}
91+
92+
.activity-card-participants-list {
93+
list-style-type: disc;
94+
margin-left: 20px;
95+
color: #283593;
96+
font-size: 15px;
97+
padding-left: 0;
98+
}
99+
100+
.activity-card-participants-list li {
101+
margin-bottom: 4px;
102+
}
103+
77104
.form-group {
78105
margin-bottom: 15px;
79106
}

0 commit comments

Comments
 (0)