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> <html>
<head> <head>
<title>OpenFest</title> <title>OpenFest 2020</title>
<meta charset="utf-8"> <meta charset="utf-8">
@ -24,10 +24,12 @@
</div> </div>
</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"> <script id="agenda_template" type="text/ractive">
<section id="agenda"> <section id="agenda">
<h3>{{room}}</h3>
<table class="reveal"> <table class="reveal">
<tbody> <tbody>
{{#pastEvents}} {{#pastEvents}}
@ -72,26 +74,26 @@
<script id="current_talk_template" type="text/ractive"> <script id="current_talk_template" type="text/ractive">
<section id="current_talk"> <section id="current_talk">
<h3>В момента</h3> <h4>В момента</h4>
<h1>{{currentEvent.title}}</h1> <h2>{{currentEvent.title}}</h2>
<p>{{currentEvent.description}}</p> <p>{{currentEvent.abstract}}</p>
</section> </section>
</script> </script>
<script id="speaker_template" type="text/ractive"> <script id="speaker_template" type="text/ractive">
<section> <section>
<h3>Лектор</h3> <h4>Лектор</h4>
<h1>{{name}}</h1> <h2>{{name}}</h2>
<p>{{description}}</p> <p>{{description}}</p>
</section> </section>
</script> </script>
<script id="next_talk_template" type="text/ractive"> <script id="next_talk_template" type="text/ractive">
<section id="next_talk"> <section id="next_talk">
<h3>Следва</h3> <h4>Следва</h4>
<h1>{{nextEvent.title}}</h1> <h2>{{nextEvent.title}}</h2>
<p>{{nextEvent.description}}</p> <p>{{nextEvent.abstract}}</p>
<h4>({{nextEvent.startTime.fromNow()}})</h4> <h5><i>({{nextEvent.startTime.from(now)}})</i></h5>
</section> </section>
</script> </script>
@ -123,7 +125,7 @@
{{/eventCount}} {{/eventCount}}
<section> <section>
<h1>#OpenFest2016</h1> <h1>#OpenFest2020</h1>
<h2>в Twitter</h2> <h2>в Twitter</h2>
</section> </section>
</script> </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(), currentEvent: schedule.currentEvent(),
nextEvent: schedule.nextEvent(), nextEvent: schedule.nextEvent(),
futureEvents: schedule.futureEvents(), 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 events = [];
this.update = function() { var apiEndpointPrefix = 'https://cfp.openfest.org/api/conferences/7';
$.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;
}
return event;
});
events = scheduleEvents; 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(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'];
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});
});
}); });
this.setPageTitle();
} }
this.upcomingEvents = function() { this.upcomingEvents = function() {
var now = this.referenceTime();
return _.select(events, function(event) { 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() { this.currentEvent = function() {
var latestEvent = _.last(this.pastEvents()); var latestEvent = _.last(this.pastEvents());
if (typeof(latestEvent) != 'undefined' && latestEvent.endTime.isAfter(moment())) { if (typeof(latestEvent) != 'undefined' && latestEvent.endTime.isAfter(this.now())) {
return latestEvent; return latestEvent;
} else { } else {
return undefined; return undefined;
@ -42,14 +69,38 @@ function Schedule(hallId, date) {
} }
this.pastEvents = function() { this.pastEvents = function() {
var now = this.referenceTime();
return _.select(events, function(event) { return _.select(events, function(event) {
return event.startTime.isBefore(moment()); return event.startTime.isBefore(now);
}); });
} }
this.allEvents = function() { this.allEvents = function() {
return events; 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){ $.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%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
background-color: #06172A; /* BigBlueButton background */
} }
body, body,
@ -43,4 +44,4 @@ tr.future_event {
tr td:last-child, tr th:last-child { tr td:last-child, tr th:last-child {
text-align: right; text-align: right;
} }