1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00

Miscellaneous client cleanup

No issue
- Consolidate extension of Ember.Router.
- Remove unneeded local jshint flags and '_' as a global.
- Cleanup client README.md.
- Fix error message.
This commit is contained in:
Jason Williams 2014-11-27 23:45:34 +00:00
parent dbce441e43
commit cf40a33cce
6 changed files with 9 additions and 20 deletions

View file

@ -30,7 +30,6 @@
"SimpleAuth": true,
"validator": true,
"ic": true,
"_": true,
"NProgress": true,
"moment": true
}

View file

@ -1,7 +1,6 @@
# [Ghost-UI](http://github.com/TryGhost/Ghost-UI)
[Travis] [SauceLabs]
# Ghost Admin Client
Ghost-UI is the Ember.js application used as a client-side admin for the [Ghost](http://ghost.org) blogging platform. This readme is a work in progress guide aimed at explaining the specific nuances of the Ghost Ember app to contributors whose main focus is on this side of things.
Ember.js application used as a client-side admin for the [Ghost](http://ghost.org) blogging platform. This readme is a work in progress guide aimed at explaining the specific nuances of the Ghost Ember app to contributors whose main focus is on this side of things.
## Architecture

View file

@ -29,7 +29,6 @@ var NotificationComponent = Ember.Component.extend({
var self = this;
self.$().on('animationend webkitAnimationEnd oanimationend MSAnimationEnd', function (event) {
/* jshint unused: false */
if (event.originalEvent.animationName === 'fade-out') {
self.notifications.removeObject(self.get('message'));
}

View file

@ -1,4 +1,3 @@
/* jshint unused: false */
import ajax from 'ghost/utils/ajax';
import ValidationEngine from 'ghost/mixins/validation-engine';
@ -24,14 +23,14 @@ var ForgottenController = Ember.Controller.extend(ValidationEngine, {
email: data.email
}]
}
}).then(function (resp) {
}).then(function () {
self.toggleProperty('submitting');
self.notifications.showSuccess('Please check your email for instructions.', {delayed: true});
self.set('email', '');
self.transitionToRoute('signin');
}).catch(function (resp) {
self.toggleProperty('submitting');
self.notifications.showAPIError(resp, {defaultErrorText: 'There was a problem logging in, please try again.'});
self.notifications.showAPIError(resp, {defaultErrorText: 'There was a problem with the reset, please try again.'});
});
}).catch(function (errors) {
self.toggleProperty('submitting');

View file

@ -1,5 +1,3 @@
/*global console*/
/* jshint unused: false */
import ajax from 'ghost/utils/ajax';
import ValidationEngine from 'ghost/mixins/validation-engine';

View file

@ -1,23 +1,18 @@
/*global Ember */
/* jshint unused: false */
import ghostPaths from 'ghost/utils/ghost-paths';
import documentTitle from 'ghost/utils/document-title';
// ensure we don't share routes between all Router instances
var Router = Ember.Router.extend();
documentTitle();
Router.reopen({
var Router = Ember.Router.extend({
location: 'trailing-history', // use HTML5 History API instead of hash-tag based URLs
rootURL: ghostPaths().adminRoot, // admin interface lives under sub-directory /ghost
clearNotifications: function () {
clearNotifications: Ember.on('didTransition', function () {
this.notifications.closePassive();
this.notifications.displayDelayed();
}.on('didTransition')
})
});
documentTitle();
Router.map(function () {
this.route('setup');
this.route('signin');