mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Merge pull request #4774 from felixrieseberg/iss4768
Editor Save Button/Notifcations: Post vs Page
This commit is contained in:
commit
481af2ddee
3 changed files with 12 additions and 4 deletions
|
@ -50,6 +50,10 @@ EditorControllerMixin = Ember.Mixin.create(MarkerManager, {
|
||||||
return this.get('model.tags').mapBy('name');
|
return this.get('model.tags').mapBy('name');
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
postOrPage: Ember.computed('model.page', function () {
|
||||||
|
return this.get('model.page') ? 'Page' : 'Post';
|
||||||
|
}),
|
||||||
|
|
||||||
// compares previousTagNames to tagNames
|
// compares previousTagNames to tagNames
|
||||||
tagNamesEqual: function () {
|
tagNamesEqual: function () {
|
||||||
var tagNames = this.get('tagNames'),
|
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'));
|
path = this.get('ghostPaths.url').join(this.get('config.blogUrl'), this.get('model.url'));
|
||||||
|
|
||||||
if (status === 'published') {
|
if (status === 'published') {
|
||||||
message += ' <a href="' + path + '">View Post</a>';
|
message += ' <a href="' + path + '">View ' + this.get('postOrPage') + '</a>';
|
||||||
}
|
}
|
||||||
this.notifications.showSuccess(message, {delayed: delay});
|
this.notifications.showSuccess(message, {delayed: delay});
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li class="divider delete"></li>
|
<li class="divider delete"></li>
|
||||||
<li class="delete">
|
<li class="delete">
|
||||||
<a {{action "openModal" "delete-post" this}} href="#">Delete Post</a>
|
<a {{action "openModal" "delete-post" this}} href="#">{{view.deleteText}}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
{{/gh-dropdown}}
|
{{/gh-dropdown}}
|
||||||
|
|
|
@ -8,14 +8,18 @@ var EditorSaveButtonView = Ember.View.extend({
|
||||||
return this.get('controller.model.isPublished') !== this.get('controller.willPublish');
|
return this.get('controller.model.isPublished') !== this.get('controller.willPublish');
|
||||||
}),
|
}),
|
||||||
|
|
||||||
publishText: Ember.computed('controller.model.isPublished', function () {
|
publishText: Ember.computed('controller.model.isPublished', 'controller.pageOrPost', function () {
|
||||||
return this.get('controller.model.isPublished') ? 'Update Post' : 'Publish Now';
|
return this.get('controller.model.isPublished') ? 'Update ' + this.get('controller.postOrPage') : 'Publish Now';
|
||||||
}),
|
}),
|
||||||
|
|
||||||
draftText: Ember.computed('controller.model.isPublished', function () {
|
draftText: Ember.computed('controller.model.isPublished', function () {
|
||||||
return this.get('controller.model.isPublished') ? 'Unpublish' : 'Save Draft';
|
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 () {
|
saveText: Ember.computed('controller.willPublish', function () {
|
||||||
return this.get('controller.willPublish') ? this.get('publishText') : this.get('draftText');
|
return this.get('controller.willPublish') ? this.get('publishText') : this.get('draftText');
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue