0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-25 10:40:28 +01:00
discourse-custom-wizard/assets/javascripts/wizard/routes/custom-index.js.es6
2017-12-03 15:57:40 +08:00

27 Zeilen
683 B
JavaScript

export default Ember.Route.extend({
beforeModel() {
const appModel = this.modelFor('custom');
if (appModel && appModel.permitted && !appModel.completed && appModel.start) {
this.replaceWith('custom.step', appModel.start);
}
},
model() {
return this.modelFor('custom');
},
setupController(controller, model) {
if (model) {
const completed = model.get('completed');
const permitted = model.get('permitted');
const minTrust = model.get('min_trust');
controller.setProperties({
completed,
notPermitted: !permitted,
minTrust
});
} else {
controller.set('noWizard', true);
}
}
});