0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00
ghost/core/client/controllers/settings/debug.js
Peter Szel 716a09a452 Ported logic to settings: Debug Tab closes #2424
- Added file upload component
- Added import client logic
- Added e-mail sending client logic
- Added settings model
2014-05-07 20:48:29 +01:00

37 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;