mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Merge pull request #6331 from novaugust/draft_preview_notification
Add Preview link to draft saved notification
This commit is contained in:
commit
5dba4fab5c
1 changed files with 8 additions and 3 deletions
|
@ -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 += ` <a href="${path}">View ${type}</a>`;
|
||||
type = this.get('postOrPage');
|
||||
path = this.get('model.absoluteUrl');
|
||||
} else {
|
||||
type = 'Preview';
|
||||
path = this.get('model.previewUrl');
|
||||
}
|
||||
|
||||
message += ` <a href="${path}" target="_blank">View ${type}</a>`;
|
||||
|
||||
notifications.showNotification(message.htmlSafe(), {delayed: delay});
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue