2017-10-13 15:02:34 +02:00
|
|
|
export default Ember.Route.extend({
|
2017-09-29 13:27:03 +02:00
|
|
|
beforeModel() {
|
2017-10-13 15:02:34 +02:00
|
|
|
const appModel = this.modelFor('custom');
|
2017-11-29 10:48:49 +01:00
|
|
|
if (appModel.permitted && !appModel.completed && appModel.start) {
|
|
|
|
this.replaceWith('custom.step', appModel.start);
|
2017-10-13 15:02:34 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2017-11-29 10:48:49 +01:00
|
|
|
model() {
|
|
|
|
return this.modelFor('custom');
|
|
|
|
},
|
|
|
|
|
|
|
|
setupController(controller, model) {
|
|
|
|
const completed = model.get('completed');
|
|
|
|
const permitted = model.get('permitted');
|
|
|
|
const minTrust = model.get('min_trust');
|
|
|
|
controller.setProperties({
|
|
|
|
completed,
|
|
|
|
notPermitted: !permitted,
|
|
|
|
minTrust
|
|
|
|
});
|
2017-09-29 13:27:03 +02:00
|
|
|
}
|
|
|
|
});
|