mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
Merge pull request #4774 from felixrieseberg/iss4768
Editor Save Button/Notifcations: Post vs Page
This commit is contained in:
commit
481af2ddee
@ -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 += ' <a href="' + path + '">View Post</a>';
|
||||
message += ' <a href="' + path + '">View ' + this.get('postOrPage') + '</a>';
|
||||
}
|
||||
this.notifications.showSuccess(message, {delayed: delay});
|
||||
},
|
||||
|
@ -13,7 +13,7 @@
|
||||
</li>
|
||||
<li class="divider delete"></li>
|
||||
<li class="delete">
|
||||
<a {{action "openModal" "delete-post" this}} href="#">Delete Post</a>
|
||||
<a {{action "openModal" "delete-post" this}} href="#">{{view.deleteText}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
{{/gh-dropdown}}
|
||||
|
@ -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');
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user