mirror of
https://github.com/reality/dbot.git
synced 2024-12-24 19:52:36 +01:00
push out WIP
This commit is contained in:
parent
787480647d
commit
2a4698c982
44
modules/project/pages.js
Normal file
44
modules/project/pages.js
Normal file
@ -0,0 +1,44 @@
|
||||
var exec = require('child_process').exec;
|
||||
|
||||
var pages = function(dbot) {
|
||||
var lang = dbot.config.language;
|
||||
/*
|
||||
var modules = function() {
|
||||
var modlist = dbot.config.moduleNames;
|
||||
var formatted = "<ul>"
|
||||
for (var i = 0, i < modlist.length; i++) {
|
||||
formatted += "<li>" + modlist[i] + "</li>;
|
||||
}
|
||||
formatted += "</ul>"
|
||||
return formatted;
|
||||
} */
|
||||
var rev;
|
||||
exec("git rev-list --all | wc -l", function(a,b,c){rev = b});
|
||||
return {
|
||||
'/project': function(req, res) {
|
||||
res.render('project', {
|
||||
"name": dbot.config.name,
|
||||
"curr839": lang,
|
||||
"currver": dbot.config.version,
|
||||
"currlang": dbot.strings["dbotspeaks"][lang].format({ // dbot.t won't work s;
|
||||
"lang839": lang,
|
||||
"langen": dbot.strings[lang]["en"],
|
||||
"lang": dbot.strings[lang][lang],
|
||||
"name": dbot.config.name
|
||||
}),
|
||||
"projectstatus": dbot.strings["projectstatus"][lang],
|
||||
"revnum": dbot.strings["revnum"][lang].format({
|
||||
"name": dbot.config.name,
|
||||
"rev": rev,
|
||||
"ver": "abcdef" // TODO, obviously
|
||||
}),
|
||||
"modules": dbot.config.moduleNames,
|
||||
"loadmod": dbot.strings["loadedmodules"][lang]
|
||||
});
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
exports.fetch = function(dbot) {
|
||||
return pages(dbot);
|
||||
};
|
14
modules/project/project.js
Normal file
14
modules/project/project.js
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Module Name: imgur
|
||||
* Description: Various imgur functionality
|
||||
*/
|
||||
|
||||
var _ = require('underscore')._,
|
||||
request = require('request');
|
||||
|
||||
var project = function(dbot) {
|
||||
// nothing to see here go away love zuzak
|
||||
}
|
||||
exports.fetch = function(dbot) {
|
||||
return new project(dbot);
|
||||
}
|
36
modules/project/strings.json
Normal file
36
modules/project/strings.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"dbotspeaks": {
|
||||
"en": "{name} speaks {lang} ({langen})",
|
||||
"de": "{name} spricht {lang} ({langen})",
|
||||
"fr": "{name} parle {lang} ({langen})"
|
||||
},
|
||||
"en": {
|
||||
"en": "English",
|
||||
"fr": "anglais",
|
||||
"de": "Englisch"
|
||||
},
|
||||
"fr": {
|
||||
"en": "French",
|
||||
"fr": "français",
|
||||
"de": "Französisch"
|
||||
},
|
||||
"de": {
|
||||
"en": "German",
|
||||
"fr": "allemande",
|
||||
"de": "Deutsch"
|
||||
},
|
||||
"projectstatus": {
|
||||
"en": "Project Status",
|
||||
"fr": "Situation du Projet",
|
||||
"de": "Projektstatus"
|
||||
},
|
||||
"revnum": {
|
||||
"en": "{name} is at revision {rev} ({ver})",
|
||||
"fr": "{name} est à révision {rev} ({ver})",
|
||||
"de": "{name} ist in der Revision {rev} ({ver})"
|
||||
},
|
||||
"loadedmodules": {
|
||||
"en": "Loaded modules",
|
||||
"fr": "Modules chargés"
|
||||
}
|
||||
}
|
19
views/project/project.jade
Normal file
19
views/project/project.jade
Normal file
@ -0,0 +1,19 @@
|
||||
extends ../layout
|
||||
|
||||
block content
|
||||
h2 #{projectstatus}
|
||||
section#git
|
||||
h3 Git
|
||||
p
|
||||
#{revnum}
|
||||
section#config
|
||||
h3 Configuration
|
||||
ul
|
||||
li #{currlang}
|
||||
h4 #{loadmod}
|
||||
ul
|
||||
each module in modules
|
||||
li #{module}
|
||||
section#footer
|
||||
p
|
||||
#{currver}
|
Loading…
Reference in New Issue
Block a user