all files / src/controllers/admin/ navigation.js

27.27% Statements 3/11
0% Branches 0/2
0% Functions 0/3
27.27% Lines 3/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23                                       
'use strict';
 
var navigationController = {};
 
navigationController.get = function(req, res, next) {
	require('../../navigation/admin').getAdmin(function(err, data) {
		if (err) {
			return next(err);
		}
 
 
		data.enabled.forEach(function(enabled, index) {
			enabled.index = index;
			enabled.selected = index === 0;
		});
 
		data.navigation = data.enabled.slice();
 
		res.render('admin/general/navigation', data);
	});
};
 
module.exports = navigationController;