2012-12-24 06:47:47 +01:00
|
|
|
extends ../layout
|
2012-12-24 05:06:04 +01:00
|
|
|
|
|
|
|
block content
|
2013-01-21 00:07:33 +01:00
|
|
|
script(type="text/javascript", src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js")
|
2013-01-24 23:17:56 +01:00
|
|
|
style
|
|
|
|
.chart rect {
|
|
|
|
fill: steelblue;
|
|
|
|
}
|
|
|
|
.chart rect:hover {
|
|
|
|
fill: #000;
|
|
|
|
}
|
2013-01-26 01:51:48 +01:00
|
|
|
.yTicks {
|
|
|
|
stroke: #aaa;
|
|
|
|
stroke-width: 0.5;
|
|
|
|
}
|
2013-01-21 00:07:33 +01:00
|
|
|
|
|
|
|
script
|
|
|
|
$(document).ready(function(){
|
2013-01-24 23:17:56 +01:00
|
|
|
// d3.js Graph
|
2013-01-26 19:57:33 +01:00
|
|
|
var ticks = 25;
|
|
|
|
var timelabels = 30;
|
2013-01-26 01:51:48 +01:00
|
|
|
var chartw = 940;
|
2013-01-26 19:57:33 +01:00
|
|
|
var toppad = 10;
|
|
|
|
var w = (chartw - (ticks * 2)) / 168;
|
|
|
|
var h = 130;
|
2013-01-24 23:17:56 +01:00
|
|
|
|
|
|
|
var x = d3.scale.linear()
|
|
|
|
.domain([0,1])
|
|
|
|
.range([0,w]);
|
|
|
|
|
|
|
|
var y = d3.scale.linear()
|
2013-01-25 12:05:40 +01:00
|
|
|
.domain([0,d3.max([#{chanFreq}])])
|
2013-01-26 19:57:33 +01:00
|
|
|
.rangeRound([0,h-toppad]);
|
2013-01-24 23:17:56 +01:00
|
|
|
|
|
|
|
var chart = d3.select($("#chanFreqChart")[0]).append("svg")
|
|
|
|
.attr("class", "chart")
|
2013-01-26 19:57:33 +01:00
|
|
|
.attr("width", chartw)
|
|
|
|
.attr("height", h + timelabels);
|
2013-01-24 23:17:56 +01:00
|
|
|
|
2013-01-26 01:51:48 +01:00
|
|
|
chart.selectAll(".yTicks")
|
2013-01-26 19:57:33 +01:00
|
|
|
.data(y.ticks(5).slice(1))
|
2013-01-26 01:51:48 +01:00
|
|
|
.enter().append("svg:line")
|
|
|
|
.attr("class", "yTicks")
|
2013-01-26 01:55:50 +01:00
|
|
|
.attr("y1", function(d) { return -1 * y(d) + h; })
|
2013-01-26 01:51:48 +01:00
|
|
|
.attr("x1", 0)
|
2013-01-26 01:55:50 +01:00
|
|
|
.attr("y2", function(d) { return -1 * y(d) + h; })
|
2013-01-26 19:57:33 +01:00
|
|
|
.attr("x2", chartw)
|
2013-01-26 01:51:48 +01:00
|
|
|
|
2013-01-24 23:17:56 +01:00
|
|
|
chart.selectAll("rect")
|
|
|
|
.data([#{chanFreq}])
|
|
|
|
.enter().append("rect")
|
2013-01-26 19:57:33 +01:00
|
|
|
.attr("x", function(d, i) { return x(i) - .5 + ticks; })
|
2013-01-24 23:17:56 +01:00
|
|
|
.attr("y", function(d) { return h - y(d) - .5; })
|
|
|
|
.attr("width", w)
|
|
|
|
.attr("height", function(d) { return y(d); })
|
2013-01-25 12:08:35 +01:00
|
|
|
.attr("title", function(d){ return d; });
|
2013-01-24 23:17:56 +01:00
|
|
|
|
2013-01-26 19:57:33 +01:00
|
|
|
chart.selectAll(".l_rule")
|
|
|
|
.data(y.ticks(5).slice(1))
|
|
|
|
.enter().append("text")
|
|
|
|
.attr("class", "rule")
|
|
|
|
.attr("y", function(d) { return -1 * y(d) + h; })
|
|
|
|
.attr("x", 0)
|
|
|
|
.attr("text-anchor", "right")
|
|
|
|
.attr("font-size", 10)
|
|
|
|
.attr("dy", 3)
|
|
|
|
.text(String);
|
|
|
|
chart.selectAll(".r_rule")
|
2013-01-26 01:51:48 +01:00
|
|
|
.data(y.ticks(5).slice(1,5))
|
|
|
|
.enter().append("text")
|
|
|
|
.attr("class", "rule")
|
|
|
|
.attr("y", function(d) { return -1 * y(d) + h; })
|
2013-01-26 19:57:33 +01:00
|
|
|
.attr("x", chartw)
|
|
|
|
.attr("text-anchor", "end")
|
2013-01-26 01:51:48 +01:00
|
|
|
.attr("font-size", 10)
|
|
|
|
.attr("dy", 3)
|
|
|
|
.text(String);
|
|
|
|
|
2013-01-24 23:17:56 +01:00
|
|
|
chart.append("line")
|
2013-01-26 19:57:33 +01:00
|
|
|
.attr("x1", 0 + ticks)
|
|
|
|
.attr("x2", chartw - ticks)
|
2013-01-24 23:17:56 +01:00
|
|
|
.attr("y1", h - .5)
|
|
|
|
.attr("y2", h - .5)
|
|
|
|
.style("stroke", "#000");
|
|
|
|
|
2013-01-25 22:39:13 +01:00
|
|
|
chart.selectAll("text.times")
|
|
|
|
.data(["0", "6", "12", "18","0", "6", "12", "18","0", "6", "12", "18","0", "6", "12", "18" ,"0", "6", "12", "18" ,"0", "6", "12", "18" ,"0", "6", "12", "18"])
|
|
|
|
.enter().append("text")
|
2013-01-26 19:57:33 +01:00
|
|
|
.attr("x", function(d, i){ return ((i * w * 6)+(w/2)) + ticks; })
|
2013-01-25 22:39:13 +01:00
|
|
|
.attr("y", h + 10)
|
|
|
|
.attr("text-anchor", "middle")
|
|
|
|
.attr('class', 'name')
|
|
|
|
.attr("font-size", 10)
|
|
|
|
.text(String);
|
|
|
|
|
|
|
|
chart.selectAll("text.days")
|
|
|
|
.data(["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"])
|
|
|
|
.enter().append("text")
|
2013-01-26 19:57:33 +01:00
|
|
|
.attr("x", function(d, i){ return ((i+0.5) * w * 24) + ticks; })
|
2013-01-25 22:39:13 +01:00
|
|
|
.attr("y", h + 25)
|
|
|
|
.attr("text-anchor", "middle")
|
|
|
|
.attr('class', 'name')
|
|
|
|
.attr("font-size", 12)
|
|
|
|
.text(String);
|
|
|
|
|
2013-01-24 23:17:56 +01:00
|
|
|
|
2013-01-21 00:15:26 +01:00
|
|
|
// Allowing forcing of string stats data to sort as numeric
|
2013-01-21 00:07:33 +01:00
|
|
|
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
|
|
|
"forcenum-pre": function ( a ) {
|
2013-01-21 00:15:26 +01:00
|
|
|
a = a.replace("\,", "");
|
2013-01-21 00:07:33 +01:00
|
|
|
return parseFloat( a );
|
|
|
|
},
|
|
|
|
|
|
|
|
"forcenum-asc": function ( a, b ) {
|
|
|
|
return a - b;
|
|
|
|
},
|
|
|
|
|
|
|
|
"forcenum-desc": function ( a, b ) {
|
|
|
|
return b - a;
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2013-01-23 19:00:27 +01:00
|
|
|
$('.tip').tooltip();
|
2013-01-24 23:17:56 +01:00
|
|
|
$('rect').tooltip({
|
|
|
|
});
|
2013-01-21 00:07:33 +01:00
|
|
|
$('.data').dataTable({
|
|
|
|
"aoColumnDefs": [
|
2013-01-21 01:28:11 +01:00
|
|
|
{ "aDataSort": [ 1, 0 ], "asSorting": [ "asc" ], "aTargets": [ 0 ] },
|
|
|
|
{ "bVisible": false, "aTargets": [ 1 ] },
|
2013-01-22 21:44:45 +01:00
|
|
|
{ "sType": "forcenum",
|
|
|
|
"asSorting": [ "desc", "asc" ],
|
|
|
|
"aTargets": [ 2, 3, 4, 5, 6 ] }
|
2013-01-21 00:07:33 +01:00
|
|
|
],
|
|
|
|
"bPaginate": false,
|
|
|
|
"bLengthChange": false,
|
|
|
|
"oLanguage": {
|
|
|
|
"sInfo": "_TOTAL_ users",
|
2013-01-21 00:25:00 +01:00
|
|
|
"sInfoEmpty": "No users",
|
2013-01-21 00:07:33 +01:00
|
|
|
"sInfoFiltered": "filtered (_MAX_ total)"
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2013-01-24 23:17:56 +01:00
|
|
|
div.page-header.profile_page-header
|
|
|
|
h1
|
|
|
|
#{channel}
|
|
|
|
small
|
|
|
|
#{connection}
|
2012-12-24 05:06:04 +01:00
|
|
|
div#backlink
|
|
|
|
a(href='/channels/'+connection) « Channel List
|
2013-01-24 23:17:56 +01:00
|
|
|
div#row
|
|
|
|
div.barchart#chanFreqChart
|
|
|
|
hr
|
2013-01-10 23:23:51 +01:00
|
|
|
div#row
|
2013-01-21 00:07:33 +01:00
|
|
|
table.table.table-hover.data
|
2013-01-10 23:23:51 +01:00
|
|
|
thead
|
2013-01-11 23:39:32 +01:00
|
|
|
tr
|
|
|
|
th Users
|
2013-01-21 01:28:11 +01:00
|
|
|
th
|
2013-01-11 23:39:32 +01:00
|
|
|
th Lines
|
|
|
|
th Words
|
|
|
|
th Lincent
|
|
|
|
th Verbosity
|
|
|
|
th Mentions
|
2013-01-10 23:23:51 +01:00
|
|
|
tbody
|
2013-01-24 23:17:56 +01:00
|
|
|
-each nick in userStats
|
2013-01-10 23:23:51 +01:00
|
|
|
tr
|
|
|
|
td
|
2013-01-22 21:44:45 +01:00
|
|
|
a(href='/profile/'+connection+'/'+nick.primary)
|
2013-01-11 23:39:32 +01:00
|
|
|
#{nick.display}
|
2013-01-10 23:23:51 +01:00
|
|
|
span
|
2013-01-15 21:44:15 +01:00
|
|
|
if nick.online
|
2013-01-23 19:00:27 +01:00
|
|
|
if nick.active.active
|
|
|
|
span.label.label-success.tip(data-original-title="#{nick.active.ago}", data-placement="right") Active
|
2013-01-15 21:44:15 +01:00
|
|
|
else
|
2013-01-23 19:00:27 +01:00
|
|
|
span.label.label-important.tip(data-original-title="#{nick.active.ago}", data-placement="right") Inactive
|
2013-01-15 21:44:15 +01:00
|
|
|
else
|
2013-01-23 19:00:27 +01:00
|
|
|
span.label.tip(data-original-title="#{nick.active.ago}", data-placement="right") Offline
|
2013-01-21 01:28:11 +01:00
|
|
|
td
|
|
|
|
if nick.online
|
2013-01-23 19:00:27 +01:00
|
|
|
if nick.active.active
|
2013-01-21 01:28:11 +01:00
|
|
|
-1
|
|
|
|
else
|
|
|
|
0
|
|
|
|
else
|
|
|
|
1
|
2013-01-11 23:39:32 +01:00
|
|
|
td
|
2013-01-15 16:10:28 +01:00
|
|
|
#{nick.fields.lines.data}
|
2013-01-11 23:39:32 +01:00
|
|
|
td
|
2013-01-15 16:10:28 +01:00
|
|
|
#{nick.fields.words.data}
|
2013-01-11 23:39:32 +01:00
|
|
|
td
|
2013-01-15 16:10:28 +01:00
|
|
|
#{nick.fields.lincent.data}
|
2013-01-11 23:39:32 +01:00
|
|
|
td
|
2013-01-15 16:10:28 +01:00
|
|
|
#{nick.fields.wpl.data}
|
2013-01-11 23:39:32 +01:00
|
|
|
td
|
2013-01-15 16:10:28 +01:00
|
|
|
#{nick.fields.in_mentions.data}
|