From 4ce6341d85d89ca9797c48dabc9ad2d20209d418 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sat, 20 Dec 2014 00:42:52 -0500 Subject: [PATCH] fix acp for header changes --- src/middleware/admin.js | 22 ++++++++++++---------- src/views/admin/header.tpl | 3 +++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/middleware/admin.js b/src/middleware/admin.js index 003ffbed00..bd7e46dd19 100644 --- a/src/middleware/admin.js +++ b/src/middleware/admin.js @@ -45,6 +45,8 @@ middleware.buildHeader = function(req, res, next) { return next(err); } + userData.uid = uid; + async.parallel({ scripts: function(next) { plugins.fireHook('filter:admin.scripts.get', [], function(err, scripts) { @@ -61,16 +63,22 @@ middleware.buildHeader = function(req, res, next) { }, custom_header: function(next) { plugins.fireHook('filter:admin.header.build', custom_header, next); + }, + config: function(next) { + controllers.api.getConfig(req, res, next); } - }, function(err, pluginData) { + }, function(err, results) { if (err) { return next(err); } + res.locals.config = results.config; var data = { relative_path: nconf.get('relative_path'), - plugins: pluginData.custom_header.plugins, - authentication: pluginData.custom_header.authentication, - scripts: pluginData.scripts, + configJSON: JSON.stringify(results.config), + userJSON: JSON.stringify(userData), + plugins: results.custom_header.plugins, + authentication: results.custom_header.authentication, + scripts: results.scripts, userpicture: userData.picture, username: userData.username, userslug: userData.userslug, @@ -88,12 +96,6 @@ middleware.buildHeader = function(req, res, next) { }); }); }, - function(next) { - controllers.api.getConfig(req, res, function(err, config) { - res.locals.config = config; - next(err); - }); - }, function(next) { app.render('admin/footer', {}, function(err, template) { res.locals.adminFooter = template; diff --git a/src/views/admin/header.tpl b/src/views/admin/header.tpl index c68e0fbfaa..2b14ff8e1f 100644 --- a/src/views/admin/header.tpl +++ b/src/views/admin/header.tpl @@ -11,6 +11,9 @@