Improved recordings panel.
Ylian Saint-Hilaire committed
Jul 31, 2020 at 12:03 UTC
2a9dcfbc2618895a590c8094d25e77dd12ba4f53
1 file changed
+17
-11
views/default.handlebars
+17
-11
@@ -11984,21 +11984,27 @@
11984
var p52recordings = null;
11985
function updateRecordings() {
11986
// Save the list of currently checked recordings
11987
- var checkedRecordings = [], elements = document.getElementsByClassName('RecordingCheckbox');
11987
+ var checkedRecordings = [], elements = document.getElementsByClassName('RecordingCheckbox'), x = '';
11988
for (var i=0;i<elements.length;i++) { if (elements[i].checked) { checkedRecordings.push(elements[i].value); } }
11989
11990
- // Display the users using the sorted list
11991
- var x = '<table class=p3usersTable cellpadding=0 cellspacing=0>', addHeader = true;
11992
- x += '<th>' + "Session" + '<th style=width:110px>' + nobreak("Start Time") + '<th style=width:110px>' + "Duration" + '<th style=width:110px>' + "Size";
11993
- if (p52recordings != null) {
11994
- var recdate = null;
11995
- for (var i in p52recordings) {
11996
- var rec = p52recordings[i], rect = new Date(rec.time), day = printDate(rect);
11997
- if (day != recdate) { recdate = day; x += '<tr><td class=userTableHeader colspan=4>' + day; }
11998
- x += addRecordingHtml(i, rec);
11990
+ if (p52recordings == null) {
11991
+ x += '<div style=width:100%;text-align:center;margin-top:20px><i>' + "Loading..." + "</i></div>";
11992
+ } else if (p52recordings.length == 0) {
11993
+ x += '<div style=width:100%;text-align:center;margin-top:20px><i>' + "No recordings." + "</i></div>";
11994
+ } else {
11995
+ // Display the users using the sorted list
11996
+ x += '<table class=p3usersTable cellpadding=0 cellspacing=0>', addHeader = true;
11997
+ x += '<th>' + "Session" + '<th style=width:110px>' + nobreak("Start Time") + '<th style=width:110px>' + "Duration" + '<th style=width:110px>' + "Size";
11998
+ if (p52recordings != null) {
11999
+ var recdate = null;
12000
+ for (var i in p52recordings) {
12001
+ var rec = p52recordings[i], rect = new Date(rec.time), day = printDate(rect);
12002
+ if (day != recdate) { recdate = day; x += '<tr><td class=userTableHeader colspan=4>' + day; }
12003
+ x += addRecordingHtml(i, rec);
12004
+ }
12005
}
12006
+ x += '</table>';
12007
}
12001
- x += '</table>';
12008
QH('p52recordings', x);
12009
12010
// Re-check recordings