allow custom themes to include templates that don't exist in the base theme

v1.18.x
psychobunny 11 years ago
parent fb7e0bb7c2
commit eab0ca7463

@ -95,10 +95,11 @@ function compileTemplates(pluginTemplates) {
themeTpls = !themeTpls ? [] : themeTpls.map(function(tpl) { return tpl.replace(nconf.get('theme_templates_path'), ''); });
baseTpls.forEach(function(el, i) {
var relative_path = (themeTpls.indexOf(el) !== -1 ? themeTpls[themeTpls.indexOf(el)] : baseTpls[i]),
full_path = path.join(themeTpls.indexOf(el) !== -1 ? nconf.get('theme_templates_path') : nconf.get('base_templates_path'), relative_path);
paths[baseTpls[i]] = path.join(nconf.get('base_templates_path'), baseTpls[i]);
});
paths[themeTpls.indexOf(el) !== -1 ? themeTpls[themeTpls.indexOf(el)] : baseTpls[i]] = full_path;
themeTpls.forEach(function(el, i) {
paths[themeTpls[i]] = path.join(nconf.get('theme_templates_path'), themeTpls[i]);
});
async.each(Object.keys(paths), function(relative_path, next) {

Loading…
Cancel
Save