|
|
|
@ -69,6 +69,7 @@ module.exports = function (middleware) {
|
|
|
|
|
async.waterfall([
|
|
|
|
|
function (next) {
|
|
|
|
|
async.parallel({
|
|
|
|
|
scripts: async.apply(plugins.fireHook, 'filter:scripts.get', []),
|
|
|
|
|
isAdmin: function (next) {
|
|
|
|
|
user.isAdministrator(req.uid, next);
|
|
|
|
|
},
|
|
|
|
@ -194,6 +195,8 @@ module.exports = function (middleware) {
|
|
|
|
|
templateValues.userJSON = jsesc(JSON.stringify(results.user), { isScriptContext: true });
|
|
|
|
|
templateValues.useCustomCSS = parseInt(meta.config.useCustomCSS, 10) === 1 && meta.config.customCSS;
|
|
|
|
|
templateValues.customCSS = templateValues.useCustomCSS ? (meta.config.renderedCustomCSS || '') : '';
|
|
|
|
|
templateValues.useCustomJS = parseInt(meta.config.useCustomJS, 10) === 1;
|
|
|
|
|
templateValues.customJS = templateValues.useCustomJS ? meta.config.customJS : '';
|
|
|
|
|
templateValues.useCustomHTML = parseInt(meta.config.useCustomHTML, 10) === 1;
|
|
|
|
|
templateValues.customHTML = templateValues.useCustomHTML ? meta.config.customHTML : '';
|
|
|
|
|
templateValues.maintenanceHeader = parseInt(meta.config.maintenanceMode, 10) === 1 && !results.isAdmin;
|
|
|
|
@ -203,6 +206,11 @@ module.exports = function (middleware) {
|
|
|
|
|
templateValues.privateUserInfo = parseInt(meta.config.privateUserInfo, 10) === 1;
|
|
|
|
|
templateValues.privateTagListing = parseInt(meta.config.privateTagListing, 10) === 1;
|
|
|
|
|
|
|
|
|
|
templateValues.scripts = results.scripts.map(function (script) {
|
|
|
|
|
return { src: script };
|
|
|
|
|
});
|
|
|
|
|
addTimeagoLocaleScript(templateValues.scripts, res.locals.config.userLang);
|
|
|
|
|
|
|
|
|
|
templateValues.template = { name: res.locals.template };
|
|
|
|
|
templateValues.template[res.locals.template] = true;
|
|
|
|
|
|
|
|
|
@ -237,20 +245,6 @@ module.exports = function (middleware) {
|
|
|
|
|
}, next);
|
|
|
|
|
},
|
|
|
|
|
function (data, next) {
|
|
|
|
|
async.parallel({
|
|
|
|
|
scripts: async.apply(plugins.fireHook, 'filter:scripts.get', []),
|
|
|
|
|
}, function (err, results) {
|
|
|
|
|
next(err, data, results);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
function (data, results, next) {
|
|
|
|
|
data.templateValues.scripts = results.scripts.map(function (script) {
|
|
|
|
|
return { src: script };
|
|
|
|
|
});
|
|
|
|
|
addTimeagoLocaleScript(data.templateValues.scripts, res.locals.config.userLang);
|
|
|
|
|
|
|
|
|
|
data.templateValues.useCustomJS = parseInt(meta.config.useCustomJS, 10) === 1;
|
|
|
|
|
data.templateValues.customJS = data.templateValues.useCustomJS ? meta.config.customJS : '';
|
|
|
|
|
data.templateValues.isSpider = req.isSpider();
|
|
|
|
|
req.app.render('footer', data.templateValues, next);
|
|
|
|
|
},
|
|
|
|
|