templates refactor part 2

updated so that tpls get loaded on demand as opposed to all at once on
load; added a function to pull the tpl list on load instead of having to
manually define new templates in code; some clean up; added utils.walk;
This commit is contained in:
psychobunny
2013-05-17 15:20:08 -04:00
parent ba8e0ea420
commit fb52dfc6c8
6 changed files with 123 additions and 73 deletions

View File

@@ -108,6 +108,11 @@ var express = require('express'),
function api_method(req, res) {
switch(req.params.method) {
case 'get_templates_listing' :
utils.walk(global.configuration.ROOT_DIRECTORY + '/public/templates', function(err, data) {
res.send(JSON.stringify(data));
});
break;
case 'home' :
categories.get(function(data) {
res.send(JSON.stringify(data));