From d7bf4258fe4ceec815c3d0ad43f80399dced8939 Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Thu, 8 Jan 2015 10:23:48 -0800 Subject: [PATCH] Editor Save Button/Notifcations: Post vs Page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #4768 - Notifications that used to read ‘View Post’ now read ‘View Page’ if the post is actually a page - The Editor Save Button now also makes a distinction between posts and pages --- core/client/mixins/editor-base-controller.js | 6 +++++- core/client/templates/editor-save-button.hbs | 2 +- core/client/views/editor-save-button.js | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/core/client/mixins/editor-base-controller.js b/core/client/mixins/editor-base-controller.js index 5a4cd7c2bb..6297e414bf 100644 --- a/core/client/mixins/editor-base-controller.js +++ b/core/client/mixins/editor-base-controller.js @@ -50,6 +50,10 @@ EditorControllerMixin = Ember.Mixin.create(MarkerManager, { return this.get('model.tags').mapBy('name'); }), + postOrPage: Ember.computed('model.page', function () { + return this.get('model.page') ? 'Page' : 'Post'; + }), + // compares previousTagNames to tagNames tagNamesEqual: function () { var tagNames = this.get('tagNames'), @@ -191,7 +195,7 @@ EditorControllerMixin = Ember.Mixin.create(MarkerManager, { path = this.get('ghostPaths.url').join(this.get('config.blogUrl'), this.get('model.url')); if (status === 'published') { - message += ' View Post'; + message += ' View ' + this.get('postOrPage') + ''; } this.notifications.showSuccess(message, {delayed: delay}); }, diff --git a/core/client/templates/editor-save-button.hbs b/core/client/templates/editor-save-button.hbs index 1377b6cebf..13ed2872cc 100644 --- a/core/client/templates/editor-save-button.hbs +++ b/core/client/templates/editor-save-button.hbs @@ -13,7 +13,7 @@
  • - Delete Post + {{view.deleteText}}
  • {{/gh-dropdown}} diff --git a/core/client/views/editor-save-button.js b/core/client/views/editor-save-button.js index a73f7221a9..515ecf0a9f 100644 --- a/core/client/views/editor-save-button.js +++ b/core/client/views/editor-save-button.js @@ -8,14 +8,18 @@ var EditorSaveButtonView = Ember.View.extend({ return this.get('controller.model.isPublished') !== this.get('controller.willPublish'); }), - publishText: Ember.computed('controller.model.isPublished', function () { - return this.get('controller.model.isPublished') ? 'Update Post' : 'Publish Now'; + publishText: Ember.computed('controller.model.isPublished', 'controller.pageOrPost', function () { + return this.get('controller.model.isPublished') ? 'Update ' + this.get('controller.postOrPage') : 'Publish Now'; }), draftText: Ember.computed('controller.model.isPublished', function () { return this.get('controller.model.isPublished') ? 'Unpublish' : 'Save Draft'; }), + deleteText: Ember.computed('controller.postOrPage', function () { + return 'Delete ' + this.get('controller.postOrPage'); + }), + saveText: Ember.computed('controller.willPublish', function () { return this.get('controller.willPublish') ? this.get('publishText') : this.get('draftText'); })