diff --git a/app.js b/app.js index b47935376d..6ccc6098f6 100644 --- a/app.js +++ b/app.js @@ -99,6 +99,7 @@ function loadConfig() { // Ensure themes_path is a full filepath nconf.set('themes_path', path.resolve(__dirname, nconf.get('themes_path'))); + nconf.set('core_templates_path', path.join(__dirname, 'src/views')); nconf.set('base_templates_path', path.join(nconf.get('themes_path'), 'nodebb-theme-vanilla/templates')); } diff --git a/src/meta/templates.js b/src/meta/templates.js index 4851d19016..16195c9aef 100644 --- a/src/meta/templates.js +++ b/src/meta/templates.js @@ -21,7 +21,8 @@ Templates.compile = function(callback) { }, 1000); } - var baseTemplatesPath = nconf.get('base_templates_path'), + var coreTemplatesPath = nconf.get('core_templates_path'), + baseTemplatesPath = nconf.get('base_templates_path'), viewsPath = nconf.get('views_dir'), themeTemplatesPath = nconf.get('theme_templates_path'); @@ -31,6 +32,9 @@ Templates.compile = function(callback) { mkdirp.sync(viewsPath); async.parallel({ + coreTpls: function(next) { + utils.walk(coreTemplatesPath, next); + }, baseTpls: function(next) { utils.walk(baseTemplatesPath, next); }, @@ -38,7 +42,8 @@ Templates.compile = function(callback) { utils.walk(themeTemplatesPath, next); } }, function(err, data) { - var baseTpls = data.baseTpls, + var coreTpls = data.coreTpls, + baseTpls = data.baseTpls, themeTpls = data.themeTpls, paths = {}; @@ -46,9 +51,14 @@ Templates.compile = function(callback) { winston.warn('[meta/templates] Could not find base template files at: ' + baseTemplatesPath); } + coreTpls = !coreTpls ? [] : coreTpls.map(function(tpl) { return tpl.replace(coreTemplatesPath, ''); }); baseTpls = !baseTpls ? [] : baseTpls.map(function(tpl) { return tpl.replace(baseTemplatesPath, ''); }); themeTpls = !themeTpls ? [] : themeTpls.map(function(tpl) { return tpl.replace(themeTemplatesPath, ''); }); + coreTpls.forEach(function(el, i) { + paths[coreTpls[i]] = path.join(coreTemplatesPath, coreTpls[i]); + }); + baseTpls.forEach(function(el, i) { paths[baseTpls[i]] = path.join(baseTemplatesPath, baseTpls[i]); }); diff --git a/src/views/403.tpl b/src/views/403.tpl new file mode 100644 index 0000000000..46478a224c --- /dev/null +++ b/src/views/403.tpl @@ -0,0 +1,4 @@ +
[[global:403.message]]
+[[global:404.message]]
+[[global:500.message]]
+{errorMessage}
+{raw}
+{raw}
+
+{eventdata}
+
\ No newline at end of file
diff --git a/src/views/admin/footer.tpl b/src/views/admin/footer.tpl
new file mode 100644
index 0000000000..df590eb6f9
--- /dev/null
+++ b/src/views/admin/footer.tpl
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+