0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-09-20 15:51:11 +02:00
discourse-custom-wizard/assets/javascripts/wizard/routes/custom-index.js.es6

24 Zeilen
579 B
Text

2017-10-13 15:02:34 +02:00
export default Ember.Route.extend({
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
});
}
});