diff --git a/core/client/views/blog.js b/core/client/views/blog.js index e790cea7a3..6a5e1714ad 100644 --- a/core/client/views/blog.js +++ b/core/client/views/blog.js @@ -131,8 +131,7 @@ deletePost: function (e) { e.preventDefault(); - var self = this, - title = self.model.get('title'); + var self = this; this.addSubview(new Ghost.Views.Modal({ model: { options: { @@ -145,13 +144,13 @@ }).then(function () { Ghost.notifications.addItem({ type: 'success', - message: 'Your post: ' + title + ' has been deleted', + message: 'Your post has been deleted.', status: 'passive' }); }, function () { Ghost.notifications.addItem({ type: 'error', - message: 'Your post: ' + title + ' has not been deleted.', + message: 'Your post could not be deleted. Please try again.', status: 'passive' }); }); diff --git a/core/client/views/editor.js b/core/client/views/editor.js index 82ad7732ce..ee4529a99a 100644 --- a/core/client/views/editor.js +++ b/core/client/views/editor.js @@ -64,6 +64,14 @@ 'publish-on': 'Publish on...' }, + notificationMap: { + 'draft': 'has been saved as a draft', + 'published': 'has been published', + 'scheduled': 'has been scheduled', + 'queue': 'has been added to the queue', + 'publish-on': 'will be published' + }, + initialize: function () { var self = this; // Toggle publish @@ -102,7 +110,7 @@ }).then(function () { Ghost.notifications.addItem({ type: 'success', - message: 'Your post: ' + model.get('title') + ' has been ' + keys[newIndex], + message: 'Your post ' + this.notificationMap[newIndex] + '.', status: 'passive' }); }, function (xhr) { @@ -148,7 +156,8 @@ updatePost: function (status) { var self = this, model = this.model, - prevStatus = model.get('status'); + prevStatus = model.get('status'), + notificationMap = this.notificationMap; // Default to same status if not passed in status = status || prevStatus; @@ -175,7 +184,7 @@ }).then(function () { Ghost.notifications.addItem({ type: 'success', - message: ['Your post "', model.get('title'), '" has been ', status, '.'].join(''), + message: ['Your post ', notificationMap[status], '.'].join(''), status: 'passive' }); }, function (xhr) {