From 985b53c768dcbe1eb42b3119699f295b451fc5c7 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Thu, 18 Apr 2013 14:30:00 +0000 Subject: [PATCH] Add milestone + Bump github + Fix Italian translation of revision count + Add translation of git to strings.json (bonus points if you find a language that needs it) --- modules/github | 2 +- modules/project/pages.js | 25 ++++++++++++++++++++++--- modules/project/strings.json | 36 +++++++++++++++++++++++++++++++++--- views/project/project.jade | 15 +++++++++++++-- 4 files changed, 69 insertions(+), 9 deletions(-) diff --git a/modules/github b/modules/github index e9e9089..7e38c6b 160000 --- a/modules/github +++ b/modules/github @@ -1 +1 @@ -Subproject commit e9e9089f282b0455a481460ebec17a4672617ceb +Subproject commit 7e38c6be750a071724763872175f1a9445297b76 diff --git a/modules/project/pages.js b/modules/project/pages.js index eb6149c..c5b64ca 100644 --- a/modules/project/pages.js +++ b/modules/project/pages.js @@ -1,8 +1,19 @@ -var exec = require('child_process').exec; +var exec = require('child_process').exec, + request = require('request'); var pages = function(dbot) { var rev; - exec("git rev-list --all | wc -l", function(a,b,c){rev = b}); + 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); + }); + + return { '/project': function(req, res) { res.render('project', { @@ -23,7 +34,15 @@ var pages = function(dbot) { }), "modules": dbot.config.moduleNames, "loadmod": dbot.t("loadedmodules"), - "debugmode": dbot.t("debugmode-" + dbot.config.debugMode) + "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") + }); }, }; diff --git a/modules/project/strings.json b/modules/project/strings.json index 592ba0c..1214a67 100644 --- a/modules/project/strings.json +++ b/modules/project/strings.json @@ -39,18 +39,18 @@ "en": "{name} is at revision {rev} ({ver})", "fr": "{name} est à révision {rev} ({ver})", "de": "{name} ist in der Revision {rev} ({ver})", - "it": "{name} è il numero di revisione {rev} ({ver})" + "it": "{name} il numero di revisione {rev} ({ver})" }, "loadedmodules": { "en": "loaded modules", "fr": "modules chargés", "it": "moduli caricati" }, - "configuration": { + "configoptions": { "en": "Configuration", "fr": "Configuration", "de": "Konfiguration", - "it": "configuazione" + "it": "Configuazione" }, "debugmode-true": { "en": "Debug mode active", @@ -63,5 +63,35 @@ "fr": "debug éteint", "de": "Debug ausgeschaltet", "it": "debug spento" + }, + "milestoneprog": { + "en": "Progress", + "fr": "Progression", + "de": "Fortschritt", + "it": "sviluppo" + }, + "openmilestone": { + "en": "Open", + "fr": "Ouvert", + "de": "Offen", + "it": "Aperto" + }, + "closedmilestone": { + "en": "Closed", + "fr": "Fermé", + "de": "Gesperrt", + "it": "Chiuso" + }, + "milestonename": { + "en": "Name", + "fr": "Nom", + "de": "Name", + "it": "Nome" + }, + "git": { + "en": "Git", + "fr": "Git", + "de": "Git", + "it": "Git" } } diff --git a/views/project/project.jade b/views/project/project.jade index ecfe3f7..2f1c7ed 100644 --- a/views/project/project.jade +++ b/views/project/project.jade @@ -5,9 +5,20 @@ block content section#git h3 Git p - #{revnum} + #{revnum} + h4 #{milestoneprog} + table + tr + th #{milestonename} + th #{openmilestone} + th #{closedmilestone} + each milestone in milestones + tr + td #{milestone.title} + td #{milestone.open_issues} + td #{milestone.closed_issues} section#config - h3 Configuration + h3 #{config} ul li #{currlang} li #{debugmode}