diff --git a/modules/github b/modules/github index e9e9089..7e38c6b 160000 --- a/modules/github +++ b/modules/github @@ -1 +1 @@ -Subproject commit e9e9089f282b0455a481460ebec17a4672617ceb +Subproject commit 7e38c6be750a071724763872175f1a9445297b76 diff --git a/modules/project/config.json b/modules/project/config.json new file mode 100644 index 0000000..f31a1c9 --- /dev/null +++ b/modules/project/config.json @@ -0,0 +1,4 @@ +{ + "quotecat":"depressionbot", + "dependencies": ["web", "quotes", "github"] +} diff --git a/modules/project/pages.js b/modules/project/pages.js new file mode 100644 index 0000000..e2dfd3c --- /dev/null +++ b/modules/project/pages.js @@ -0,0 +1,62 @@ +var exec = require('child_process').exec, + request = require('request'); + +var pages = function(dbot) { + var depression = dbot.db.quoteArrs[dbot.config.project.quotecat]; + + var rev; + exec("git rev-list --all | wc -l", function(a,b,c){rev = b}); + var diff; + exec("git log -1", function(a, b, c){diff = b}); + + /* TODO: merge back into github module */ + var milestones; + request("https://api.github.com/repos/" + dbot.config.github.defaultrepo + "/milestones?state=open", function(e, r, b){ + milestones = JSON.parse(b); + }); + + + return { + '/project': function(req, res) { + res.render('project', { + "name": dbot.config.name, + "intro": dbot.t("dbotintro", { + "botname": dbot.config.name + }), + "curr839": dbot.config.language, + "currver": dbot.config.version, + "currlang": dbot.t("dbotspeaks",{ + "lang839": dbot.config.language, + "langen": dbot.strings[dbot.config.language]["en"], + "lang": dbot.t(dbot.config.language), + "name": dbot.config.name + }), + "projectstatus": dbot.t("projectstatus"), + "revnum": dbot.t("revnum",{ + "name": dbot.config.name, + "rev": rev, + "ver": "abcdef" // TODO, obviously + }), + "modules": dbot.config.moduleNames, + "loadmod": dbot.t("loadedmodules"), + "debugmode": dbot.t("debugmode-" + dbot.config.debugMode), + "milestones": milestones, + "milestoneprog": dbot.t("milestoneprog"), + "config": dbot.t("configoptions"), + "milestonename": dbot.t("milestonename"), + "openmilestone": dbot.t("openmilestone"), + "closedmilestone": dbot.t("closedmilestone"), + "development": dbot.t("development"), + "dquote": depression[Math.floor(Math.random()*depression.length)], + "diff": diff, + "pagetitle": dbot.t("pagetitle", { + "botname": dbot.config.name + }) + }); + }, + }; +}; + +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..a720281 --- /dev/null +++ b/modules/project/strings.json @@ -0,0 +1,100 @@ +{ + "dbotintro": { + "en": "{botname} lorem ipsum dolor sit amet" + }, + "dbotspeaks": { + "en": "{name} speaks {lang})", + "de": "{name} spricht {lang} ({langen})", + "fr": "{name} parle {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": "English", + "fr": "anglais", + "de": "Englisch", + "it": "inglese" + }, + "fr": { + "en": "French", + "fr": "français", + "de": "Französisch", + "it": "francese" + }, + "de": { + "en": "German", + "fr": "allemande", + "de": "Deutsch", + "it": "tedesco" + }, + "it": { + "en": "Italian", + "fr": "italien", + "de": "Italienier", + "it": "italiano" + }, + "revnum": { + "en": "{name} is at revision {rev}", + "fr": "{name} est à révision {rev}", + "de": "{name} ist in der Revision {rev}", + "it": "{name} il numero di revisione {rev}" + }, + "loadedmodules": { + "en": "loaded modules", + "fr": "modules chargés", + "it": "moduli caricati" + }, + "configoptions": { + "en": "Configuration", + "fr": "Configuration", + "de": "Konfiguration", + "it": "Configuazione" + }, + "debugmode-true": { + "en": "Debug mode active", + "fr": "debug actif", + "de": "Debug aktiv", + "it": "debug attivo" + }, + "debugmode-false": { + "en": "Debug off", + "fr": "debug éteint", + "de": "Debug ausgeschaltet", + "it": "debug spento" + }, + "milestoneprog": { + "en": "Progress", + "fr": "Progression", + "de": "Fortschritt", + "it": "sviluppo" + }, + "openmilestone": { + "en": "Open", + "fr": "Ouvert", + "de": "Offen", + "it": "Aperto" + }, + "closedmilestone": { + "en": "Closed", + "fr": "Fermé", + "de": "Gesperrt", + "it": "Chiuso" + }, + "milestonename": { + "en": "Name", + "fr": "Nom", + "de": "Name", + "it": "Nome" + }, + "development": { + "en": "Development", + "fr": "Développement", + "de": "Entwicklung", + "it": "Sviluppo" + } +} diff --git a/public/project.css b/public/project.css new file mode 100644 index 0000000..7f769ef --- /dev/null +++ b/public/project.css @@ -0,0 +1,63 @@ +pre#gitdiff { + text-align:left; + width:80; + margin:auto; +} +div#main { + text-align:inherit; + font-size:18px; +} +h2,h3,h4,h5,h6,.center { + text-align:center; +} +table#milestones { + margin:auto; + width:80%; +} +table#milestones td { + padding:5px; +} +p.intro { + text-align:center; + border:1px solid #ccc; + padding:20px; + border-radius:4px; +} +div.progress.open { + background-image: linear-gradient(to bottom,#f4fff4,#f9fff9); +} +div.progress { + margin-top:auto; + margin-bottom:auto; +} +div.progress-inner.open { + width:20%; + background-image: linear-gradient(to bottom,#3fff3f,#7fff7f); +} +div.progress.closed { + background-image: linear-gradient(to bottom,#fff5f5,#fff9f9); +} +div.progress-inner.closed { + background-image: linear-gradient(to bottom,#ff3f3f,#ff7f7f); + width:20%; +} + +#config { + text-align:center; +} + +li { + background-image: linear-gradient(to bottom, #f5ebe2, #f5e6d8); + border:1px solid #f5dcc5; + padding:5px; + margin:5px; + display:inline-block; +} + +* { + text-shadow:none; +} + +#footer { + font-size:80%; +} diff --git a/public/styles.css b/public/styles.css index 50f73bd..5786bcc 100644 --- a/public/styles.css +++ b/public/styles.css @@ -13,7 +13,6 @@ body { margin: 0; font-family: "Source Sans Pro", sans-serif; color: #444; - text-shadow: 1px 1px 2px #2B2B2B; background: url("background.jpg") no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; @@ -133,7 +132,6 @@ li.quote { padding: 6px; font-size: 18px; width: 40%; - text-shadow: 1px 1px 1px black; } img { diff --git a/views/project/project.jade b/views/project/project.jade new file mode 100644 index 0000000..d86f06a --- /dev/null +++ b/views/project/project.jade @@ -0,0 +1,64 @@ +!!! +html(lang='#{curr839}') + head + meta(charset='utf-8') + script(type="text/javascript", src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js") + link(rel="stylesheet", type="text/css", href="http://fonts.googleapis.com/css?family=Source+Sans+Pro") + link(rel="stylesheet", type="text/css", href="/bootstrap/css/bootstrap.min.css") + link(rel='stylesheet', type='text/css', href='/styles.css') + link(rel="stylesheet", href="/project.css") + title #{pagetitle} + - var mstone = "milestone" + style(type="text/css") + each milestone in milestones + - current = mstone+milestone.number + - wdth = ((milestone.open_issues/(milestone.open_issues + milestone.closed_issues))*100) + .current { width: wdth% } + body + div.container + div#page + div#title #{pagetitle} + div.container#main + p.intro + #{dquote} + section#git + h3 #{development} + p.center + #{revnum} + pre#gitdiff + #{diff} + 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) +   + td #{milestone.open_issues} + td #{milestone.closed_issues} + section#config + h3 #{config} + ul + li #{currlang} + li #{debugmode} + h4 #{loadmod} + ul#modules + 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")