forked from GitHub/dbot
80 lines
2.5 KiB
Plaintext
80 lines
2.5 KiB
Plaintext
|
extends ../layout
|
||
|
|
||
|
block content
|
||
|
script(type="text/javascript", src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js")
|
||
|
|
||
|
script
|
||
|
$(document).ready(function(){
|
||
|
// Allowing forcing of string stats data to sort as numeric
|
||
|
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||
|
"forcenum-pre": function ( a ) {
|
||
|
a = a.replace("\,", "");
|
||
|
return parseFloat( a );
|
||
|
},
|
||
|
|
||
|
"forcenum-asc": function ( a, b ) {
|
||
|
return a - b;
|
||
|
},
|
||
|
|
||
|
"forcenum-desc": function ( a, b ) {
|
||
|
return b - a;
|
||
|
}
|
||
|
} );
|
||
|
|
||
|
$('.data').dataTable({
|
||
|
"aoColumnDefs": [
|
||
|
{ "sType": "forcenum",
|
||
|
"asSorting": [ "desc", "asc" ],
|
||
|
"aTargets": [ 1, 2, 3, 4, 5 ] }
|
||
|
],
|
||
|
"bPaginate": false,
|
||
|
"bFilter": false,
|
||
|
"bLengthChange": false,
|
||
|
"oLanguage": {
|
||
|
"sInfo": "",
|
||
|
"sInfoEmpty": "",
|
||
|
"sInfoFiltered": ""
|
||
|
},
|
||
|
});
|
||
|
});
|
||
|
|
||
|
div.page-header
|
||
|
h1
|
||
|
#{primary}
|
||
|
|
||
|
div#row
|
||
|
table.table.table-hover.data
|
||
|
thead
|
||
|
tr
|
||
|
th Channel
|
||
|
th Lines
|
||
|
th Words
|
||
|
th Lincent
|
||
|
th Verbosity
|
||
|
th Mentions
|
||
|
tbody
|
||
|
for chan, key in stats
|
||
|
if stats.hasOwnProperty(key)
|
||
|
tr
|
||
|
td
|
||
|
a(href='/users/'+connection+'/'+encodeURIComponent(key))
|
||
|
#{key}
|
||
|
span
|
||
|
if chan.online
|
||
|
if chan.active
|
||
|
span.label.label-success Active
|
||
|
else
|
||
|
span.label.label-important Inactive
|
||
|
else
|
||
|
span.label Offline
|
||
|
td
|
||
|
#{chan.fields.lines.data}
|
||
|
td
|
||
|
#{chan.fields.words.data}
|
||
|
td
|
||
|
#{chan.fields.lincent.data}
|
||
|
td
|
||
|
#{chan.fields.wpl.data}
|
||
|
td
|
||
|
#{chan.fields.in_mentions.data}
|