sorry @samstudio8 ill clean it up

This commit is contained in:
reality 2013-01-25 00:40:42 +00:00
parent 6156de73b1
commit 4f01cc2958
2 changed files with 15 additions and 1 deletions

View File

@ -16,5 +16,6 @@
"preferences": { "preferences": {
"timezone": null "timezone": null
} }
} },
"dependencies": [ "quotes", "command" ]
} }

View File

@ -14,6 +14,8 @@ var pages = function(dbot) {
"lines", "words", "lincent", "wpl", "in_mentions"] "lines", "words", "lincent", "wpl", "in_mentions"]
); );
res.render('profile', { res.render('profile', {
'name': dbot.config.name, 'name': dbot.config.name,
'connection': connection, 'connection': connection,
@ -27,6 +29,17 @@ var pages = function(dbot) {
var connection = req.params.connection; var connection = req.params.connection;
var profiles = dbot.db.profiles[connection]; var profiles = dbot.db.profiles[connection];
// TODO: Clean up
_.each(profiles, function(profile) {
if(_.has(dbot.db.quoteArrs, profile.profile.primary)) {
var category = dbot.db.quoteArrs[profile.profile.primary];
var avatar = _.find(category, function(quote) {
return quote.match(/(\.jpg|\.png|\.jpeg)$/i);
});
if(avatar) profile.profile.avatar = avatar;
}
});
res.render('profile_grid', { res.render('profile_grid', {
'name': dbot.config.name, 'name': dbot.config.name,
'connection': connection, 'connection': connection,