Modify interlude for OpenFest2020 and clarion

This commit is contained in:
Tocho Tochev 2020-11-06 10:40:32 +02:00
parent b6ae81d2e9
commit e411b8d037
5 changed files with 88 additions and 32 deletions

View File

@ -1,6 +1,6 @@
<html>
<head>
<title>OpenFest</title>
<title>OpenFest 2020</title>
<meta charset="utf-8">
@ -24,10 +24,12 @@
</div>
</div>
<video id="background_video" src="background.mp4" loop autoplay />
<!-- <video id="background_video" src="background.mp4" loop autoplay /> -->
<!-- TODO: fix display of speakers -->
<script id="agenda_template" type="text/ractive">
<section id="agenda">
<h3>{{room}}</h3>
<table class="reveal">
<tbody>
{{#pastEvents}}
@ -72,26 +74,26 @@
<script id="current_talk_template" type="text/ractive">
<section id="current_talk">
<h3>В момента</h3>
<h1>{{currentEvent.title}}</h1>
<p>{{currentEvent.description}}</p>
<h4>В момента</h4>
<h2>{{currentEvent.title}}</h2>
<p>{{currentEvent.abstract}}</p>
</section>
</script>
<script id="speaker_template" type="text/ractive">
<section>
<h3>Лектор</h3>
<h1>{{name}}</h1>
<h4>Лектор</h4>
<h2>{{name}}</h2>
<p>{{description}}</p>
</section>
</script>
<script id="next_talk_template" type="text/ractive">
<section id="next_talk">
<h3>Следва</h3>
<h1>{{nextEvent.title}}</h1>
<p>{{nextEvent.description}}</p>
<h4>({{nextEvent.startTime.fromNow()}})</h4>
<h4>Следва</h4>
<h2>{{nextEvent.title}}</h2>
<p>{{nextEvent.abstract}}</p>
<h5><i>({{nextEvent.startTime.from(now)}})</i></h5>
</section>
</script>
@ -123,7 +125,7 @@
{{/eventCount}}
<section>
<h1>#OpenFest2016</h1>
<h1>#OpenFest2020</h1>
<h2>в Twitter</h2>
</section>
</script>

BIN
logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -20,5 +20,7 @@ function refreshEvent() {
currentEvent: schedule.currentEvent(),
nextEvent: schedule.nextEvent(),
futureEvents: schedule.futureEvents(),
eventCount: schedule.allEvents().length});
eventCount: schedule.allEvents().length,
now: schedule.now(),
room: schedule.room()});
}

View File

@ -1,26 +1,53 @@
function Schedule(hallId, date) {
function Schedule(hallId, date, setPageTitle) {
var events = [];
var apiEndpointPrefix = 'https://cfp.openfest.org/api/conferences/7';
var pageTitle = 'OpenFest';
var room = '';
var nextLectureDelayMinutes = 4; // show the current lecture as next for the first N minutes
$.getJSON(apiEndpointPrefix + '/halls.json', function(data) {
room = data[hallId]['name']['bg'];
if (room === undefined) {
room = '';
}
});
this.update = function() {
$.getJSON('http://www.openfest.org/2016/wp-content/themes/initfest/schedule/interlude.php', function(data) {
var scheduleEvents = $.map(data[hallId], function(event) {
event['startTime'] = moment(event['starts_at'] * 1000);
event['endTime'] = moment(event['ends_at'] * 1000);
console.log(event['startTime'].date());
if (event['startTime'].date() !== date) {
return null;
}
$.getJSON(apiEndpointPrefix + '/events.json', function(eventsData) {
$.getJSON(apiEndpointPrefix + '/slots.json', function(slotsData) {
$.each(slotsData, function(slotId, slot) {
$.extend(eventsData[slot['event_id'].toString()], slot);
$.extend(eventsData[slot['event_id'].toString()], {"slotId": slotId});
});
var scheduleEvents = $.map(eventsData, function(event, eventId) {
event['id'] = eventId;
event['startTime'] = moment(event['starts_at']);
event['endTime'] = moment(event['ends_at']);
event['hallId'] = event['hall_id'];
return event;
if (event['startTime'].date() !== date) {
return null;
}
if (event['hallId'] !== hallId) {
return null;
}
return event;
});
events = scheduleEvents.sort(function (a,b) {return a['startTime'].isBefore(b['startTime']) ? -1 : 1});
});
events = scheduleEvents;
});
this.setPageTitle();
}
this.upcomingEvents = function() {
var now = this.referenceTime();
return _.select(events, function(event) {
return event.startTime.isAfter(moment());
return event.startTime.isAfter(now);
});
}
@ -30,7 +57,7 @@ function Schedule(hallId, date) {
this.currentEvent = function() {
var latestEvent = _.last(this.pastEvents());
if (typeof(latestEvent) != 'undefined' && latestEvent.endTime.isAfter(moment())) {
if (typeof(latestEvent) != 'undefined' && latestEvent.endTime.isAfter(this.now())) {
return latestEvent;
} else {
return undefined;
@ -42,14 +69,38 @@ function Schedule(hallId, date) {
}
this.pastEvents = function() {
var now = this.referenceTime();
return _.select(events, function(event) {
return event.startTime.isBefore(moment());
return event.startTime.isBefore(now);
});
}
this.allEvents = function() {
return events;
}
this.now = function() {
now = $.urlParam("now");
if (now) {
return moment(now);
} else {
return moment();
}
}
this.referenceTime = function() {
return this.now().subtract(nextLectureDelayMinutes, 'minutes');
}
this.room = function() {
return room;
}
this.setPageTitle = function() {
if (setPageTitle) {
$('title').text(pageTitle + " room=" + room + " date=" + date);
}
}
}
$.urlParam = function(name){
@ -62,4 +113,4 @@ $.urlParam = function(name){
}
}
var schedule = new Schedule(parseInt($.urlParam('roomId')), parseInt($.urlParam('date')));
var schedule = new Schedule(parseInt($.urlParam('roomId')), parseInt($.urlParam('date')), true);

View File

@ -2,6 +2,7 @@ body {
width: 100%;
height: 100%;
overflow: hidden;
background-color: #06172A; /* BigBlueButton background */
}
body,