Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-10 04:12:53 +01:00
27 Zeilen
625 B
JavaScript
27 Zeilen
625 B
JavaScript
import CustomWizard from '../models/custom-wizard';
|
|
|
|
export default Discourse.Route.extend({
|
|
model(params) {
|
|
return Ember.RSVP.hash({
|
|
submissions: CustomWizard.submissions(params.wizard_id),
|
|
wizard: this.modelFor('admin-wizards-submissions').findBy('id', params.wizard_id)
|
|
});
|
|
},
|
|
|
|
setupController(controller, model) {
|
|
let fields = ['user'];
|
|
|
|
model.wizard.steps.forEach((s) => {
|
|
if (s.fields) {
|
|
s.fields.forEach((f) => {
|
|
fields.push(f.id);
|
|
});
|
|
};
|
|
});
|
|
|
|
controller.setProperties({
|
|
submissions: model.submissions,
|
|
fields
|
|
});
|
|
}
|
|
});
|