mirror of
https://github.com/reality/dbot.git
synced 2024-12-24 19:52:36 +01:00
web part for ban list [#557]
This commit is contained in:
parent
5233481992
commit
fe6141ea81
@ -8,5 +8,6 @@
|
||||
},
|
||||
"chanserv": "ChanServ",
|
||||
"document_bans": false,
|
||||
"dbType": "redis"
|
||||
"dbType": "redis",
|
||||
"webAccess": "power_users"
|
||||
}
|
||||
|
29
modules/kick/pages.js
Normal file
29
modules/kick/pages.js
Normal file
@ -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);
|
||||
};
|
23
views/kick/bans.jade
Normal file
23
views/kick/bans.jade
Normal file
@ -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}
|
10
views/kick/servers.jade
Normal file
10
views/kick/servers.jade
Normal file
@ -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}
|
Loading…
Reference in New Issue
Block a user