diff --git a/modules/project/pages.js b/modules/project/pages.js index 944064f..084a2d5 100644 --- a/modules/project/pages.js +++ b/modules/project/pages.js @@ -15,16 +15,6 @@ var pages = function(dbot) { } }); - var trans = []; - // THIS IS TOTALLY LEGIT AND OPTIMISED CODE - /* for (var j = 0; j < Object.keys(dbot.strings).length; j++) { - var str = dbot.strings.j; - for (var k = 0; k < Object.keys(dbot.strings.str).length; k++) { - var lang = str.lang; - trans[lang]++; - } - } */ - exec("git rev-list --all | wc -l", function(error, stdout, stderr) { rev = stdout; }); @@ -55,7 +45,7 @@ var pages = function(dbot) { res.render('project', { "translation": dbot.modules.project.api.translationProgress(), "configList": dbot.modules.project.api.configList(), - "authors": authors, //dbot.modules.project.api.getAuthors(), + "authors": authors, "credits": dbot.t("credits"), "thanks": dbot.t("thanks"), "name": dbot.config.name, diff --git a/modules/project/project.js b/modules/project/project.js index b177dbe..5d6c3a7 100644 --- a/modules/project/project.js +++ b/modules/project/project.js @@ -43,7 +43,7 @@ var project = function(dbot) { return list; }, 'translationProgress' : function(callback){ - var translation = []; + var translation = [] ; var str = _.values(dbot.strings); for (var i = 0; i < str.length; i++){ var cur = _.keys(str[i]); @@ -51,22 +51,20 @@ var project = function(dbot) { translation = translation.concat(cur[j]); } } - // optimise this, someone who isn't me - var t = []; + var t = {}; for (var k = 0; k < str.length; k++) { var curr = translation[k]; if (t[curr]) { t[curr]["count"] += 1; } else { - t[curr] = []; - // t[curr]["839"] = curr; + t[curr] = {}; + t[curr]["iso"] = curr; t[curr]["count"] = 1; t[curr]["own"] = dbot.strings[curr][curr]; t[curr]["local"] = dbot.t(curr); t[curr]["english"] = dbot.strings[curr]["en"]; } } - _.compact(t); console.log(t); return t; } diff --git a/public/project.css b/public/project.css index b0793a8..9049548 100644 --- a/public/project.css +++ b/public/project.css @@ -9,11 +9,11 @@ div#main { h2,h3,h4,h5,h6,.center { text-transform:lowercase; } -table#milestones { +table { margin:auto; width:80%; } -table#milestones td { +table td { padding:5px; } p.intro { @@ -31,6 +31,7 @@ div.progress { text-align:left; font-size:50%; color:gray; + min-width:200px; } div.progress-inner.open { background-color: #3fff3f; diff --git a/views/project/project.jade b/views/project/project.jade index 02c18bc..3743218 100644 --- a/views/project/project.jade +++ b/views/project/project.jade @@ -52,9 +52,28 @@ html(lang='#{curr839}') td #{milestone.open_issues} td #{milestone.closed_issues} h4 Translations - ul - each key in translation - li #{translation[0][1]} + table + tr + th Current + th Native + th English + th Progress + th Translations + each language in translation + - var w = ((language.count/translation.en.count)*100) + tr + td #{language.local} + td #{language.own} + td #{language.english} + td.prog + div.progress(class="open") + unless (language.iso == curr839) + div.progress-inner(style="width:"+w+"%")(class="open") +   + else + div.progress-inner(style="width:"+w+"%")(class="closed") +   + td #{language.count} / #{translation.en.count} h4 #{credits} #{thanks} ul