Skip to content

Commit aaab40b

Browse files
authored
chore: add devsprint on schedule (#240)
* add devsprint on schedule * job_board_minor_ui_change
1 parent 4e4e10b commit aaab40b

File tree

5 files changed

+130
-17
lines changed

5 files changed

+130
-17
lines changed

.eleventy.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,63 @@ module.exports = async function (eleventyConfig) {
177177
});
178178
});
179179

180+
eleventyConfig.addFilter("extractDevSprintSessions", function(rooms) {
181+
let sessions = [];
182+
183+
if (!rooms) return sessions;
184+
185+
for (const [track, items] of Object.entries(rooms)) {
186+
for (const session of items) {
187+
sessions.push({
188+
url: session.url,
189+
title: session.title,
190+
abstract: session.abstract,
191+
});
192+
}
193+
}
194+
195+
return sessions;
196+
});
197+
198+
eleventyConfig.addFilter("chunkDevSprintSessions", function (rooms) {
199+
const allSessions = [];
200+
201+
// Flatten all sessions
202+
for (const [roomName, sessions] of Object.entries(rooms)) {
203+
sessions.forEach(session => {
204+
allSessions.push({
205+
url: session.url,
206+
title: session.title,
207+
abstract: session.abstract
208+
});
209+
});
210+
}
211+
212+
// Helper to chunk into balanced rows
213+
function chunkBalanced(arr) {
214+
const rows = [];
215+
const n = arr.length;
216+
217+
if (n <= 3) {
218+
rows.push(arr);
219+
} else if (n === 4) {
220+
rows.push(arr.slice(0, 2), arr.slice(2, 4));
221+
} else if (n === 5) {
222+
rows.push(arr.slice(0, 3), arr.slice(3, 5));
223+
} else if (n === 7) {
224+
rows.push(arr.slice(0, 2), arr.slice(2, 5), arr.slice(5, 7));
225+
} else {
226+
for (let i = 0; i < n; i += 3) {
227+
rows.push(arr.slice(i, i + 3));
228+
}
229+
}
230+
231+
return rows;
232+
}
233+
234+
return chunkBalanced(allSessions);
235+
});
236+
180237
// rebuild on CSS changes
181238
eleventyConfig.addWatchTarget("./src/_includes/css/");
182239

src/attend/jobs.njk

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,17 @@ layout: base.njk
4343
{{ job_post.company }}
4444
</a>
4545
</span>
46-
<p class="pt-8 flex items-center gap-x-6 mb-0">
47-
<span><i class="fa-solid pr-2 fa-briefcase text-xl text-[#475569]"></i>{{ job_post.job_type }}</span>
48-
<span><i class="fa-solid pr-2 fa-location-dot text-xl text-[#475569]"></i>{{ job_post.location }}</span>
46+
<p class="pt-8 flex flex-col md:flex-row md:items-start gap-x-6 mb-0">
47+
<span class="inline-flex items-center whitespace-nowrap">
48+
<i class="fa-solid pr-2 fa-briefcase text-xl text-[#475569]"></i>
49+
{{ job_post.job_type }}
50+
</span>
51+
<span class="flex mt-2 md:mt-0">
52+
<i class="fa-solid fa-location-dot text-xl text-[#475569]"></i>
53+
<span class="pl-2">
54+
{{ job_post.location }}
55+
</span>
56+
</span>
4957
</p>
5058
</div>
5159
<div class="pt-4 text-gray-700">
@@ -76,9 +84,17 @@ layout: base.njk
7684
{{ job_post.company }}
7785
</a>
7886
</span>
79-
<p class="pt-8 flex items-center gap-x-6 mb-0">
80-
<span><i class="fa-solid pr-2 fa-briefcase text-xl text-[#475569]"></i>{{ job_post.job_type }}</span>
81-
<span><i class="fa-solid pr-2 fa-location-dot text-xl text-[#475569]"></i>{{ job_post.location }}</span>
87+
<p class="pt-8 flex flex-col md:flex-row md:items-start gap-x-6 mb-0">
88+
<span class="inline-flex items-center whitespace-nowrap">
89+
<i class="fa-solid pr-2 fa-briefcase text-xl text-[#475569]"></i>
90+
{{ job_post.job_type }}
91+
</span>
92+
<span class="flex mt-2 md:mt-0">
93+
<i class="fa-solid fa-location-dot text-xl text-[#475569]"></i>
94+
<span class="pl-2">
95+
{{ job_post.location }}
96+
</span>
97+
</span>
8298
</p>
8399
</div>
84100
<div class="pt-4 text-gray-700">
@@ -109,9 +125,17 @@ layout: base.njk
109125
{{ job_post.company }}
110126
</a>
111127
</span>
112-
<p class="pt-8 flex items-center gap-x-6 mb-0">
113-
<span><i class="fa-solid pr-2 fa-briefcase text-xl text-[#475569]"></i>{{ job_post.job_type }}</span>
114-
<span><i class="fa-solid pr-2 fa-location-dot text-xl text-[#475569]"></i>{{ job_post.location }}</span>
128+
<p class="pt-8 flex flex-col md:flex-row md:items-start gap-x-6 mb-0">
129+
<span class="inline-flex items-center whitespace-nowrap">
130+
<i class="fa-solid pr-2 fa-briefcase text-xl text-[#475569]"></i>
131+
{{ job_post.job_type }}
132+
</span>
133+
<span class="flex mt-2 md:mt-0">
134+
<i class="fa-solid fa-location-dot text-xl text-[#475569]"></i>
135+
<span class="pl-2">
136+
{{ job_post.location }}
137+
</span>
138+
</span>
115139
</p>
116140
</div>
117141
<div class="pt-4 text-gray-700">

