Ghost/ghost/admin/controllers/debug.js
fabfou 4b695d3b1a Move debug page from /settings/debug to /debug
closes #2743
- remove settings/debug route and associated files
- reimplementation at debug route
2014-05-19 19:18:07 +02:00

38 lines
1.2 KiB
JavaScript

/*global alert, console */
var Debug = Ember.Controller.extend(Ember.Evented, {
uploadButtonText: 'Import',
actions: {
importData: function (file) {
var self = this;
this.set('uploadButtonText', 'Importing');
this.get('model').importFrom(file)
.then(function (response) {
console.log(response);
alert('@TODO: success');
})
.catch(function (response) {
console.log(response);
alert('@TODO: error');
})
.finally(function () {
self.set('uploadButtonText', 'Import');
self.trigger('reset');
});
},
sendTestEmail: function () {
this.get('model').sendTestEmail()
.then(function (response) {
console.log(response);
alert('@TODO: success');
})
.catch(function (response) {
console.log(response);
alert('@TODO: error');
});
}
}
});
export default Debug;