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", {
loggedIn: loginName !== false,
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;
});
var count = 0;
channels.forEach(function (c) {
var tr = $("<tr/>").appendTo(tbl);
var name = $("<td/>").appendTo(tr);
@ -376,6 +377,7 @@ socket.on("acp-list-activechannels", function (channels) {
.text(c.pagetitle + " (/r/" + c.name + ")")
.appendTo(name);
var usercount = $("<td/>").text(c.usercount).appendTo(tr);
count += c.usercount;
var nowplaying = $("<td/>").text(c.mediatitle).appendTo(tr);
var registered = $("<td/>").text(c.registered).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 () {