0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Cleaning up code that is not needed

This commit is contained in:
Hannah Wolfe 2013-09-16 21:40:53 +01:00
parent 8c26249d46
commit 42a5e74ddb
2 changed files with 5 additions and 27 deletions

View file

@ -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 () {

View file

@ -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 {