forked from paperswithcode/ai-deadlines
-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.html
182 lines (158 loc) · 7.87 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
---
---
<html>
<head>
{% include head.html %}
</head>
<body>
{% include header.html %}
{% capture fp_title %}
{% t titles.default %}
{% endcapture %}
{% capture fp_hook %}
{% tf frontpage/hook.md %}
{% endcapture %}
{% capture fp_description %}
{% tf frontpage/description.md %}
{% endcapture %}
{% include masthead.html url=page.url title=fp_title hook=fp_hook description=fp_description %}
<div class="container">
<div id="confs">
<div id="coming_confs">
{% assign confs = site.data.conferences | sort: "cfp" | reverse %}
{% for conf in confs %}
{% assign subs = conf.sub | split: "," %}
<div id="{{conf.conference | slugify: "latin"}}-{{conf.year}}" class="ConfItem {% for sub in subs %} {{sub | strip}}-conf {% endfor %}">
{% include index_conf_title_row.html %}
{% include_cached index_conf_date_place.html place=conf.place extra_places=conf.extra_places note=conf.note cfp=conf.cfp start=conf.start end=conf.end %}
{% include index_conf_subs.html subs=subs %}
<hr />
</div>
{% endfor %}
</div>
<div id="past_cfps">
<h1 id="past-cfps-title">{% t titles.past_cfps %}</h1>
</div>
<div id="past_confs">
<h1 id="past-events-title">{% t titles.past_events %}</h1>
</div>
<div id="conf_archive">
<h1 id="archive-link"><a href="{% tl archive %}">{% t titles.visit_archive %}</a></h1>
</div>
</div>
<footer>
{% include_cached footer.html %}
</footer>
<br><br>
</div>
<script type="text/javascript" charset="utf-8">
$(function() {
luxon.Settings.defaultLocale = "{{ site.lang }}";
var DateTime = luxon.DateTime;
var today = DateTime.now();
// Make sure this is >= no. of subs
// Currently not used
var colors = ['#341f97', '#ee5253', '#2e86de',
'#ff9f43', '#10ac84', '#222f3e']
{% include load_data.js %}
{% include utils.js %}
{% include multiselect_handler.js %}
// Set time zone to local timezone on web copy
$('.local-timezone').text(today.toFormat('z'));
{% for conf in site.data.conferences %}
{% if conf.cfp_ext %}
{% assign cfp = conf.cfp_ext %}
{% else %}
{% assign cfp = conf.cfp %}
{% endif %}
{% assign subs = conf.sub | split: "," %}
{% for sub in subs %}
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .{{sub | strip}}-tag').html("{% t 'subs.{{sub | strip}}' %}".toLocaleLowerCase("{{ site.lang }}"));
{% endfor %}
{% if cfp == "TBA" or cfp == "Cancelled" or cfp == "None" %}
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .timer').html("{{cfp}}");
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .deadline-time').html("{{cfp}}");
{% if cfp == "TBA" %}
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}}').attr("cfpDiff", Infinity);
{% else %}
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}}').attr("cfpDiff", -Infinity);
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}}').appendTo($("#past_cfps"));
{% endif %}
{% else %}
// Use specified timezone for deadlines if available else use AoE timezone
{% if conf.timezone %}
var cfpDate = DateTime.fromSQL("{{cfp}}", {zone: "{{conf.timezone}}"});
var confDate = DateTime.fromSQL("{{conf.start}}", {zone: "{{conf.timezone}}"});
{% else %}
var cfpDate = DateTime.fromSQL("{{cfp}}", {zone: "UTC-12"});
var confDate = DateTime.fromSQL("{{conf.start}}", {zone: "UTC-12"});
{% endif %}
// check if timezone is valid otherwise replace by system timezone
if (cfpDate.invalid || confDate.invalid) {
var cfpDate = DateTime.fromSQL("{{cfp}}");
var confDate = DateTime.fromSQL("{{conf.start}}");
console.log("Invalid timezone in {{conf.conference | slugify: "latin"}}-{{conf.year}}. Using system timezone instead.");
}
// render countdown timer
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .timer').countdown(cfpDate.toJSDate(), function (event) {
$(this).html(event.strftime('%D days %Hh %Mm %Ss'));
});
// render countdown timer small
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .timer-small').countdown(cfpDate.toJSDate(), function (event) {
$(this).html(event.strftime('%Dd %H:%M:%S'));
});
// deadline in local timezone
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .deadline-time').html(cfpDate.setZone('system').toLocaleString(DateTime.DATE_HUGE));
// add calendar button
try {
var myCalendar = createCalendarFromObject({
id: '{{conf.conference | slugify: "latin"}}-{{conf.year}}',
title: '{{conf.conference}} {{conf.year}} deadline',
start_date: cfpDate.toJSDate(),
duration: 60,
place: '{{conf.place}}',
link: '{{conf.link}}'
});
document.querySelector('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .calendar').appendChild(myCalendar);
} catch(err) {
document.querySelector('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .calendar').appendChild("<p>Calendar not available.</p>");
console.log("Error in cfp date.");
}
// check if date has passed, add 'past' class to it
cfpDiff = cfpDate.diffNow("seconds");
confDiff = confDate.diffNow("seconds");
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}}').attr("cfpDiff", cfpDiff.toMillis());
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}}').attr("confDiff", confDiff.toMillis());
if (cfpDiff < 0) {
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}}').addClass('pastcfp');
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}}').appendTo($("#past_cfps"));
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .timer').replaceWith($('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .deadline'));
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .timer-small').replaceWith($('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .deadline'));
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .calendar').remove();
}
if (confDiff < 0) {
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}}').addClass('pastconf');
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}}').appendTo($("#past_confs"));
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .timer').replaceWith($('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .deadline'));
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .timer-small').replaceWith($('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .deadline'));
$('#{{conf.conference | slugify: "latin"}}-{{conf.year}} .calendar').remove();
}
{% endif %}
{% endfor %}
// Sort coming_confs and past_confs
$("#coming_confs .ConfItem").sort(function (a, b) {
return $(a).attr('cfpDiff') - $(b).attr('cfpDiff');
}).appendTo($("#coming_confs"));
{% include handle_url_retrieval.js %}
// Event handler on sub badge click
$('.conf-sub').click(function (e) {
var csub = $(this).data('sub');
subs = [csub];
$("#subject-select").multiselect('deselect', all_subs);
$("#subject-select").multiselect('select', subs);
update_filtering({ subs: subs, all_subs: all_subs});
});
});
</script>
</body>
</html>