1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2024-11-24 03:51:03 +00:00

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

View file

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

View file

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