Add more configuration splurge

+ Added dependency on underscore
+ Added displaying of some configuration options for dent, link, quotes,
  report and web
+ Translated (badly) the word "Milestones"
* Translated and moved the github advert to below the milestones
This commit is contained in:
Douglas Gardner 2013-04-19 10:55:20 +00:00
parent a61a2300ab
commit bddb7ccce4
3 changed files with 65 additions and 7 deletions

View File

@ -1,5 +1,6 @@
var exec = require('child_process').exec, var exec = require('child_process').exec,
request = require('request'); request = require('request'),
_ = require('underscore');
var pages = function(dbot) { var pages = function(dbot) {
var quoteCat = dbot.db.quoteArrs[dbot.config.name], var quoteCat = dbot.db.quoteArrs[dbot.config.name],
@ -14,7 +15,39 @@ var pages = function(dbot) {
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;
request("https://api.github.com/repos/" + dbot.config.github.defaultrepo + "/milestones?state=open", function(error, response, body){ request("https://api.github.com/repos/" + dbot.config.github.defaultrepo + "/milestones?state=open", function(error, response, body){
@ -30,6 +63,7 @@ var pages = function(dbot) {
} }
res.render('project', { res.render('project', {
"configList": configList,
"name": dbot.config.name, "name": dbot.config.name,
"intro": dbot.t("dbotintro", { "intro": dbot.t("dbotintro", {
"botname": dbot.config.name "botname": dbot.config.name

View File

@ -115,7 +115,10 @@
"it": "Nome" "it": "Nome"
}, },
"milestones": { "milestones": {
"en": "Milestones" "en": "Milestones",
"it": "tappe",
"fr": "étapes",
"de": "Etappenziele"
}, },
"development": { "development": {
"en": "Development", "en": "Development",
@ -131,6 +134,26 @@
}, },
"propaganda": { "propaganda": {
"en": "Contribute via Github!", "en": "Contribute via Github!",
"fr": "Contribuer via Github!" "fr": "Contribuer via Github!",
"it": "Contribuire con Github!",
"de": "Beisteuern Github"
},
"dent-account": {
"en": "{name} dents as @{username}"
},
"dent-push": {
"en": "Quotes are automatically dented"
},
"link-autotitle": {
"en": "Links are automatically titled"
},
"quote-rmlimit": {
"en": "Quote removal throttle set to {limit}"
},
"report-notifyvoice": {
"en": "Reports are sent to voiced users"
},
"web-port": {
"en": "Running web interface on {port}"
} }
} }

View File

@ -20,9 +20,6 @@ html(lang='#{curr839}')
h4 #{git} h4 #{git}
p.center p.center
#{revnum} #{revnum}
p.center
a(href="https://github.com/"+repo) #{propaganda}
ul ul
li #{branch} li #{branch}
pre#gitdiff pre#gitdiff
@ -47,11 +44,15 @@ html(lang='#{curr839}')
print #{Math.round(width)+"%"} print #{Math.round(width)+"%"}
td #{milestone.open_issues} td #{milestone.open_issues}
td #{milestone.closed_issues} td #{milestone.closed_issues}
p.center
a(href="https://github.com/"+repo) #{propaganda}
section#config section#config
h3 #{config} h3 #{config}
ul ul
li #{currlang} li #{currlang}
li #{debugmode} li #{debugmode}
each message in configList
li #{message}
h4 #{loadmod} h4 #{loadmod}
ul#modules ul#modules
each module in modules each module in modules