forked from paperswithcode/ai-deadlines
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8af4f24
commit 565bfae
Showing
2 changed files
with
330 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,287 @@ | ||
--- | ||
description: Summary of the conference and its instances throughout the years. | ||
--- | ||
|
||
<html> | ||
|
||
<head> | ||
{% include head.html %} | ||
{% if page.mastodon %} | ||
<link rel="stylesheet" type="text/css" href="{{ "/static/css/mastodon.css" | prepend:site.baseurl }}"> | ||
<script> | ||
document.addEventListener("DOMContentLoaded", function () { | ||
fetch("{{page.mastodon}}.rss") | ||
.then(function (response) { | ||
return response.text(); | ||
}) | ||
.then(function (xmlText) { | ||
var parser = new DOMParser(); | ||
var xml = parser.parseFromString(xmlText, "text/xml"); | ||
var items = xml.querySelectorAll("item"); | ||
var feedContainer = document.getElementById("mastodon-feed"); | ||
var postLimit = 2; // Number of posts to display | ||
|
||
for (var i = 0; i < postLimit && i < items.length; i++) { | ||
var item = items[i]; | ||
var post = item.querySelector("description").textContent; | ||
var link = item.querySelector("link").textContent; | ||
var pubDate = item.querySelector("pubDate").textContent; | ||
|
||
var feedItem = document.createElement("div"); | ||
feedItem.setAttribute("class", "timeline-item") | ||
feedItem.innerHTML = '<div class="timeline-content">' + post + '</div><a href="' + link + '">' + pubDate + ' by {{page.title}}</a>'; | ||
feedContainer.appendChild(feedItem); | ||
} | ||
}) | ||
.catch(function (error) { | ||
console.log("Error fetching Mastodon RSS feed:", error); | ||
}); | ||
}); | ||
</script> | ||
{% elsif page.twitter %} | ||
<style> | ||
#twitter-widget { | ||
width: 100%; | ||
} | ||
|
||
.twitter-timeline { | ||
width: 100% !important; | ||
} | ||
</style> | ||
{% endif %} | ||
</head> | ||
|
||
<body> | ||
{% include header.html %} | ||
<div class="container"> | ||
<div class="page-header" id="conf-title"> | ||
<div class="row"> | ||
<div class="col-sm-12"> | ||
<h1> | ||
<span id="conf-title-href" href="/summary/{{page.title | slugify}}/">{{page.title}}</span> | ||
<span id="twitter-box"><a href="https://twitter.com/share" class="twitter-share-button" | ||
data-text="Conference instances for the #{{ page.title }} conference!" data-show-count="false" | ||
style="font-size:13px;">Tweet</a> | ||
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> | ||
</span> | ||
</h1> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-sm-12" id="conf-subs"> | ||
<span id="conf-subs" title="Conference subjects"> | ||
{% assign subs = page.sub | split: "," %} | ||
{% for sub in subs %} | ||
<span class="{{sub}}-tag badge badge-light conf-sub conf-{{sub}}"> | ||
{% for tp in site.data.types %} | ||
{% if sub == tp.sub %} | ||
{{tp.name}} | ||
{% endif %} | ||
{% endfor %} | ||
</span> | ||
{% endfor %} | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
<div id="page-content"> | ||
<div class="col-12 col-md-6"> | ||
{% if page.mastodon %} | ||
<!-- Mastodon timeline --> | ||
<div class="meta">Mastodon Posts by {{page.title}}:</div> | ||
<div id="mastodon-feed"></div> | ||
<a href="{{ page.mastodon }}">See all Mastodon posts for {{ page.title }}</a> | ||
{% elsif page.twitter %} | ||
<!-- Twitter timeline --> | ||
<div id="twitter-widget"> | ||
<a class="twitter-timeline" href="https://twitter.com/{{page.twitter}}" data-tweet-limit=2>Tweets by | ||
{{page.twitter}}</a> | ||
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> | ||
</div> | ||
{% endif %} | ||
</div> | ||
</div> | ||
<div class="row"> | ||
{% google_map zoom="6" width="100%" title="{{page.title}}" %} | ||
</div> | ||
<div> | ||
{% for conf in site.data.conferences + site.data.archive %} | ||
{% if conf.title == page.title %} | ||
{% assign subs = conf.sub | split: "," %} | ||
<div id="{{conf.title | slugify}}-{{conf.year}}" | ||
class="ConfItem {% for sub in subs %} {{sub | strip}}-conf {% endfor %}"> | ||
<div class="row conf-row"> | ||
<div class="col-6"> | ||
<span class="conf-title"> | ||
<a title="Deadline Details" | ||
href="{{site.baseurl}}/conference/{{conf.title | slugify}}-{{conf.year}}/">{{conf.title}} {{conf.year}}</a> | ||
</span> | ||
<span class="conf-title-small"> | ||
<a title="Deadline Details" | ||
href="{{site.baseurl}}/conference/{{conf.title | slugify}}-{{conf.year}}/">{{conf.title}} '{{conf.year | | ||
slice: -2, 3}}</a> | ||
</span> | ||
<span class="conf-title-icon"> | ||
<a title="Conference Website" href="{{conf.link}}" target="_blank"><img src="/static/img/203-earth.svg" | ||
class="badge-link" alt="Link to Conference Website" width="16" height="16" /></a> | ||
​ | ||
</span> | ||
{% if conf.cfp_link %} | ||
<span class="conf-title-icon"> | ||
<a title="Call for Participation for {{conf.title}}" href="{{conf.cfp_link}}" target="_blank"><img | ||
src="/static/img/035-file-text.svg" class="badge-link" | ||
alt="Link to Call for Participation for {{conf.title}}" width="16" height="16" /></a> | ||
​ | ||
</span> | ||
{% endif %} | ||
{% if conf.finaid %} | ||
<span class="conf-title-icon"> | ||
<a title="Financial Aid from {{conf.title}}" href="{{conf.finaid}}" target="_blank"><img | ||
src="/static/img/066-lifebuoy.svg" class="badge-link" alt="Link to Sponsorship page of {{conf.title}}" | ||
width="16" height="16" /></a> | ||
​ | ||
</span> | ||
{% endif %} | ||
{% if conf.sponsor %} | ||
<span class="conf-title-icon"> | ||
<a title="Sponsorship Opportunity for {{conf.title}}" href="{{conf.sponsor}}" target="_blank"><img | ||
src="/static/img/060-coin-dollar.svg" class="badge-link" alt="Link to Sponsorship page of {{conf.title}}" | ||
width="16" height="16" /></a> | ||
​ | ||
</span> | ||
{% endif %} | ||
{% if conf.mastodon %} | ||
<span class="conf-title-icon"> | ||
<a title="Mastodon for {{conf.title}}" href="{{conf.mastodon}}" target="_blank"><img | ||
src="/static/img/407-mastodon.svg" class="badge-link" alt="Link to Conference Mastodon" width="16" | ||
height="16" /></a> | ||
​ | ||
</span> | ||
{% elsif conf.twitter %} | ||
<span class="conf-title-icon"> | ||
<a title="Twitter for {{conf.title}}" href="https://twitter.com/{{conf.twitter}}" target="_blank"><img | ||
src="/static/img/407-twitter.svg" class="badge-link" alt="Link to Conference Twitter" width="16" | ||
height="16" /></a> | ||
​ | ||
</span> | ||
{% endif %} | ||
</div> | ||
<div class="col-6"> | ||
<span class="timer"></span> | ||
<span class="timer-small"></span> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-12 col-sm-6"> | ||
<div class="meta"> | ||
<span class="conf-date">{{conf.date}}.</span> | ||
<span class="conf-place"> | ||
{% if conf.place == "Online" %} | ||
<a href="#">{{conf.place}}</a>. | ||
{% else %} | ||
<a href="http://maps.google.com/?q={{conf.place}}">{{conf.place}}</a>. | ||
{% endif %} | ||
</span> | ||
</div> | ||
{% if conf.note %} | ||
<div class="note"> | ||
<b>Note: </b>{{conf.note}} | ||
</div> | ||
{% endif %} | ||
|
||
</div> | ||
<div class="col-12 col-sm-6"> | ||
<div class="deadline"> | ||
<div>Deadline: | ||
<span class="deadline-time"></span> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-6"> | ||
{% assign subs = conf.sub | split: "," %} | ||
{% for sub in subs %} | ||
<span title="Click to only show {{sub | strip}} conferences" data-sub="{{sub | strip}}" | ||
class="badge badge-light conf-sub {{sub | strip}}-tag"></span> | ||
{% endfor %} | ||
</div> | ||
<div class="col-6"> | ||
<div class="calendar"></div> | ||
</div> | ||
</div> | ||
<hr> | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
<footer> | ||
{% include footer.html %} | ||
</footer> | ||
</div> | ||
<script type="text/javascript" charset="utf-8"> | ||
$(function () { | ||
// Timezone deadline shenanigans | ||
var url = new URL(window.location); | ||
var conf = url.searchParams.get('id'); | ||
|
||
var DateTime = luxon.DateTime; | ||
var today = DateTime.now(); | ||
|
||
{% include load_data.js %} | ||
{% include utils.js %} | ||
|
||
$('.local-timezone').text(today.toFormat('z')); | ||
|
||
// other | ||
{% if page.cfp == "TBA" %} | ||
$('#cfp-timer').html("TBA"); | ||
$('.deadline-time').html("TBA"); | ||
$('.deadline-local-time').html("TBA"); | ||
{% else %} | ||
|
||
// Use specified timezone for deadlines if available else use AoE timezone | ||
{% if page.timezone %} | ||
var confDeadline = DateTime.fromSQL("{{page.cfp}}", { zone: "{{page.timezone}}" }); | ||
{% else %} | ||
var confDeadline = DateTime.fromSQL("{{page.cfp}}", { zone: "UTC-12" }); | ||
{% endif %} | ||
|
||
// check if timezone is valid otherwise replace by system timezone | ||
if (confDeadline.invalid) { | ||
var confDeadline = DateTime.fromSQL("{{page.cfp}}"); | ||
console.log("Invalid timezone. Using system timezone instead."); | ||
} | ||
|
||
// add calendar | ||
var conferenceDeadlineCalendar = createCalendarFromObject({ | ||
id: '{{conf.title | slugify}}-{{conf.year}}', | ||
title: '{{page.title}} {{page.year}} deadline', | ||
date: confDeadline.toJSDate(), | ||
duration: 60, | ||
}); | ||
document.querySelector('#conference-deadline').appendChild(conferenceDeadlineCalendar); | ||
|
||
// render countdown timer | ||
$('#cfp-timer').countdown(confDeadline.toJSDate(), function (event) { | ||
$(this).html(event.strftime('%D days %Hh %Mm %Ss')); | ||
}); | ||
|
||
// render deadline conference time | ||
{% if page.timezone %} | ||
$('.deadline-time').html(confDeadline.setZone("{{page.timezone}}").toLocaleString(DateTime.DATETIME_HUGE_WITH_SECONDS)); | ||
{% else %} | ||
$('.deadline-time').html(confDeadline.setZone("UTC-12").toLocaleString(DateTime.DATETIME_HUGE_WITH_SECONDS)); | ||
{% endif %} | ||
|
||
// render deadline in local timezone | ||
$('.deadline-local-time').html(confDeadline.setZone('system').toLocaleString(DateTime.DATETIME_HUGE_WITH_SECONDS)); | ||
|
||
{% endif %} | ||
|
||
}); | ||
</script> | ||
</body> | ||
|
||
</html> |