mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-06-27 16:59:05 +02:00
#3875 filter:scripts.get now acts like filter:admin.scripts.get; does not get minified
This commit is contained in:
@@ -67,6 +67,19 @@ module.exports = function(app, middleware) {
|
||||
templateValues.configJSON = JSON.stringify(res.locals.config);
|
||||
|
||||
async.parallel({
|
||||
scripts: function(next) {
|
||||
plugins.fireHook('filter:scripts.get', [], function(err, scripts) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
var arr = [];
|
||||
scripts.forEach(function(script) {
|
||||
arr.push({src: script});
|
||||
});
|
||||
|
||||
next(null, arr);
|
||||
});
|
||||
},
|
||||
isAdmin: function(next) {
|
||||
user.isAdministrator(req.uid, next);
|
||||
},
|
||||
@@ -121,6 +134,8 @@ module.exports = function(app, middleware) {
|
||||
templateValues.template = {name: res.locals.template};
|
||||
templateValues.template[res.locals.template] = true;
|
||||
|
||||
templateValues.scripts = results.scripts;
|
||||
|
||||
if (req.route && req.route.path === '/') {
|
||||
modifyTitle(templateValues);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user