mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Merge pull request #4656 from felixrieseberg/iss4633
Tag Management: Delete Flow
This commit is contained in:
commit
eb7118309b
@ -143,6 +143,23 @@
|
|||||||
height: 108px;
|
height: 108px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tag-delete-button {
|
||||||
|
padding: 0;
|
||||||
|
color: $red;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
margin-right: 4px;
|
||||||
|
top: -1px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
&, &:before {
|
||||||
|
color: darken($red, 10%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.nav-list {
|
.nav-list {
|
||||||
margin-top: 3rem;
|
margin-top: 3rem;
|
||||||
}
|
}
|
||||||
|
34
ghost/admin/controllers/modals/delete-tag.js
Normal file
34
ghost/admin/controllers/modals/delete-tag.js
Normal file
@ -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;
|
@ -114,19 +114,6 @@ var TagsController = Ember.ArrayController.extend(PaginationMixin, {
|
|||||||
this.send('openSettingsMenu');
|
this.send('openSettingsMenu');
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteTag: function (tag) {
|
|
||||||
var 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);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
saveActiveTagName: function (name) {
|
saveActiveTagName: function (name) {
|
||||||
this.saveActiveTagProperty('name', name);
|
this.saveActiveTagProperty('name', name);
|
||||||
},
|
},
|
||||||
|
6
ghost/admin/templates/modals/delete-tag.hbs
Normal file
6
ghost/admin/templates/modals/delete-tag.hbs
Normal file
@ -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}}
|
@ -35,7 +35,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{#unless activeTag.isNew}}
|
{{#unless activeTag.isNew}}
|
||||||
<button type="button" class="btn btn-red icon-trash" {{action "deleteTag" activeTag}}>Delete Tag</button>
|
<button type="button" class="btn btn-link btn-sm tag-delete-button icon-trash" {{action "openModal" "delete-tag" activeTag}}>Delete Tag</button>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user