diff --git a/core/ghost.js b/core/ghost.js index 2f014b194e..a6b9caa509 100644 --- a/core/ghost.js +++ b/core/ghost.js @@ -41,19 +41,6 @@ defaults = { maxPriority: 9 }; -// ## Article Statuses -/** - * A list of article status types - * @type {Object} - */ -statuses = { - 'draft': 'draft', - 'complete': 'complete', - 'approved': 'approved', - 'scheduled': 'scheduled', - 'published': 'published' -}; - // ## Module Methods /** * @method Ghost @@ -111,7 +98,6 @@ Ghost = function () { cover: instance.settings('cover') }; }, - statuses: function () { return statuses; }, polyglot: function () { return polyglot; }, mail: new Mailer(), getPaths: function () { diff --git a/core/server.js b/core/server.js index 4d4549a452..f16777b9dc 100644 --- a/core/server.js +++ b/core/server.js @@ -103,20 +103,19 @@ function isGhostAdmin(req, res, next) { // ### GhostLocals Middleware // Expose the standard locals that every external page should have available, -// separating between the frontend / theme and the admin +// separating between the theme and the admin function ghostLocals(req, res, next) { // Make sure we have a locals value. res.locals = res.locals || {}; res.locals.version = packageInfo.version; if (res.isAdmin) { + _.extend(res.locals, { + messages: ghost.notifications + }); + api.users.read({id: req.session.user}).then(function (currentUser) { _.extend(res.locals, { - // pass the admin flash messages, settings and paths - messages: ghost.notifications, - settings: ghost.settings(), - availableThemes: ghost.paths().availableThemes, - availablePlugins: ghost.paths().availablePlugins, currentUser: { name: currentUser.attributes.name, profile: currentUser.attributes.image @@ -124,13 +123,6 @@ function ghostLocals(req, res, next) { }); next(); }).otherwise(function () { - _.extend(res.locals, { - // pass the admin flash messages, settings and paths - messages: ghost.notifications, - settings: ghost.settings(), - availableThemes: ghost.paths().availableThemes, - availablePlugins: ghost.paths().availablePlugins - }); next(); }); } else {