Skip to content

Commit a508fed

Browse files
committed
fix: countdowns not loading
1 parent f648025 commit a508fed

File tree

11 files changed

+193
-98
lines changed

11 files changed

+193
-98
lines changed

_data/archive.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
---
22

3+
- conference: EuroPython
4+
year: 2025
5+
link: https://ep2025.europython.eu/
6+
cfp: '2025-01-27 23:59:00'
7+
timezone: UTC
8+
place: Prague, Czechia
9+
start: 2025-07-14
10+
end: 2025-07-20
11+
twitter: EuroPython
12+
mastodon: https://fosstodon.org/@europython
13+
sub: PY
14+
location:
15+
- title: EuroPython 2025
16+
latitude: 50.0874654
17+
longitude: 14.4212535
18+
319
- conference: PyHEP.dev
420
alt_name: PyHEP
521
year: 2025

_data/conferences.yml

Lines changed: 45 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@
2727
latitude: 51.4383999131
2828
longitude: 5.46712979814
2929

30+
- conference: Python Sul
31+
alt_name: Python Sul (Brazil)
32+
year: 2025
33+
link: https://sul.python.org.br/
34+
cfp_link: https://talks.python.org.br/pysul2025/cfp
35+
cfp: '2025-10-05 23:59:00'
36+
place: Porto Alegre, Brazil
37+
start: 2025-11-21
38+
end: 2025-11-23
39+
sub: PY
40+
location:
41+
- title: Python Sul 2025
42+
latitude: -30.0324999
43+
longitude: -51.2303767
44+
3045
- conference: PyCon Wroclaw
3146
year: 2025
3247
link: https://www.pyconwroclaw.com/
@@ -103,6 +118,24 @@
103118
latitude: 13.45535
104119
longitude: -16.575646
105120

121+
- conference: PyCon Sweden
122+
alt_name: PyCon SE
123+
year: 2025
124+
link: https://pycon.se/
125+
cfp_link: https://pretalx.com/pycon-sweden-2025/
126+
cfp: '2025-08-31 23:59:00'
127+
timezone: Europe/Stockholm
128+
place: Stockholm, Sweden
129+
start: 2025-10-30
130+
end: 2025-10-31
131+
sponsor: https://pycon.se/#sponsorship
132+
mastodon: https://fosstodon.org/@pyconsweden
133+
sub: PY
134+
location:
135+
- title: PyCon Sweden 2025
136+
latitude: 59.3251172
137+
longitude: 18.0710935
138+
106139
- conference: PyData Vermont
107140
year: 2025
108141
link: https://pydata.org/vermont2025/
@@ -119,6 +152,18 @@
119152
latitude: 43.3248924
120153
longitude: -79.7966835
121154

155+
- conference: PyLadiesCon
156+
year: 2025
157+
link: https://2025.conference.pyladies.com/en/
158+
cfp_link: https://pretalx.com/pyladiescon-2025/cfp
159+
cfp: '2025-08-23 12:59:00'
160+
timezone: UTC
161+
place: Online
162+
start: 2025-12-05
163+
end: 2025-12-07
164+
sponsor: https://2025.conference.pyladies.com/en/sponsors/
165+
sub: PY
166+
122167
- conference: Kiwi PyCon
123168
year: 2025
124169
link: https://kiwipycon.nz/
@@ -819,22 +864,6 @@
819864
latitude: 50.8214626
820865
longitude: -0.1400561
821866

822-
- conference: EuroPython
823-
year: 2025
824-
link: https://ep2025.europython.eu/
825-
cfp: '2025-01-27 23:59:00'
826-
timezone: UTC
827-
place: Prague, Czechia
828-
start: 2025-07-14
829-
end: 2025-07-20
830-
twitter: EuroPython
831-
mastodon: https://fosstodon.org/@europython
832-
sub: PY
833-
location:
834-
- title: EuroPython 2025
835-
latitude: 50.0874654
836-
longitude: 14.4212535
837-
838867
- conference: PyCon Estonia
839868
alt_name: PyCon EE
840869
year: 2025
@@ -940,47 +969,6 @@
940969
latitude: 49.27213705
941970
longitude: -123.13439461006233
942971

