forked from TryGhost/Ghost
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes TryGhost#4633 - The ‘delete’ button is now a smaller plain text link, opening a confirmation modal analog to the delete user/post flow - Adding a post count is dependent on TryGhost#4654, but the modal is already a neat step up from the immediate, warning-less deletion.
- Loading branch information
1 parent
7a0fe7c
commit fb348fb
Showing
5 changed files
with
58 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
var DeleteTagController = Ember.Controller.extend({ | ||
actions: { | ||
confirmAccept: function () { | ||
var tag = this.get('model'), | ||
name = tag.get('name'), | ||
self = this; | ||
|
||
this.send('closeSettingsMenu'); | ||
|
||
tag.destroyRecord().then(function () { | ||
self.notifications.showSuccess('Deleted ' + name); | ||
}).catch(function (error) { | ||
self.notifications.showAPIError(error); | ||
}); | ||
}, | ||
|
||
confirmReject: function () { | ||
return false; | ||
} | ||
}, | ||
|
||
confirm: { | ||
accept: { | ||
text: 'Delete', | ||
buttonClass: 'btn btn-red' | ||
}, | ||
reject: { | ||
text: 'Cancel', | ||
buttonClass: 'btn btn-default btn-minor' | ||
} | ||
} | ||
}); | ||
|
||
export default DeleteTagController; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{{#gh-modal-dialog action="closeModal" showClose=true type="action" style="wide,centered" animation="fade" | ||
title="Are you sure you want to delete this tag?" confirm=confirm}} | ||
|
||
<p>You're about to delete "<strong>{{model.name}}</strong>".<br />This is permanent! No backups, no restores, no magic undo button. <br /> We warned you, ok?</p> | ||
|
||
{{/gh-modal-dialog}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters