Minor fixes to channel listing

This commit is contained in:
calzoneman 2014-02-26 11:04:22 -06:00
parent 1e2a158ae6
commit 2bd6a207ba
2 changed files with 11 additions and 1 deletions

View File

@ -166,7 +166,7 @@ function handleIndex(req, res) {
sendJade(res, "index", { sendJade(res, "index", {
loggedIn: loginName !== false, loggedIn: loginName !== false,
loginName: loginName, loginName: loginName,
channels: Server.getServer().packChannelList(true) channels: channels
}); });
} }

View File

@ -369,6 +369,7 @@ socket.on("acp-list-activechannels", function (channels) {
return a.usercount > b.usercount ? -1 : 1; return a.usercount > b.usercount ? -1 : 1;
}); });
var count = 0;
channels.forEach(function (c) { channels.forEach(function (c) {
var tr = $("<tr/>").appendTo(tbl); var tr = $("<tr/>").appendTo(tbl);
var name = $("<td/>").appendTo(tr); var name = $("<td/>").appendTo(tr);
@ -376,6 +377,7 @@ socket.on("acp-list-activechannels", function (channels) {
.text(c.pagetitle + " (/r/" + c.name + ")") .text(c.pagetitle + " (/r/" + c.name + ")")
.appendTo(name); .appendTo(name);
var usercount = $("<td/>").text(c.usercount).appendTo(tr); var usercount = $("<td/>").text(c.usercount).appendTo(tr);
count += c.usercount;
var nowplaying = $("<td/>").text(c.mediatitle).appendTo(tr); var nowplaying = $("<td/>").text(c.mediatitle).appendTo(tr);
var registered = $("<td/>").text(c.registered).appendTo(tr); var registered = $("<td/>").text(c.registered).appendTo(tr);
var public = $("<td/>").text(c.public).appendTo(tr); var public = $("<td/>").text(c.public).appendTo(tr);
@ -390,6 +392,14 @@ socket.on("acp-list-activechannels", function (channels) {
} }
}); });
}); });
var total = $("<tr/>").appendTo(tbl);
$("<td/>").html("<strong>Total</strong>").appendTo(total);
$("<td/>").html("<strong>" + count + "</strong>").appendTo(total);
$("<td/>").appendTo(total);
$("<td/>").appendTo(total);
$("<td/>").appendTo(total);
$("<td/>").appendTo(total);
}); });
$("#acp-lchannels-refresh").click(function () { $("#acp-lchannels-refresh").click(function () {