3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-25 04:02:39 +01:00

add initial yearbook feature

This commit is contained in:
Thomas Menari 2013-01-24 01:02:50 +00:00
parent 9d87fb7b7d
commit 278bc8b93c
3 changed files with 63 additions and 0 deletions

View File

@ -21,6 +21,17 @@ var pages = function(dbot) {
'profile': profile, 'profile': profile,
'stats': stats.channels, 'stats': stats.channels,
}); });
},
'/grid/:connection': function(req, res) {
var connection = req.params.connection;
var profiles = dbot.db.profiles[connection];
res.render('profile_grid', {
'name': dbot.config.name,
'connection': connection,
'profiles': profiles,
});
} }
} }
}; };

View File

@ -0,0 +1,51 @@
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;
}
} );
$('.tip').tooltip();
$('.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.profile_page-header
h1
#{connection}
div.span9
each profile, key in profiles
if profile.hasOwnProperty('profile') && profile.profile.avatar
div.span2
a(href='/profile/'+connection+'/'+encodeURIComponent(key))
h3= profile.profile.primary
img.profile_avatar(src="#{profile.profile.avatar}")

View File

@ -7,3 +7,4 @@ block content
#modulelinks #modulelinks
-each connection in connections -each connection in connections
a.module(href='/channels/'+connection) #{connection} a.module(href='/channels/'+connection) #{connection}
a.module(href='/grid/'+connection) #{connection} headshots