diff --git a/modules/project/pages.js b/modules/project/pages.js new file mode 100644 index 0000000..c35ac54 --- /dev/null +++ b/modules/project/pages.js @@ -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 = "" + 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); +}; diff --git a/modules/project/project.js b/modules/project/project.js new file mode 100644 index 0000000..7f4c498 --- /dev/null +++ b/modules/project/project.js @@ -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); +} diff --git a/modules/project/strings.json b/modules/project/strings.json new file mode 100644 index 0000000..6c8119f --- /dev/null +++ b/modules/project/strings.json @@ -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" + } +} diff --git a/views/project/project.jade b/views/project/project.jade new file mode 100644 index 0000000..70a81ee --- /dev/null +++ b/views/project/project.jade @@ -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}