Ghost/ghost/admin/controllers/modals/delete-all.js

33 lines
829 B
JavaScript
Raw Normal View History

2014-03-31 08:07:05 +04:00
var DeleteAllController = Ember.Controller.extend({
actions: {
confirmAccept: function () {
var self = this;
2014-03-31 08:07:05 +04:00
ic.ajax.request(this.get('ghostPaths.url').api('db'), {
type: 'DELETE'
}).then(function () {
self.notifications.showSuccess('All content deleted from database.');
}).catch(function (response) {
self.notifications.showErrors(response);
});
},
2014-03-31 08:07:05 +04:00
confirmReject: function () {
return false;
}
},
2014-03-31 08:07:05 +04:00
confirm: {
accept: {
text: 'Delete',
2014-08-06 15:34:08 +04:00
buttonClass: 'btn btn-red'
2014-03-31 08:07:05 +04:00
},
reject: {
text: 'Cancel',
2014-08-06 15:34:08 +04:00
buttonClass: 'btn btn-default btn-minor'
2014-03-31 08:07:05 +04:00
}
}
});
export default DeleteAllController;