From 0d927881b4843447b47c1e5378e6e341cba3a1b0 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 17 Aug 2013 21:04:42 +0000 Subject: [PATCH] do [close #552] --- modules/report/pages.js | 26 ++++++++++++-------------- modules/report/report.js | 3 +-- modules/web/web.js | 5 ----- views/report/missing_notifies.jade | 2 ++ views/report/servers.jade | 2 ++ 5 files changed, 17 insertions(+), 21 deletions(-) diff --git a/modules/report/pages.js b/modules/report/pages.js index 9274ad7..701ec5d 100644 --- a/modules/report/pages.js +++ b/modules/report/pages.js @@ -18,6 +18,18 @@ var pages = function(dbot) { }); }, + '/report/:server/missing': function(req, res) { + var server = req.params.server, + user = req.user, + notifies = this.pending[user.id]; + + res.render('missing_notifies', { + 'name': dbot.config.name, + 'user': user.primaryNick, + 'notifies': notifies + }); + }, + '/report/:server/:channel': function(req, res) { var server = req.params.server, channel = req.params.channel, @@ -35,20 +47,6 @@ var pages = function(dbot) { 'notifies': notifies }); }); - }, - - '/report/:server/missing/:user': function(req, res) { - var server = req.params.server, - nick = req.params.user; - - dbot.api.users.resolveUser(server, nick, function(user) { - var notifies = this.pending[user.id]; - res.render('missing_notifies', { - 'name': dbot.config.name, - 'user': nick, - 'notifies': notifies - }); - }.bind(this)); } }; }; diff --git a/modules/report/report.js b/modules/report/report.js index 4f939d6..1d4e88c 100644 --- a/modules/report/report.js +++ b/modules/report/report.js @@ -59,8 +59,7 @@ var report = function(dbot) { if(_.has(this.pending, event.rUser.id) && this.pNotify[event.rUser.id] === true) { dbot.say(event.server, event.user, dbot.t('missed_notifies', { 'user': event.rUser.primaryNick, - 'link': dbot.api.web.getUrl('report/' + event.server + - '/missing/' + event.rUser.primaryNick) + 'link': dbot.api.web.getUrl('report/' + event.server + '/missing') })); this.pNotify = false; } diff --git a/modules/web/web.js b/modules/web/web.js index 2040233..1043f85 100644 --- a/modules/web/web.js +++ b/modules/web/web.js @@ -24,14 +24,11 @@ var webInterface = function(dbot) { this.app.use(this.app.router); passport.serializeUser(function(user, done) { - console.log('serialising ' + user); done(null, user.id); }); passport.deserializeUser(function(id, done) { dbot.api.users.getUser(id, function(user) { - console.log(id); - console.log(user); done(null, user); }); }); @@ -176,7 +173,6 @@ var webInterface = function(dbot) { return next(); } } else { - console.log(req); res.render('login', { 'message': 'You need to log in to access this module.', 'redirect': req.originalUrl @@ -191,7 +187,6 @@ var webInterface = function(dbot) { this.commands = { '~setwebpass': function(event) { var newPass = event.input[1]; - console.log(newPass); this.api.getWebUser(event.rUser.id, function(webUser) { if(!webUser) { webUser = { diff --git a/views/report/missing_notifies.jade b/views/report/missing_notifies.jade index cd82298..4f539a3 100644 --- a/views/report/missing_notifies.jade +++ b/views/report/missing_notifies.jade @@ -2,6 +2,8 @@ extends ../layout block content h3 Notifications Missed by #{user.primaryNick} + div#backlink + a(href='/report') « Notifications p if notifies div#profile_datatable diff --git a/views/report/servers.jade b/views/report/servers.jade index 3401db0..0d5eca3 100644 --- a/views/report/servers.jade +++ b/views/report/servers.jade @@ -4,6 +4,8 @@ block content h3 Servers div#backlink a(href='/') « Home + div + a(href='/report/'+user.server+'/missing') My Missed Notifications ul#quotelist -each server in servers a(href='/report/'+server)