Ghost/ghost/admin/app/controllers/setup.js
cobbspur f2d5c5fc26 User Onboarding - flow navigation
closes #5317

- Adds back button to steps 2 and 3
- Prevents user navigating from step 1 to step 3 unless blog has been created
- Prevents user navigating from step 2 to step 3 unless blog has been created
2015-07-21 17:23:04 +01:00

16 lines
572 B
JavaScript

import Ember from 'ember';
export default Ember.Controller.extend({
appController: Ember.inject.controller('application'),
ghostPaths: Ember.inject.service('ghost-paths'),
showBackLink: Ember.computed.match('appController.currentRouteName', /^setup\.(two|three)$/),
backRoute: Ember.computed('appController.currentRouteName', function () {
var appController = this.get('appController'),
currentRoute = Ember.get(appController, 'currentRouteName');
return currentRoute === 'setup.two' ? 'setup.one' : 'setup.two';
})
});