Merge pull request #648 from jfi/iss545

Notifications are too long
This commit is contained in:
Hannah Wolfe 2013-09-09 04:48:41 -07:00
commit 718c285808
2 changed files with 15 additions and 7 deletions

View File

@ -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'
});
});

View File

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