From 9e67c940744a061381d5e46579069bfcec98d18e Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 31 Aug 2013 12:17:06 +0000 Subject: [PATCH] do that thing what i said for [#577] --- modules/report/pages.js | 12 +++--------- views/report/channels.jade | 6 +++--- views/report/notifies.jade | 2 +- views/report/servers.jade | 12 ------------ 4 files changed, 7 insertions(+), 25 deletions(-) delete mode 100644 views/report/servers.jade diff --git a/modules/report/pages.js b/modules/report/pages.js index 5953474..5de5d52 100644 --- a/modules/report/pages.js +++ b/modules/report/pages.js @@ -5,13 +5,7 @@ var _ = require('underscore')._, var pages = function(dbot) { var pages = { '/notify': function(req, res) { - res.render('servers', { - 'servers': _.keys(dbot.config.servers) - }); - }, - - '/notify/:server': function(req, res) { - var server = req.params.server, + var server = req.user.server, userCount = {}, users = [], channelCount = {}; @@ -74,8 +68,8 @@ var pages = function(dbot) { } }, - '/notify/:server/:item': function(req, res) { - var server = req.params.server, + '/notify/:item': function(req, res) { + var server = req.user.server, notifies = []; if(req.params.item.charAt(0) == '#') { diff --git a/views/report/channels.jade b/views/report/channels.jade index cd9facb..5415e5d 100644 --- a/views/report/channels.jade +++ b/views/report/channels.jade @@ -3,14 +3,14 @@ extends ../layout block content h3 Browse by Channel on #{server} div#backlink - a(href='/notify') « Server List + a(href='/') « Home ul#quotelist -each count, name in channels - a(href='/notify/'+server+'/'+encodeURIComponent(name)) + a(href='/notify/'+encodeURIComponent(name)) li.quotes #{name} (#{count}) h3 Browse by User on #{server} ul#quotelist -each nUser in users - a(href='/notify/'+server+'/'+encodeURIComponent(nUser.name)) + a(href='/notify/'+encodeURIComponent(nUser.name)) li.quotes #{nUser.name} (#{nUser.count}) diff --git a/views/report/notifies.jade b/views/report/notifies.jade index b988872..47289a9 100644 --- a/views/report/notifies.jade +++ b/views/report/notifies.jade @@ -2,7 +2,7 @@ extends ../layout block content div#backlink - a(href='/notify/'+server) « Server + a(href='/notify') « Server p div#controls input(type="text", name="search", id="search-text", oninput="searchNotifies(this.value)") diff --git a/views/report/servers.jade b/views/report/servers.jade deleted file mode 100644 index 8e09d65..0000000 --- a/views/report/servers.jade +++ /dev/null @@ -1,12 +0,0 @@ -extends ../layout - -block content - h3 Servers - div#backlink - a(href='/') « Home - div - a(href='/notify/'+user.server+'/missing') My Missed Notifications - ul#quotelist - -each server in servers - a(href='/notify/'+server) - li.quotes #{server}