mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
admin navigation test
This commit is contained in:
@@ -1,23 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var navigationController = {};
|
||||
var async = require('async');
|
||||
|
||||
var navigationAdmin = require('../../navigation/admin');
|
||||
var navigationController = module.exports;
|
||||
|
||||
navigationController.get = function (req, res, next) {
|
||||
require('../../navigation/admin').getAdmin(function (err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
async.waterfall([
|
||||
navigationAdmin.getAdmin,
|
||||
function (data) {
|
||||
data.enabled.forEach(function (enabled, index) {
|
||||
enabled.index = index;
|
||||
enabled.selected = index === 0;
|
||||
});
|
||||
|
||||
data.navigation = data.enabled.slice();
|
||||
|
||||
data.enabled.forEach(function (enabled, index) {
|
||||
enabled.index = index;
|
||||
enabled.selected = index === 0;
|
||||
});
|
||||
|
||||
data.navigation = data.enabled.slice();
|
||||
|
||||
res.render('admin/general/navigation', data);
|
||||
});
|
||||
res.render('admin/general/navigation', data);
|
||||
},
|
||||
], next);
|
||||
};
|
||||
|
||||
module.exports = navigationController;
|
||||
|
||||
Reference in New Issue
Block a user