Format stuff

## Changelog:

 - Remove Github status call.
 + Closed issues
 + Localised <h1>
 + Add introductory paragraph
 + Add last diff to page
 - Remove jade include to layout.jade
 + Dynamic language metadata
 + CSS
 + Progress bars

 ## Known issues:
 * Loading the closed milestones raises an exception for some reason;
   in a try-catch for now, unsure how to fix.

 ## Still to do:
 * Style loaded modules section (columns?)
 * Shrink footer
 * Do we need a shorthand hash by the revision?
 * Pull req count? (low priority)
This commit is contained in:
Douglas Gardner 2013-04-18 16:12:01 +00:00
parent 985b53c768
commit f7dbe77838
3 changed files with 92 additions and 43 deletions

View File

@ -3,14 +3,21 @@ var exec = require('child_process').exec,
var pages = function(dbot) { var pages = function(dbot) {
var rev; 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; var diff;
dbot.api.github.githubStatus(function(a){gstatus = a}); exec("git log -1", function(a, b, c){diff = b});
/* 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", function(e, r, b){ request("https://api.github.com/repos/" + dbot.config.github.defaultrepo + "/milestones", function(e, r, b){
milestones = JSON.parse(b); milestones = JSON.parse(b);
request("https://api.github.com/repos/" + dbot.config.github.defaultrepo + "/milestones?state=closed", function (a, c, d){
var milestones2 = [];
try{
milestones2 = JSON.parse(c);
} catch(e){}
milestones = milestones.concat(milestones2)
});
}); });
@ -18,6 +25,9 @@ var pages = function(dbot) {
'/project': function(req, res) { '/project': function(req, res) {
res.render('project', { res.render('project', {
"name": dbot.config.name, "name": dbot.config.name,
"intro": dbot.t("dbotintro", {
"botname": dbot.config.name
}),
"curr839": dbot.config.language, "curr839": dbot.config.language,
"currver": dbot.config.version, "currver": dbot.config.version,
"currlang": dbot.t("dbotspeaks",{ "currlang": dbot.t("dbotspeaks",{
@ -35,14 +45,16 @@ var pages = function(dbot) {
"modules": dbot.config.moduleNames, "modules": dbot.config.moduleNames,
"loadmod": dbot.t("loadedmodules"), "loadmod": dbot.t("loadedmodules"),
"debugmode": dbot.t("debugmode-" + dbot.config.debugMode), "debugmode": dbot.t("debugmode-" + dbot.config.debugMode),
"githubstatus": gstatus,
"milestones": milestones, "milestones": milestones,
"milestoneprog": dbot.t("milestoneprog"), "milestoneprog": dbot.t("milestoneprog"),
"config": dbot.t("configoptions"), "config": dbot.t("configoptions"),
"milestonename": dbot.t("milestonename"), "milestonename": dbot.t("milestonename"),
"openmilestone": dbot.t("openmilestone"), "openmilestone": dbot.t("openmilestone"),
"closedmilestone": dbot.t("closedmilestone") "closedmilestone": dbot.t("closedmilestone"),
"diff": diff,
"pagetitle": dbot.t("pagetitle", {
"botname": dbot.config.name
})
}); });
}, },
}; };

View File

@ -1,10 +1,19 @@
{ {
"dbotintro": {
"en": "{botname} lorem ipsum dolor sit amet"
},
"dbotspeaks": { "dbotspeaks": {
"en": "{name} speaks {lang} ({langen})", "en": "{name} speaks {lang} ({langen})",
"de": "{name} spricht {lang} ({langen})", "de": "{name} spricht {lang} ({langen})",
"fr": "{name} parle {lang} ({langen})", "fr": "{name} parle {lang} ({langen})",
"it": "{name} parla {lang} ({langen})" "it": "{name} parla {lang} ({langen})"
}, },
"pagetitle": {
"en": "{botname} web interface",
"fr": "{botname} interface réseau",
"de": "{botname} Web-Interface",
"it": "{botname} interfaccia web"
},
"en": { "en": {
"en": "English", "en": "English",
"fr": "anglais", "fr": "anglais",
@ -29,12 +38,6 @@
"de": "Italienier", "de": "Italienier",
"it": "italiano" "it": "italiano"
}, },
"projectstatus": {
"en": "project status",
"fr": "situation du projet",
"de": "Projektstatus",
"it": "stato del progetto"
},
"revnum": { "revnum": {
"en": "{name} is at revision {rev} ({ver})", "en": "{name} is at revision {rev} ({ver})",
"fr": "{name} est à révision {rev} ({ver})", "fr": "{name} est à révision {rev} ({ver})",

View File

@ -1,31 +1,65 @@
extends ../layout !!!
html(lang='#{curr839}')
block content head
h2 #{projectstatus} meta(charset='utf-8')
section#git script(type="text/javascript", src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js")
h3 Git link(rel="stylesheet", type="text/css", href="http://fonts.googleapis.com/css?family=Source+Sans+Pro")
p link(rel="stylesheet", type="text/css", href="/bootstrap/css/bootstrap.min.css")
#{revnum} link(rel='stylesheet', type='text/css', href='/styles.css')
h4 #{milestoneprog} link(rel="stylesheet", href="/project.css")
table title #{pagetitle}
tr script(type="text/javascript", src="/project.js")
th #{milestonename} - var mstone = "milestone"
th #{openmilestone} style(type="text/css")
th #{closedmilestone} each milestone in milestones
each milestone in milestones - current = mstone+milestone.number
tr - wdth = ((milestone.open_issues/(milestone.open_issues + milestone.closed_issues))*100)
td #{milestone.title} .current { width: wdth% }
td #{milestone.open_issues} body
td #{milestone.closed_issues} div.container
section#config div#page
h3 #{config} div#title #{pagetitle}
ul div.container#main
li #{currlang} p.intro
li #{debugmode} #{intro}
h4 #{loadmod} section#git
ul h3 Git
each module in modules p.center
li #{module} #{revnum}
section#footer pre#gitdiff
p #{diff}
#{currver} h4 #{milestoneprog}
table#milestones.center
tr
th #{milestonename}
th #{milestoneprog}
th #{openmilestone}
th #{closedmilestone}
each milestone in milestones
- var mstone = "milestone"
- var wd = "width:"
- var pc = "%"
- var wdth = ((milestone.closed_issues/(milestone.open_issues + milestone.closed_issues))*100)
tr(id=mstone+milestone.number)
td #{milestone.title}
td
div.progress(class=milestone.state)
div.progress-inner(style=wd+wdth+pc)(class=milestone.state)
&nbsp;
td #{milestone.open_issues}
td #{milestone.closed_issues}
section#config
h3 #{config}
ul
li #{currlang}
li #{debugmode}
h4 #{loadmod}
ul
each module in modules
li #{module}
section#footer
p
#{currver}
script(type="text/javascript", src="/bootstrap/js/bootstrap.min.js")
script(type="text/javascript", src="/d3/d3.v3.min.js")
script(type="text/javascript", src="/script.js")