From 30b2f55ebc2f8196553b471ef2084a133f1936c4 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 29 Sep 2014 19:04:28 -0400 Subject: [PATCH] closed #2149 --- src/meta.js | 5 ++++- src/middleware/index.js | 11 +---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/meta.js b/src/meta.js index be696ca98f..357c4a432e 100644 --- a/src/meta.js +++ b/src/meta.js @@ -2,6 +2,8 @@ var async = require('async'), winston = require('winston'), + templates = require('templates.js'), + user = require('./user'), groups = require('./groups'), plugins = require('./plugins'), @@ -38,7 +40,8 @@ var async = require('async'), async.apply(Meta.js.minify, false), async.apply(Meta.css.minify), async.apply(Meta.templates.compile), - async.apply(auth.reloadRoutes) + async.apply(auth.reloadRoutes), + async.apply(templates.flush) ], next); } ], function(err) { diff --git a/src/middleware/index.js b/src/middleware/index.js index 7f5eb46ddb..c21dd0cbbe 100644 --- a/src/middleware/index.js +++ b/src/middleware/index.js @@ -42,16 +42,7 @@ function routeCurrentTheme(app, themeId, themesData) { winston.info('[themes] Using theme ' + themeId); } - // Theme's 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); + meta.themes.setPath(themeObj); } module.exports = function(app, data) {