From 2a4698c982e586e2bb0c792f5dc8c05c9f41d6a8 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Thu, 18 Apr 2013 11:06:13 +0000 Subject: [PATCH] push out WIP --- modules/project/pages.js | 44 ++++++++++++++++++++++++++++++++++++ modules/project/project.js | 14 ++++++++++++ modules/project/strings.json | 36 +++++++++++++++++++++++++++++ views/project/project.jade | 19 ++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 modules/project/pages.js create mode 100644 modules/project/project.js create mode 100644 modules/project/strings.json create mode 100644 views/project/project.jade 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}