Merge pull request #7 from dhavlik/main

load custom css from event settings, slightly change css selectors
This commit is contained in:
Franzi 2021-12-24 21:20:53 +01:00 committed by GitHub
commit 818b474bc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 21 deletions

View File

@ -4,7 +4,7 @@
line-height: 1.2em;
}
#box {
#l3box {
width: 1020px;
position: absolute;
@ -20,17 +20,17 @@
background-color: #3aa57c;
}
#title {
#l3title {
font-size: 30px;
font-weight: 500;
margin-bottom: 15px;
}
#speaker {
#l3speaker {
font-size: 20px;
}
#info_line {
#l3info_line {
font-size: 16px;
text-align: right;
}

View File

@ -3,7 +3,7 @@ room_name = null;
event_info = null;
$(function() {
$('#speaker').text('Content will appear soon.');
$('#l3speaker').text('Content will appear soon.');
});
function update_lower_third() {
@ -23,8 +23,8 @@ function update_lower_third() {
}
if (schedule['rooms'].length > 1 && !schedule['rooms'].includes(room_name)) {
$('#title').text('Error')
$('#speaker').text('Invalid room_name. Valid names: ' + schedule['rooms'].join(', '));
$('#l3title').text('Error')
$('#l3speaker').text('Invalid room_name. Valid names: ' + schedule['rooms'].join(', '));
return
}
@ -48,19 +48,19 @@ function update_lower_third() {
}
if (current_talk) {
$('#title').text(current_talk['title']);
$('#speaker').text(current_talk['persons'].join(', '));
$('#info_line').text(current_talk['infoline']);
$('#l3title').text(current_talk['title']);
$('#l3speaker').text(current_talk['persons'].join(', '));
$('#l3info_line').text(current_talk['infoline']);
} else {
$('#title').text(event_info['no_talk']);
$('#speaker').text('');
$('#info_line').text('');
$('#l3title').text(event_info['no_talk']);
$('#l3speaker').text('');
$('#l3info_line').text('');
}
if (current_talk && current_talk['track']) {
$('#box').css('border-bottom', '10px solid ' + current_talk['track']['color']);
$('#l3box').css('border-bottom', '10px solid ' + current_talk['track']['color']);
} else {
$('#box').css('border-bottom', 'none');
$('#l3box').css('border-bottom', 'none');
}
}
window.setInterval(update_lower_third, 1000);
@ -69,7 +69,7 @@ function update_schedule() {
$.getJSON('../event.json', function(data) {
event_info = data;
$('#box').css('background-color', data['color']);
$('#l3box').css('background-color', data['color']);
});
$.getJSON('../schedule.json', function(data) {
console.info('schedule updated with ' + data['talks'].length + ' talks in ' + data['rooms'].length + ' rooms');

View File

@ -10,12 +10,15 @@
{% endcompress %}
<script src="{% static "pretalx_broadcast_tools/update.js" %}"></script>
<link rel="stylesheet" href="{% static "pretalx_broadcast_tools/frontend.css" %}" />
{% if request.event and request.event.custom_css %}
<link rel="stylesheet" type="text/css" href="{{ request.event.custom_css.url }}"/>
{% endif %}
</head>
<body>
<div id="box">
<p id="title">Loading ...</p>
<p id="speaker">Content should appear soon. If not, please verify you have Javascript enabled.</p>
<p id="info_line"></p>
<body class="lower3rd">
<div id="l3box">
<p id="l3title">Loading ...</p>
<p id="l3speaker">Content should appear soon. If not, please verify you have Javascript enabled.</p>
<p id="l3info_line"></p>
</div>
</body>
</html>