943-
- conference: PyLadiesCon
944-
year: 2025
945-
link: https://2025.conference.pyladies.com/en/
946-
cfp: TBA
947-
place: Online
948-
start: 2025-12-05
949-
end: 2025-12-07
950-
sponsor: https://2025.conference.pyladies.com/en/sponsors/
951-
sub: PY
952-
953-
- conference: Python Sul
954-
alt_name: Python Sul (Brazil)
955-
year: 2025
956-
link: https://sul.python.org.br/
957-
cfp: TBA
958-
place: Porto Alegre, Brazil
959-
start: 2025-11-21
960-
end: 2025-11-23
961-
sub: PY
962-
location:
963-
- title: Python Sul 2025
964-
latitude: -30.0324999
965-
longitude: -51.2303767
966-
967-
- conference: PyCon Sweden
968-
alt_name: PyCon SE
969-
year: 2025
970-
link: https://pycon.se/
971-
cfp: TBA
972-
timezone: Europe/Stockholm
973-
place: Stockholm, Sweden
974-
start: 2025-10-30
975-
end: 2025-10-31
976-
sponsor: https://pycon.se/#sponsorship
977-
mastodon: https://fosstodon.org/@pyconsweden
978-
sub: PY
979-
location:
980-
- title: PyCon Sweden 2025
981-
latitude: 59.3251172
982-
longitude: 18.0710935
983-
984972
- conference: Pythoncamp Rügen
985973
year: 2025
986974
link: https://barcamps.eu/pyr2025/

_includes/calendar.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ function load_conference_list() {
192192
}
193193

