Merge branch '0.5.1' into csrf-excision

This commit is contained in:
Julian Lam
2014-09-17 14:39:51 -04:00
282 changed files with 2219 additions and 473 deletions

View File

@@ -63,7 +63,15 @@ function routeCurrentTheme(app, themeId, themesData) {
}
// Theme's templates path
nconf.set('theme_templates_path', themeObj.templates ? path.join(themesPath, themeObj.id, themeObj.templates) : nconf.get('base_templates_path'));
var themePath = nconf.get('base_templates_path'),
fallback = path.join(themesPath, themeObj.id, 'templates');
if (themeObj.templates) {
themePath = path.join(themesPath, themeObj.id, themeObj.templates);
} else if (fs.existsSync(fallback)) {
themePath = fallback;
}
nconf.set('theme_templates_path', themePath);
}
module.exports = function(app, data) {