#3875 filter:scripts.get now acts like filter:admin.scripts.get; does not get minified

This commit is contained in:
psychobunny
2016-01-18 15:32:49 -05:00
parent 9430a626f4
commit f94cd21f83
2 changed files with 31 additions and 61 deletions

View File

@@ -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);
}