194194
function update_filtering(data) {
195+
// Defensive check for data parameter
196+
if (!data || typeof data !== 'object' || !data.subs || !Array.isArray(data.subs)) {
197+
console.error('calendar update_filtering called with invalid data:', data);
198+
return;
199+
}
200+
195201
store.set('{{site.domain}}-subs', {subs: data.subs, timestamp: new Date().getTime()});
196202

197203
conf_list = conf_list_all.filter(v => {

_includes/handle_url_retrieval.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ subs = url.searchParams.get('sub');
44
if (subs == undefined) {
55
data = store.get('{{site.domain}}-subs');
66
if (!data || typeof data !== 'object' || isDataExpired(data)) {
7-
data = { subs: data.all_subs };
7+
data = { subs: all_subs };
88
}
99
subs = data.subs;
1010
} else {

_includes/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<link rel="stylesheet" type="text/css" href="{{ "/static/css/deadlines.css" | prepend:site.baseurl_root }}?t={{site.time | date: '%s'}}" media="screen,projection">
3333
<link rel="stylesheet" type="text/css" href="{{ "/static/css/calendar.css" | prepend:site.baseurl_root }}?t={{site.time | date: '%s'}}" media="screen,projection">
3434
<link rel="stylesheet" type="text/css" href="{{ "/static/css/search.css" | prepend:site.baseurl_root }}?t={{site.time | date: '%s'}}" media="screen,projection">
35-
<link rel="stylesheet" type="text/css" href="{{ "/static/css/search.css" | prepend:site.baseurl_root }}?t={{site.time | date: '%s'}}" media="screen,projection">
35+
<link rel="stylesheet" type="text/css" href="{{ "/static/css/mobile-fixes.css" | prepend:site.baseurl_root }}?t={{site.time | date: '%s'}}" media="screen,projection">
3636
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/fontawesome.min.css" media="screen,projection">
3737
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/brands.min.css" media="screen,projection">
3838

_includes/utils.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
function update_filtering(data) {
2+
// Defensive check for data parameter
3+
if (!data || typeof data !== 'object') {
4+
console.error('update_filtering called with invalid data:', data);
5+
return;
6+
}
7+
8+
// Ensure required properties exist
9+
if (!data.subs || !Array.isArray(data.subs)) {
10+
console.error('update_filtering: data.subs is not an array:', data.subs);
11+
return;
12+
}
13+
14+
if (!data.all_subs || !Array.isArray(data.all_subs)) {
15+
console.error('update_filtering: data.all_subs is not an array:', data.all_subs);
16+
return;
17+
}
18+
219
var page_url = window.location.pathname;
320
store.set('{{site.domain}}-subs', { subs: data.subs, timestamp: new Date().getTime() });
421

_layouts/conference.html

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,18 @@
2626
var feedContainer = document.getElementById("mastodon-feed");
2727
var postLimit = 2; // Number of posts to display
2828

29-
for (var i = 0; i < postLimit && i < items.length; i++) {
30-
var item = items[i];
31-
var post = item.querySelector("description").textContent;
32-
var link = item.querySelector("link").textContent;
33-
var pubDate = item.querySelector("pubDate").textContent;
29+
if (feedContainer) {
30+
for (var i = 0; i < postLimit && i < items.length; i++) {
31+
var item = items[i];
32+
var post = item.querySelector("description").textContent;
33+
var link = item.querySelector("link").textContent;
34+
var pubDate = item.querySelector("pubDate").textContent;
3435

35-
var feedItem = document.createElement("div");
36-
feedItem.setAttribute("class", "timeline-item")
37-
feedItem.innerHTML = '<div class="timeline-content">' + post + '</div><a href="' + link + '">' + pubDate + ' by {{ page.conference }}</a>';
38-
feedContainer.appendChild(feedItem);
36+
var feedItem = document.createElement("div");
37+
feedItem.setAttribute("class", "timeline-item")
38+
feedItem.innerHTML = '<div class="timeline-content">' + post + '</div><a href="' + link + '">' + pubDate + ' by {{ page.conference }}</a>';
39+
feedContainer.appendChild(feedItem);
40+
}
3941
}
4042
})
4143
.catch(function (error) {
@@ -269,7 +271,10 @@ <h3 id="conf-subtitle">a.k.a. {{page.alt_name}} {{page.year}}</h3>
269271
place: '{{page.place}}',
270272
link: '{{page.link}}',
271273
});
272-
document.querySelector('#conference-deadline').appendChild(conferenceDeadlineCalendar);
274+
var deadlineContainer = document.querySelector('#conference-deadline');
275+
if (deadlineContainer) {
276+
deadlineContainer.appendChild(conferenceDeadlineCalendar);
277+
}
273278

274279

275280
var conferenceCalendar = createCalendarFromObject({
@@ -280,7 +285,10 @@ <h3 id="conf-subtitle">a.k.a. {{page.alt_name}} {{page.year}}</h3>
280285
place: '{{page.place}}',
281286
link: '{{page.link}}',
282287
});
283-
document.querySelector('#conference-calendar').appendChild(conferenceCalendar);
288+
var calendarContainer = document.querySelector('#conference-calendar');
289+
if (calendarContainer) {
290+
calendarContainer.appendChild(conferenceCalendar);
291+
}
284292

285293
// render countdown timer
286294
$('#cfp-timer').countdown(confDeadline.toJSDate(), function (event) {

_layouts/summary.html

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,18 @@
2121
var feedContainer = document.getElementById("mastodon-feed");
2222
var postLimit = 2; // Number of posts to display
2323

24-
for (var i = 0; i < postLimit && i < items.length; i++) {
25-
var item = items[i];
26-
var post = item.querySelector("description").textContent;
27-
var link = item.querySelector("link").textContent;
28-
var pubDate = item.querySelector("pubDate").textContent;
24+
if (feedContainer) {
25+
for (var i = 0; i < postLimit && i < items.length; i++) {
26+
var item = items[i];
27+
var post = item.querySelector("description").textContent;
28+
var link = item.querySelector("link").textContent;
29+
var pubDate = item.querySelector("pubDate").textContent;
2930

30-
var feedItem = document.createElement("div");
31-
feedItem.setAttribute("class", "timeline-item")
32-
feedItem.innerHTML = '<div class="timeline-content">' + post + '</div><a href="' + link + '">' + pubDate + ' by {{page.conference}}</a>';
33-
feedContainer.appendChild(feedItem);
31+
var feedItem = document.createElement("div");
32+
feedItem.setAttribute("class", "timeline-item")
33+
feedItem.innerHTML = '<div class="timeline-content">' + post + '</div><a href="' + link + '">' + pubDate + ' by {{page.conference}}</a>';
34+
feedContainer.appendChild(feedItem);
35+
}
3436
}
3537
})
3638
.catch(function (error) {
@@ -336,9 +338,17 @@ <h1>
336338
place: '{{conf.place}}',
337339
link: '{{conf.link}}'
338340
});
339-
document.querySelector('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .calendar').appendChild(myCalendar);
341+
var calendarContainer = document.querySelector('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .calendar');
342+
if (calendarContainer) {
343+
calendarContainer.appendChild(myCalendar);
344+
}
340345
} catch (err) {
341-
document.querySelector('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .calendar').appendChild("<p>Calendar not available.</p>");
346+
var calendarContainer = document.querySelector('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .calendar');
347+
if (calendarContainer) {
348+
var errorMsg = document.createElement('p');
349+
errorMsg.textContent = 'Calendar not available.';
350+
calendarContainer.appendChild(errorMsg);
351+
}
342352
console.log("Error in cfp date.");
343353
}
344354

index.html

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ <h1 id="archive-link"><a href="{% tl archive %}">{% t titles.visit_archive %}</a
5151
{% include_cached footer.html %}
5252
</footer>
5353
<script type="text/javascript" charset="utf-8">
54+
// Global conference data for lazy loading
55+
window.conferenceData = window.conferenceData || {};
56+
5457
$(function() {
5558
luxon.Settings.defaultLocale = "{{ site.lang }}";
5659
var DateTime = luxon.DateTime;
@@ -100,20 +103,34 @@ <h1 id="archive-link"><a href="{% tl archive %}">{% t titles.visit_archive %}</a
100103
{% endif %}
101104

102105
// check if timezone is valid otherwise replace by system timezone
103-
if (cfpDate.invalid || confDate.invalid) {
106+
if (cfpDate.invalid === true || confDate.invalid === true) {
104107
var cfpDate = DateTime.fromSQL("{{cfp}}");
105108
var confDate = DateTime.fromSQL("{{conf.start}}");
106109
console.log("Invalid timezone in {{conf.conference | slugify: "latin"}}-{{conf.year}}. Using system timezone instead.");
107110
}
108111

112+
// Store conference data globally for lazy loading
113+
window.conferenceData['{{conf.conference | slugify: "latin"}}-{{conf.year}}'] = {
114+
cfpDate: cfpDate.toJSDate(),
115+
confDate: confDate.toJSDate()
116+
};
117+
109118
// render countdown timer
110119
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .timer').countdown(cfpDate.toJSDate(), function (event) {
111-
$(this).html(event.strftime('%D days %Hh %Mm %Ss'));
120+
if (event.elapsed) {
121+
$(this).html('Deadline passed');
122+
} else {
123+
$(this).html(event.strftime('%D days %Hh %Mm %Ss'));
124+
}
112125
});
113126

114127
// render countdown timer small
115128
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .timer-small').countdown(cfpDate.toJSDate(), function (event) {
116-
$(this).html(event.strftime('%Dd %H:%M:%S'));
129+
if (event.elapsed) {
130+
$(this).html('Passed');
131+
} else {
132+
$(this).html(event.strftime('%Dd %H:%M:%S'));
133+
}
117134
});
118135

119136
// deadline in local timezone
@@ -129,9 +146,17 @@ <h1 id="archive-link"><a href="{% tl archive %}">{% t titles.visit_archive %}</a
129146
place: '{{conf.place}}',
130147
link: '{{conf.link}}'
131148
});
132-
document.querySelector('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .calendar').appendChild(myCalendar);
149+
var calendarContainer = document.querySelector('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .calendar');
150+
if (calendarContainer) {
151+
calendarContainer.appendChild(myCalendar);
152+
}
133153
} catch(err) {
134-
document.querySelector('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .calendar').appendChild("<p>Calendar not available.</p>");
154+
var calendarContainer = document.querySelector('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .calendar');
155+
if (calendarContainer) {
156+
var errorMsg = document.createElement('p');
157+
errorMsg.textContent = 'Calendar not available.';
158+
calendarContainer.appendChild(errorMsg);
159+
}
135160
console.log("Error in cfp date.");
136161
}
137162

0 commit comments

Comments
 (0)