src/css/main.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,3 +623,12 @@ body:not(.is-home-page) main {
623623
.window-container:hover .face.left {
624624
background: color-mix(in srgb, var(--left-bg), #D7FF7B 100%);
625625
}
626+
627+
628+
.line-clamp-4 {
629+
display: -webkit-box;
630+
-webkit-line-clamp: 4;
631+
-webkit-box-orient: vertical;
632+
overflow: hidden;
633+
text-overflow: ellipsis;
634+
}

src/program/schedule.njk

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,36 @@ layout: base.njk
210210
</div>
211211

212212
{% elif day.index == 4 %}
213-
<p class="text-2xl font-bold text-gray-700">Dev Sprint Schedule - Coming Soon!</p>
213+
<div class="dev-sprint-day">
214+
{% set dev_sprint_sessions = day.rooms|chunkDevSprintSessions %}
215+
{% for row in dev_sprint_sessions %}
216+
<div class="grid grid-cols-1 md:grid-cols-{{ row|length }}">
217+
{% for event in row %}
218+
<div class="flex flex-wrap gap-0 py-0">
219+
{% if event.url %}
220+
<a href="{{ event.url }}"
221+
class="w-full p-8 bg-white border border-black transform hover:-translate-y-1 transition duration-500 ease-in-out hover:bg-pycon-lime cursor-pointer no-underline text-inherit md:h-60 lg:h-60 overflow-hidden">
222+
{% else %}
223+
<div class="w-full p-8 h-60 overflow-hidden border border-black">
224+
{% endif %}
225+
226+
<p class="mb-4 text-lg font-bold">
227+
{{ event.title }}
228+
</p>
229+
<p class="mb-1 text-md text-justify line-clamp-4">
230+
{{ event.abstract }}
231+
</p>
232+
233+
{% if event.url %}
234+
</a>
235+
{% else %}
236+
</div>
237+
{% endif %}
238+
</div>
239+
{% endfor %}
240+
</div>
241+
{% endfor %}
242+
</div>
214243

215244
{% else %}
216245
<div>

src/static/js/schedule.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ document.addEventListener('DOMContentLoaded', () => {
2929
hideAllSchedules();
3030

3131
// Always show FIRST card + its content
32-
const firstCard = cards[1];
32+
const firstCard = cards[2];
3333
const firstContentId = firstCard.getAttribute('data-schedule');
3434

3535
highlight(firstCard);
@@ -61,12 +61,6 @@ document.addEventListener('DOMContentLoaded', () => {
6161
card.addEventListener('click', () => {
6262
const scheduleId = card.getAttribute('data-schedule');
6363

64-
// Redirect-only card
65-
if (scheduleId === '4') {
66-
window.location.href = `${baseUrl}program/dev-sprint`;
67-
return;
68-
}
69-
7064
resetCardBackgrounds();
7165
hideAllSchedules();
7266

0 commit comments

Comments
 (0)