name in title instead of dbot

This commit is contained in:
Luke Slater 2012-03-10 17:49:57 +00:00
parent b1a2f6edf6
commit 59adda4221
2 changed files with 5 additions and 5 deletions

View File

@ -18,23 +18,23 @@ var webInterface = function(dbot) {
// Lists the quote categories
app.get('/quotes', function(req, res) {
res.render('quotelist', { 'quotelist': Object.keys(dbot.db.quoteArrs) });
res.render('quotelist', { 'name': dbot.name, 'quotelist': Object.keys(dbot.db.quoteArrs) });
});
// Lists quotes in a category
app.get('/quotes/:key', function(req, res) {
var key = req.params.key.toLowerCase();
if(dbot.db.quoteArrs.hasOwnProperty(key)) {
res.render('quotes', { 'quotes': dbot.db.quoteArrs[key], locals: { 'url_regex': RegExp.prototype.url_regex() } });
res.render('quotes', { 'name': dbot.name, 'quotes': dbot.db.quoteArrs[key], locals: { 'url_regex': RegExp.prototype.url_regex() } });
} else {
res.render('error', { 'message': 'No quotes under that key.' });
res.render('error', { 'name': dbot.name, 'message': 'No quotes under that key.' });
}
});
// Load random quote category page
app.get('/rq', function(req, res) {
var rCategory = Object.keys(dbot.db.quoteArrs).random();
res.render('quotes', { 'quotes': dbot.db.quoteArrs[rCategory], locals: { 'url_regex': RegExp.prototype.url_regex() } });
res.render('quotes', { 'name': dbot.name, 'quotes': dbot.db.quoteArrs[rCategory], locals: { 'url_regex': RegExp.prototype.url_regex() } });
});
app.listen(443);

View File

@ -3,7 +3,7 @@ html(lang='en')
head
meta(charset='utf-8')
link(rel='stylesheet', type='text/css', href='/styles.css')
title Depressionbot web interface
title #{name} web interface
body
div#page
div#title