Modify interlude for OpenFest2020 and clarion
This commit is contained in:
parent
b6ae81d2e9
commit
e411b8d037
26
index.html
26
index.html
|
@ -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
BIN
logo.png
Binary file not shown.
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 26 KiB |
|
@ -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()});
|
||||||
}
|
}
|
||||||
|
|
83
schedule.js
83
schedule.js
|
@ -1,26 +1,53 @@
|
||||||
function Schedule(hallId, date) {
|
function Schedule(hallId, date, setPageTitle) {
|
||||||
var events = [];
|
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() {
|
this.update = function() {
|
||||||
$.getJSON('http://www.openfest.org/2016/wp-content/themes/initfest/schedule/interlude.php', function(data) {
|
$.getJSON(apiEndpointPrefix + '/events.json', function(eventsData) {
|
||||||
var scheduleEvents = $.map(data[hallId], function(event) {
|
$.getJSON(apiEndpointPrefix + '/slots.json', function(slotsData) {
|
||||||
event['startTime'] = moment(event['starts_at'] * 1000);
|
$.each(slotsData, function(slotId, slot) {
|
||||||
event['endTime'] = moment(event['ends_at'] * 1000);
|
$.extend(eventsData[slot['event_id'].toString()], slot);
|
||||||
console.log(event['startTime'].date());
|
$.extend(eventsData[slot['event_id'].toString()], {"slotId": slotId});
|
||||||
if (event['startTime'].date() !== date) {
|
});
|
||||||
return null;
|
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() {
|
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);
|
||||||
|
|
|
@ -2,6 +2,7 @@ body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
background-color: #06172A; /* BigBlueButton background */
|
||||||
}
|
}
|
||||||
|
|
||||||
body,
|
body,
|
||||||
|
|
Loading…
Reference in New Issue