diff --git a/modules/kick/config.json b/modules/kick/config.json index fb9ed4c..4df5b5b 100644 --- a/modules/kick/config.json +++ b/modules/kick/config.json @@ -8,5 +8,6 @@ }, "chanserv": "ChanServ", "document_bans": false, - "dbType": "redis" + "dbType": "redis", + "webAccess": "power_users" } diff --git a/modules/kick/pages.js b/modules/kick/pages.js new file mode 100644 index 0000000..a16c91d --- /dev/null +++ b/modules/kick/pages.js @@ -0,0 +1,29 @@ +var _ = require('underscore')._; + +var pages = function(dbot) { + return { + '/kick': function(req, res) { + res.render('servers', { + 'servers': _.keys(dbot.config.servers) + }); + }, + + '/kick/:server': function(req, res) { + var server = req.params.server, + bans = []; + + this.db.search('nbans', { 'server': server }, function(ban) { + bans.push(ban); + }, function() { + res.render('bans', { + 'server': server, + 'bans': bans + }); + }); + } + } +}; + +exports.fetch = function(dbot) { + return pages(dbot); +}; diff --git a/views/kick/bans.jade b/views/kick/bans.jade new file mode 100644 index 0000000..6d0d090 --- /dev/null +++ b/views/kick/bans.jade @@ -0,0 +1,23 @@ +extends ../layout + +block content + div#backlink + a(href='/warning/'+server) « Server Bans + p + div#profile_datatable + table.table.table-hover.data + thead + tr + th Date + th Banner + th Banee + th Host + th Reason + tbody + each ban, key in bans + tr + td #{new Date(ban.time)} + td #{ban.banner} + td #{ban.banee} + td #{ban.host} + td #{ban.reason} diff --git a/views/kick/servers.jade b/views/kick/servers.jade new file mode 100644 index 0000000..eec1403 --- /dev/null +++ b/views/kick/servers.jade @@ -0,0 +1,10 @@ +extends ../layout + +block content + h3 Servers + div#backlink + a(href='/') « Home + ul#quotelist + -each server in servers + a(href='/kick/'+server) + li.quotes #{server}