diff --git a/assets/css/_overview.less b/assets/css/_overview.less index e7c341c3..d8a85c8d 100644 --- a/assets/css/_overview.less +++ b/assets/css/_overview.less @@ -115,6 +115,39 @@ body.overview { .panel-body h2 { margin: 0; } + + &.inactive-stream { + display: none; + } + } + + input.show-inactive { + display: none; + } + .show-inactive-toggle { + width: ~"calc(100% - 30px)"; + margin-left: 15px; + + .show-inactive-text { + display: inline; + } + .hide-inactive-text { + display: none; + } + } + input[type="checkbox"]:checked.show-inactive { + ~ .room { + display: block; + } + + ~ .show-inactive-toggle { + .show-inactive-text { + display: none; + } + .hide-inactive-text { + display: inline; + } + } } .recordings a { diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js index 54deb21d..a90929b2 100644 --- a/assets/js/lustiges-script.js +++ b/assets/js/lustiges-script.js @@ -299,12 +299,28 @@ $(function() { }); }); -// update teaser images +// update teaser images, hide/show room depending on teaser image availability $(function() { + var + roomSelector = '.room.has-preview', + previewSelector = roomSelector + ' .preview', + inactiveClass = 'inactive-stream'; + + $(previewSelector).each(function() { + var + $teaser = $(this), + $room = $teaser.parents(roomSelector); + + $teaser.on('error', function() { + $room.addClass(inactiveClass); + }); + }); + setInterval(function() { - $('.rooms .lecture .teaser').each(function() { + $(previewSelector).each(function() { var $teaser = $(this), + $room = $teaser.parents(roomSelector), $preload = $(''), src = $teaser.data('src'); @@ -315,6 +331,9 @@ $(function() { $preload.on('load', function() { $teaser.prop('src', $preload.prop('src')); + $room.removeClass(inactiveClass); + }).on('error', function() { + $room.addClass(inactiveClass); }).prop('src', src + '?'+(new Date()).getTime()); }); }, 1000*60); diff --git a/template/overview.phtml b/template/overview.phtml index 3bbd832d..727ac97c 100644 --- a/template/overview.phtml +++ b/template/overview.phtml @@ -10,6 +10,7 @@
+
+