mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-14 17:56:16 +01:00
fix acp for header changes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
|
||||
<script>
|
||||
var RELATIVE_PATH = "{relative_path}";
|
||||
var config = JSON.parse('{configJSON}');
|
||||
var app = {};
|
||||
app.user = JSON.parse('{userJSON}');
|
||||
</script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
|
||||
Reference in New Issue
Block a user