3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-24 04:49: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'); _ = require('underscore');
var pages = function(dbot) { var pages = function(dbot) {
var quoteCat = dbot.db.quoteArrs[dbot.config.name], var rev, diff, branch, credit, authors = [];
rev, diff, branch, credit, authors = [];
exec("git log --format='%cN¬' | sort -u | tr -d '\n'", function (error, stdout, sderr) { exec("git log --format='%cN¬' | sort -u | tr -d '\n'", function (error, stdout, sderr) {
var credit = stdout.split("¬"); // nobody uses ¬, do they? var credit = stdout.split("¬"); // nobody uses ¬, do they?
for (var i = 0; i < credit.length; i++) { for (var i = 0; i < credit.length; i++) {
@ -37,65 +36,64 @@ var pages = function(dbot) {
return { return {
'/project': function(req, res) { '/project': function(req, res) {
var quote = dbot.config.name; dbot.api.quotes.getQuote(dbot.config.name, function(quote) {
if(quoteCat) { if(!quote) quote = dbot.config.name;
quote = quoteCat[Math.floor(Math.random()*quoteCat.length)];
}
res.render('project', { res.render('project', {
"translation": dbot.modules.project.api.translationProgress(), "translation": dbot.modules.project.api.translationProgress(),
"configList": dbot.modules.project.api.configList(), "configList": dbot.modules.project.api.configList(),
"authors": authors, "authors": authors,
"credits": dbot.t("credits"), "credits": dbot.t("credits"),
"thanks": dbot.t("thanks"), "thanks": dbot.t("thanks"),
"name": dbot.config.name,
"intro": dbot.t("dbotintro", {
"botname": dbot.config.name
}),
"curr839": dbot.config.language,
"repo": dbot.config.modules.github.defaultrepo,
"branch": dbot.t("branch",{
"branch": branch
}),
"currver": dbot.config.version,
"currlang": dbot.t("dbotspeaks",{
"lang839": dbot.config.language,
"langen": dbot.strings[dbot.config.language]["en"],
"lang": dbot.t(dbot.config.language),
"name": dbot.config.name
}),
"projectstatus": dbot.t("projectstatus"),
"revnum": dbot.t("revnum",{
"name": dbot.config.name, "name": dbot.config.name,
"rev": rev "intro": dbot.t("dbotintro", {
}), "botname": dbot.config.name
"modules": dbot.config.moduleNames, }),
"loadmod": dbot.t("loadedmodules"), "curr839": dbot.config.language,
"debugmode": dbot.t("debugmode-" + dbot.config.debugMode), "repo": dbot.config.modules.github.defaultrepo,
"milestones": milestones, "branch": dbot.t("branch",{
"milestoneprog": dbot.t("milestoneprog"), "branch": branch
"config": dbot.t("configoptions"), }),
"milestonename": dbot.t("milestonename"), "currver": dbot.config.version,
"openmilestone": dbot.t("openmilestone"), "currlang": dbot.t("dbotspeaks",{
"closedmilestone": dbot.t("closedmilestone"), "lang839": dbot.config.language,
"development": dbot.t("development"), "langen": dbot.strings[dbot.config.language]["en"],
"dquote": quote, "lang": dbot.t(dbot.config.language),
"diff": diff, "name": dbot.config.name
"pagetitle": dbot.t("pagetitle", { }),
"botname": dbot.config.name "projectstatus": dbot.t("projectstatus"),
}), "revnum": dbot.t("revnum",{
"git": dbot.t("git"), "name": dbot.config.name,
"milestonehead": dbot.t("milestones"), "rev": rev
"propaganda": dbot.t("propaganda"), }),
"languagecurr": dbot.t(dbot.config.language), "modules": dbot.config.moduleNames,
"languagenati": dbot.t("langhead-native"), "loadmod": dbot.t("loadedmodules"),
"languageeng": dbot.t("en"), "debugmode": dbot.t("debugmode-" + dbot.config.debugMode),
"languageprog": dbot.t("langhead-progress"), "milestones": milestones,
"languagetrans": dbot.t("langhead-translations"), "milestoneprog": dbot.t("milestoneprog"),
"languagetranshead": dbot.t("translations"), "config": dbot.t("configoptions"),
"pullreqs": dbot.t("outstanding-pullreq") "milestonename": dbot.t("milestonename"),
}); "openmilestone": dbot.t("openmilestone"),
}, "closedmilestone": dbot.t("closedmilestone"),
"development": dbot.t("development"),
"dquote": quote,
"diff": diff,
"pagetitle": dbot.t("pagetitle", {
"botname": dbot.config.name
}),
"git": dbot.t("git"),
"milestonehead": dbot.t("milestones"),
"propaganda": dbot.t("propaganda"),
"languagecurr": dbot.t(dbot.config.language),
"languagenati": dbot.t("langhead-native"),
"languageeng": dbot.t("en"),
"languageprog": dbot.t("langhead-progress"),
"languagetrans": dbot.t("langhead-translations"),
"languagetranshead": dbot.t("translations"),
"pullreqs": dbot.t("outstanding-pullreq")
});
});
}
}; };
}; };