mirror of
https://github.com/reality/dbot.git
synced 2025-02-13 03:51:24 +01:00
move some stuff to project.js
This commit is contained in:
parent
95e7d0ee80
commit
adcd5803b0
@ -9,44 +9,14 @@ var pages = function(dbot) {
|
|||||||
exec("git rev-list --all | wc -l", function(error, stdout, stderr) {
|
exec("git rev-list --all | wc -l", function(error, stdout, stderr) {
|
||||||
rev = stdout
|
rev = stdout
|
||||||
});
|
});
|
||||||
|
|
||||||
exec("git rev-parse --abbrev-ref HEAD", function(error, stdout, stderr) {
|
exec("git rev-parse --abbrev-ref HEAD", function(error, stdout, stderr) {
|
||||||
branch = stdout
|
branch = stdout
|
||||||
});
|
});
|
||||||
|
|
||||||
exec("git log -1", function(error, stdout, stderr) {
|
exec("git log -1", function(error, stdout, stderr) {
|
||||||
diff = stdout
|
diff = stdout
|
||||||
});
|
});
|
||||||
var configList = [];
|
|
||||||
if(_.has(dbot.modules,'dent')){
|
|
||||||
configList.push(dbot.t("dent-account", {
|
|
||||||
"username": dbot.config.dent.username
|
|
||||||
}));
|
|
||||||
if(dbot.config.dent.dentQuotes) {
|
|
||||||
configList.push(dbot.t("dent-push"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(_.has(dbot.modules,'link')){
|
|
||||||
if(dbot.config.link.autoTitle){
|
|
||||||
configList.push(dbot.t("link-autotitle"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(_.has(dbot.modules,'quotes')){
|
|
||||||
configList.push(dbot.t("quote-rmlimit", {
|
|
||||||
"limit": dbot.config.quotes.rmLimit
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
if(_.has(dbot.modules,'report')){
|
|
||||||
if(dbot.config.report.notifyVoice){
|
|
||||||
configList.push(dbot.t("report-notifyvoice"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(_.has(dbot.modules,'web')){
|
|
||||||
configList.push(dbot.t("web-port", {
|
|
||||||
"port": dbot.config.web.webPort
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* TODO: merge back into github module */
|
/* TODO: merge back into github module */
|
||||||
var milestones;
|
var milestones;
|
||||||
@ -63,7 +33,7 @@ var pages = function(dbot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
res.render('project', {
|
res.render('project', {
|
||||||
"configList": configList,
|
"configList": "", // what variable do I put here
|
||||||
"name": dbot.config.name,
|
"name": dbot.config.name,
|
||||||
"intro": dbot.t("dbotintro", {
|
"intro": dbot.t("dbotintro", {
|
||||||
"botname": dbot.config.name
|
"botname": dbot.config.name
|
||||||
|
@ -4,10 +4,47 @@
|
|||||||
* the dbot.
|
* the dbot.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
_ = require('underscore'),
|
||||||
|
exec = require('child_process').exec;
|
||||||
|
|
||||||
var project = function(dbot) {
|
var project = function(dbot) {
|
||||||
// Nothing to see here go away love zuzak
|
|
||||||
|
this.onLoad = function() {
|
||||||
|
var configList = function(){
|
||||||
|
var list = [];
|
||||||
|
if(_.has(dbot.modules,'dent')){
|
||||||
|
configList.push(dbot.t("dent-account", {
|
||||||
|
"username": dbot.config.dent.username
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
if(dbot.config.dent.dentQuotes) {
|
||||||
|
configList.push(dbot.t("dent-push"));
|
||||||
|
}
|
||||||
|
if(_.has(dbot.modules,'link')){
|
||||||
|
if(dbot.config.link.autoTitle){
|
||||||
|
configList.push(dbot.t("link-autotitle"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_.has(dbot.modules,'quotes')){
|
||||||
|
configList.push(dbot.t("quote-rmlimit", {
|
||||||
|
"limit": dbot.config.quotes.rmLimit
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
if(_.has(dbot.modules,'report')){
|
||||||
|
if(dbot.config.report.notifyVoice){
|
||||||
|
configList.push(dbot.t("report-notifyvoice"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(_.has(dbot.modules,'web')){
|
||||||
|
configList.push(dbot.t("web-port", {
|
||||||
|
"port": dbot.config.web.webPort
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}.bind(this);
|
||||||
|
}.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.fetch = function(dbot) {
|
exports.fetch = function(dbot){
|
||||||
return new project(dbot);
|
return new project(dbot);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user