mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-09 04:36:26 +02:00
get rid of app.exposeConfigToTemplates
This commit is contained in:
@@ -93,15 +93,16 @@ middleware.renderHeader = function(req, res, data, next) {
|
||||
res.locals.config = results.config;
|
||||
|
||||
var templateValues = {
|
||||
relative_path: nconf.get('relative_path'),
|
||||
config: results.config,
|
||||
configJSON: JSON.stringify(results.config),
|
||||
relative_path: results.config.relative_path,
|
||||
user: userData,
|
||||
userJSON: JSON.stringify(userData).replace(/'/g, "\\'"),
|
||||
plugins: results.custom_header.plugins,
|
||||
authentication: results.custom_header.authentication,
|
||||
scripts: results.scripts,
|
||||
'cache-buster': meta.config['cache-buster'] ? 'v=' + meta.config['cache-buster'] : '',
|
||||
env: process.env.NODE_ENV ? true : false,
|
||||
env: process.env.NODE_ENV ? true : false
|
||||
};
|
||||
|
||||
templateValues.template = {name: res.locals.template};
|
||||
|
||||
@@ -214,15 +214,11 @@ middleware.renderHeader = function(req, res, data, callback) {
|
||||
'brand:logo:alt': meta.config['brand:logo:alt'] || '',
|
||||
'brand:logo:display': meta.config['brand:logo']?'':'hide',
|
||||
allowRegistration: registrationType === 'normal' || registrationType === 'admin-approval',
|
||||
searchEnabled: plugins.hasListeners('filter:search.query')
|
||||
searchEnabled: plugins.hasListeners('filter:search.query'),
|
||||
config: res.locals.config,
|
||||
relative_path: res.locals.config.relative_path
|
||||
};
|
||||
|
||||
for (var key in res.locals.config) {
|
||||
if (res.locals.config.hasOwnProperty(key)) {
|
||||
templateValues[key] = res.locals.config[key];
|
||||
}
|
||||
}
|
||||
|
||||
templateValues.configJSON = JSON.stringify(res.locals.config);
|
||||
|
||||
async.parallel({
|
||||
@@ -337,6 +333,7 @@ middleware.processRender = function(req, res, next) {
|
||||
}
|
||||
|
||||
options.loggedIn = req.user ? parseInt(req.user.uid, 10) !== 0 : false;
|
||||
options.relative_path = nconf.get('relative_path');
|
||||
options.template = {name: template};
|
||||
options.template[template] = true;
|
||||
res.locals.template = template;
|
||||
|
||||
Reference in New Issue
Block a user