Merge pull request #6331 from novaugust/draft_preview_notification

Add Preview link to draft saved notification
This commit is contained in:
Kevin Ansfield 2016-01-13 14:27:52 +00:00
commit 5dba4fab5c
1 changed files with 8 additions and 3 deletions

View File

@ -213,14 +213,19 @@ export default Mixin.create({
// TODO: Update for new notification click-action API
showSaveNotification(prevStatus, status, delay) {
let message = this.messageMap.success.post[prevStatus][status];
let path = this.get('model.absoluteUrl');
let type = this.get('postOrPage');
let notifications = this.get('notifications');
let type, path;
if (status === 'published') {
message += `&nbsp;<a href="${path}">View ${type}</a>`;
type = this.get('postOrPage');
path = this.get('model.absoluteUrl');
} else {
type = 'Preview';
path = this.get('model.previewUrl');
}
message += `&nbsp;<a href="${path}" target="_blank">View ${type}</a>`;
notifications.showNotification(message.htmlSafe(), {delayed: delay});
},