From 4f01cc29580e95364829a740f03e642f48bddfab Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 25 Jan 2013 00:40:42 +0000 Subject: [PATCH] sorry @samstudio8 ill clean it up --- modules/profile/config.json | 3 ++- modules/profile/pages.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/profile/config.json b/modules/profile/config.json index 48b297b..109f7c0 100644 --- a/modules/profile/config.json +++ b/modules/profile/config.json @@ -16,5 +16,6 @@ "preferences": { "timezone": null } - } + }, + "dependencies": [ "quotes", "command" ] } diff --git a/modules/profile/pages.js b/modules/profile/pages.js index 96acbed..3288241 100644 --- a/modules/profile/pages.js +++ b/modules/profile/pages.js @@ -14,6 +14,8 @@ var pages = function(dbot) { "lines", "words", "lincent", "wpl", "in_mentions"] ); + + res.render('profile', { 'name': dbot.config.name, 'connection': connection, @@ -27,6 +29,17 @@ var pages = function(dbot) { var connection = req.params.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', { 'name': dbot.config.name, 'connection': connection,