From bddb7ccce42abfa4e423e4b1b757c59d90a01896 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Fri, 19 Apr 2013 10:55:20 +0000 Subject: [PATCH] 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 --- modules/project/pages.js | 38 ++++++++++++++++++++++++++++++++++-- modules/project/strings.json | 27 +++++++++++++++++++++++-- views/project/project.jade | 7 ++++--- 3 files changed, 65 insertions(+), 7 deletions(-) diff --git a/modules/project/pages.js b/modules/project/pages.js index ee0059b..87dcad4 100644 --- a/modules/project/pages.js +++ b/modules/project/pages.js @@ -1,5 +1,6 @@ var exec = require('child_process').exec, - request = require('request'); + request = require('request'), + _ = require('underscore'); var pages = function(dbot) { var quoteCat = dbot.db.quoteArrs[dbot.config.name], @@ -14,7 +15,39 @@ var pages = function(dbot) { exec("git log -1", function(error, stdout, stderr) { 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 */ var milestones; 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', { + "configList": configList, "name": dbot.config.name, "intro": dbot.t("dbotintro", { "botname": dbot.config.name diff --git a/modules/project/strings.json b/modules/project/strings.json index 0fcc665..4454dce 100644 --- a/modules/project/strings.json +++ b/modules/project/strings.json @@ -115,7 +115,10 @@ "it": "Nome" }, "milestones": { - "en": "Milestones" + "en": "Milestones", + "it": "tappe", + "fr": "étapes", + "de": "Etappenziele" }, "development": { "en": "Development", @@ -131,6 +134,26 @@ }, "propaganda": { "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}" } } diff --git a/views/project/project.jade b/views/project/project.jade index a466143..8dd2ee3 100644 --- a/views/project/project.jade +++ b/views/project/project.jade @@ -20,9 +20,6 @@ html(lang='#{curr839}') h4 #{git} p.center #{revnum} - p.center - a(href="https://github.com/"+repo) #{propaganda} - ul li #{branch} pre#gitdiff @@ -47,11 +44,15 @@ html(lang='#{curr839}') print #{Math.round(width)+"%"} td #{milestone.open_issues} td #{milestone.closed_issues} + p.center + a(href="https://github.com/"+repo) #{propaganda} section#config h3 #{config} ul li #{currlang} li #{debugmode} + each message in configList + li #{message} h4 #{loadmod} ul#modules each module in modules