diff --git a/install/data/navigation.json b/install/data/navigation.json index ffd670a0e5..9d690fd415 100644 --- a/install/data/navigation.json +++ b/install/data/navigation.json @@ -17,7 +17,7 @@ "enabled": true, "iconClass": "fa-clock-o", "textClass": "visible-xs-inline", - "text": "[[global:]]" + "text": "[[global:header.recent]]" }, { "route": "/tags", diff --git a/public/less/admin/admin.less b/public/less/admin/admin.less index 1e4a10643d..528c9f7381 100644 --- a/public/less/admin/admin.less +++ b/public/less/admin/admin.less @@ -2,6 +2,7 @@ @import "./mixins"; @import "./general/dashboard"; +@import "./general/navigation"; @import "./manage/categories"; @import "./manage/groups"; @import "./manage/tags"; diff --git a/public/less/admin/general/navigation.less b/public/less/admin/general/navigation.less new file mode 100644 index 0000000000..3ae2c28c25 --- /dev/null +++ b/public/less/admin/general/navigation.less @@ -0,0 +1,6 @@ +#navigation { + ul { + list-style-type: none; + padding: 0; + } +} \ No newline at end of file diff --git a/src/controllers/admin.js b/src/controllers/admin.js index 33e86a383a..2f2d5cad52 100644 --- a/src/controllers/admin.js +++ b/src/controllers/admin.js @@ -37,6 +37,7 @@ var adminController = { settings: {}, logger: {}, sounds: {}, + navigation: {}, themes: {}, users: require('./admin/users'), uploads: require('./admin/uploads') @@ -230,6 +231,30 @@ adminController.languages.get = function(req, res, next) { }); }; +adminController.sounds.get = function(req, res, next) { + meta.sounds.getFiles(function(err, sounds) { + sounds = Object.keys(sounds).map(function(name) { + return { + name: name + }; + }); + + res.render('admin/general/sounds', { + sounds: sounds + }); + }); +}; + +adminController.navigation.get = function(req, res, next) { + require('../navigation/admin').get(function(err, data) { + if (err) { + return next(err); + } + + res.render('admin/general/navigation', data); + }); +}; + adminController.settings.get = function(req, res, next) { var term = req.params.term ? req.params.term : 'general'; @@ -340,20 +365,6 @@ adminController.groups.get = function(req, res, next) { }); }; -adminController.sounds.get = function(req, res, next) { - meta.sounds.getFiles(function(err, sounds) { - sounds = Object.keys(sounds).map(function(name) { - return { - name: name - }; - }); - - res.render('admin/general/sounds', { - sounds: sounds - }); - }); -}; - adminController.themes.get = function(req, res, next) { var themeDir = path.join(__dirname, '../../node_modules/' + req.params.theme); fs.exists(themeDir, function(exists) { diff --git a/src/navigation/admin.js b/src/navigation/admin.js index 0cc25dcce1..c60701e10d 100644 --- a/src/navigation/admin.js +++ b/src/navigation/admin.js @@ -23,9 +23,20 @@ admin.save = function(data, callback) { ], callback); }; -admin.getAvailable = function(data, callback) { - var core = require('../../install/data/navigation.json'); - plugins.fireHook('filter:navigation.available', core, callback); +admin.get = function(callback) { + async.parallel({ + enabled: require('./index').get, + available: getAvailable + }, callback); }; +function getAvailable(callback) { + var core = require('../../install/data/navigation.json').map(function(item) { + item.core = true; + return item; + }); + + plugins.fireHook('filter:navigation.available', core, callback); +} + module.exports = admin; \ No newline at end of file diff --git a/src/routes/admin.js b/src/routes/admin.js index 5175059493..a9c3ecc6ff 100644 --- a/src/routes/admin.js +++ b/src/routes/admin.js @@ -43,6 +43,7 @@ function addRoutes(router, middleware, controllers) { router.get('/general/dashboard', controllers.admin.home); router.get('/general/languages', controllers.admin.languages.get); router.get('/general/sounds', controllers.admin.sounds.get); + router.get('/general/navigation', controllers.admin.navigation.get); router.get('/manage/categories', controllers.admin.categories.active); router.get('/manage/categories/active', controllers.admin.categories.active); diff --git a/src/views/admin/general/navigation.tpl b/src/views/admin/general/navigation.tpl new file mode 100644 index 0000000000..2356309f06 --- /dev/null +++ b/src/views/admin/general/navigation.tpl @@ -0,0 +1,67 @@ +
\ No newline at end of file diff --git a/src/views/admin/partials/menu.tpl b/src/views/admin/partials/menu.tpl index 597173be2e..37fbd6f017 100644 --- a/src/views/admin/partials/menu.tpl +++ b/src/views/admin/partials/menu.tpl @@ -4,6 +4,7 @@