2013-04-18 16:30:00 +02:00
|
|
|
var exec = require('child_process').exec,
|
|
|
|
request = require('request');
|
2013-04-18 13:06:13 +02:00
|
|
|
|
|
|
|
var pages = function(dbot) {
|
|
|
|
var rev;
|
2013-04-18 16:30:00 +02:00
|
|
|
exec("git rev-list --all | wc -l", function(a,b,c){rev = b});
|
|
|
|
var gstatus;
|
|
|
|
dbot.api.github.githubStatus(function(a){gstatus = a});
|
|
|
|
|
|
|
|
/* TODO: merge back into github module */
|
|
|
|
var milestones;
|
|
|
|
request("https://api.github.com/repos/" + dbot.config.github.defaultrepo + "/milestones", function(e, r, b){
|
|
|
|
milestones = JSON.parse(b);
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2013-04-18 13:06:13 +02:00
|
|
|
return {
|
|
|
|
'/project': function(req, res) {
|
|
|
|
res.render('project', {
|
|
|
|
"name": dbot.config.name,
|
2013-04-18 13:45:15 +02:00
|
|
|
"curr839": dbot.config.language,
|
2013-04-18 13:06:13 +02:00
|
|
|
"currver": dbot.config.version,
|
2013-04-18 13:45:15 +02:00
|
|
|
"currlang": dbot.t("dbotspeaks",{
|
|
|
|
"lang839": dbot.config.language,
|
|
|
|
"langen": dbot.strings[dbot.config.language]["en"],
|
|
|
|
"lang": dbot.t(dbot.config.language),
|
2013-04-18 13:06:13 +02:00
|
|
|
"name": dbot.config.name
|
|
|
|
}),
|
2013-04-18 13:45:15 +02:00
|
|
|
"projectstatus": dbot.t("projectstatus"),
|
|
|
|
"revnum": dbot.t("revnum",{
|
2013-04-18 13:06:13 +02:00
|
|
|
"name": dbot.config.name,
|
|
|
|
"rev": rev,
|
|
|
|
"ver": "abcdef" // TODO, obviously
|
|
|
|
}),
|
|
|
|
"modules": dbot.config.moduleNames,
|
2013-04-18 13:45:15 +02:00
|
|
|
"loadmod": dbot.t("loadedmodules"),
|
2013-04-18 16:30:00 +02:00
|
|
|
"debugmode": dbot.t("debugmode-" + dbot.config.debugMode),
|
|
|
|
"githubstatus": gstatus,
|
|
|
|
"milestones": milestones,
|
|
|
|
"milestoneprog": dbot.t("milestoneprog"),
|
|
|
|
"config": dbot.t("configoptions"),
|
|
|
|
"milestonename": dbot.t("milestonename"),
|
|
|
|
"openmilestone": dbot.t("openmilestone"),
|
|
|
|
"closedmilestone": dbot.t("closedmilestone")
|
|
|
|
|
2013-04-18 13:06:13 +02:00
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.fetch = function(dbot) {
|
|
|
|
return pages(dbot);
|
|
|
|
};
|