3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-23 20:39:25 +01:00

fix the project quotes thing

This commit is contained in:
reality 2013-06-30 15:40:47 +00:00
parent 8dcde52099
commit fee7fedbf7

View File

@ -3,8 +3,7 @@ var exec = require('child_process').exec,
_ = require('underscore');
var pages = function(dbot) {
var quoteCat = dbot.db.quoteArrs[dbot.config.name],
rev, diff, branch, credit, authors = [];
var rev, diff, branch, credit, authors = [];
exec("git log --format='%cN¬' | sort -u | tr -d '\n'", function (error, stdout, sderr) {
var credit = stdout.split("¬"); // nobody uses ¬, do they?
for (var i = 0; i < credit.length; i++) {
@ -37,10 +36,8 @@ var pages = function(dbot) {
return {
'/project': function(req, res) {
var quote = dbot.config.name;
if(quoteCat) {
quote = quoteCat[Math.floor(Math.random()*quoteCat.length)];
}
dbot.api.quotes.getQuote(dbot.config.name, function(quote) {
if(!quote) quote = dbot.config.name;
res.render('project', {
"translation": dbot.modules.project.api.translationProgress(),
@ -95,7 +92,8 @@ var pages = function(dbot) {
"languagetranshead": dbot.t("translations"),
"pullreqs": dbot.t("outstanding-pullreq")
});
},
});
}
};
};