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

36 lines
938 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').apiUrl('db'), {
type: 'DELETE',
headers: {
'X-CSRF-Token': $('meta[name="csrf-param"]').attr('content')
}
}).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',
buttonClass: 'button-delete'
2014-03-31 08:07:05 +04:00
},
reject: {
text: 'Cancel',
buttonClass: 'button'
2014-03-31 08:07:05 +04:00
}
}
});
export default DeleteAllController;