diff --git a/ghost/admin/app/initializers/ghost-config.js b/ghost/admin/app/initializers/ghost-config.js index 244f14fe7a..a9fc300a1f 100644 --- a/ghost/admin/app/initializers/ghost-config.js +++ b/ghost/admin/app/initializers/ghost-config.js @@ -8,6 +8,7 @@ var ConfigInitializer = { application.register('ghost:config', config, {instantiate: false}); application.inject('route', 'config', 'ghost:config'); + application.inject('model:post', 'config', 'ghost:config'); application.inject('controller', 'config', 'ghost:config'); application.inject('component', 'config', 'ghost:config'); } diff --git a/ghost/admin/app/mixins/editor-base-controller.js b/ghost/admin/app/mixins/editor-base-controller.js index 84279c91cd..8585b6075e 100644 --- a/ghost/admin/app/mixins/editor-base-controller.js +++ b/ghost/admin/app/mixins/editor-base-controller.js @@ -222,10 +222,11 @@ EditorControllerMixin = Ember.Mixin.create({ showSaveNotification: function (prevStatus, status, delay) { var message = this.messageMap.success.post[prevStatus][status], - path = this.get('ghostPaths.url').join(this.get('config.blogUrl'), this.get('model.url')); + path = this.get('model.absoluteUrl'), + type = this.get('postOrPage'); if (status === 'published') { - message += ' View ' + this.get('postOrPage') + ''; + message += ` View ${type}`; } this.notifications.showSuccess(message.htmlSafe(), {delayed: delay}); }, diff --git a/ghost/admin/app/models/post.js b/ghost/admin/app/models/post.js index cfb08cecfd..d1f9ef5b53 100644 --- a/ghost/admin/app/models/post.js +++ b/ghost/admin/app/models/post.js @@ -29,6 +29,12 @@ var Post = DS.Model.extend(NProgressSaveMixin, ValidationEngine, { tags: DS.hasMany('tag', {embedded: 'always'}), url: DS.attr('string'), + absoluteUrl: Ember.computed('url', 'ghostPaths.url', 'config.blogUrl', function () { + var blogUrl = this.get('config.blogUrl'), + postUrl = this.get('url'); + return this.get('ghostPaths.url').join(blogUrl, postUrl); + }), + scratch: null, titleScratch: null, diff --git a/ghost/admin/app/templates/posts/post.hbs b/ghost/admin/app/templates/posts/post.hbs index 8a097e5ded..d9222dd8ab 100644 --- a/ghost/admin/app/templates/posts/post.hbs +++ b/ghost/admin/app/templates/posts/post.hbs @@ -7,7 +7,7 @@ {{#if isPublished}} - Published + Published {{else}} Written {{/if}}