2017-10-13 15:02:34 +02:00
|
|
|
import { findCustomWizard } from '../models/custom';
|
|
|
|
import { ajax } from 'wizard/lib/ajax';
|
|
|
|
|
|
|
|
export default Ember.Route.extend({
|
|
|
|
model(params) {
|
|
|
|
return findCustomWizard(params.wizard_id);
|
|
|
|
},
|
|
|
|
|
|
|
|
afterModel() {
|
|
|
|
return ajax({
|
|
|
|
url: `/site/settings`,
|
|
|
|
type: 'GET',
|
|
|
|
}).then((result) => {
|
|
|
|
Object.assign(Wizard.SiteSettings, result);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
setupController(controller, model) {
|
2017-10-22 05:37:58 +02:00
|
|
|
const background = model ? model.get('background') : 'AliceBlue';
|
2017-10-13 15:02:34 +02:00
|
|
|
Ember.run.scheduleOnce('afterRender', this, function(){
|
2017-10-22 05:37:58 +02:00
|
|
|
$('body.custom-wizard').css('background', background);
|
2017-12-03 08:57:40 +01:00
|
|
|
if (model) {
|
|
|
|
$('#custom-wizard-main').addClass(model.get('id').dasherize());
|
|
|
|
}
|
2017-10-13 15:02:34 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
controller.setProperties({
|
|
|
|
customWizard: true,
|
|
|
|
logoUrl: Wizard.SiteSettings.logo_small_url
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|