Commit 85c599a2 authored by Hermann's avatar Hermann
Browse files

update editEvent to new ui form

parent dfeb5c60
...@@ -160,6 +160,8 @@ export default class newEvent extends EditView { ...@@ -160,6 +160,8 @@ export default class newEvent extends EditView {
} }
view() { view() {
if (!this.form.schema) return '';
const titles = ['Event Description', 'When and Where?', 'Signups', 'Advertisement']; const titles = ['Event Description', 'When and Where?', 'Signups', 'Advertisement'];
if (this.rightSubmit) titles.push('Images'); if (this.rightSubmit) titles.push('Images');
...@@ -251,32 +253,26 @@ export default class newEvent extends EditView { ...@@ -251,32 +253,26 @@ export default class newEvent extends EditView {
// page 1: title & description // page 1: title & description
m('div', { m('div', {
style: { display: (this.currentpage === 1) ? 'block' : 'none' }, style: { display: (this.currentpage === 1) ? 'block' : 'none' },
}, this.form.renderPage({ }, [
title_en: { type: 'text', label: 'English Event Title' }, ...this.form.renderSchema(['title_en', 'catchphrase_en']),
catchphrase_en: { type: 'text', label: 'English Catchphrase' }, this.form._renderField('description_en', {
description_en: { type: 'string',
type: 'text',
label: 'English Description', label: 'English Description',
multiLine: true, multiLine: true,
rows: 5, rows: 5,
}, }),
title_de: { type: 'text', label: 'German Event Title' }, ...this.form.renderSchema(['title_de', 'catchphrase_de']),
catchphrase_de: { type: 'text', label: 'German Catchphrase' }, this.form._renderField('description_de', {
description_de: { type: 'string',
type: 'text',
label: 'German Description', label: 'German Description',
multiLine: true, multiLine: true,
rows: 5, rows: 5,
}, }),
})), ]),
// page 2: when & where // page 2: when & where
m('div', { m('div', {
style: { display: (this.currentpage === 2) ? 'block' : 'none' }, style: { display: (this.currentpage === 2) ? 'block' : 'none' },
}, this.form.renderPage({ }, this.form.renderSchema(['time_start', 'time_end', 'location'])),
time_start: { type: 'datetime', label: 'Event Start Time' },
time_end: { type: 'datetime', label: 'Event End Time' },
location: { type: 'text', label: 'Location' },
})),
// page 3: registration // page 3: registration
m('div', { m('div', {
style: { display: (this.currentpage === 3) ? 'block' : 'none' }, style: { display: (this.currentpage === 3) ? 'block' : 'none' },
...@@ -294,9 +290,7 @@ export default class newEvent extends EditView { ...@@ -294,9 +290,7 @@ export default class newEvent extends EditView {
} }
}, },
}), }),
...this.hasprice && this.form.renderPage({ this.hasprice && this.form._renderField('price', { label: 'Price', type: 'number' }),
price: { type: 'number', label: 'Price', min: 0, step: 0.01 },
}),
m('br'), m('br'),
m(Switch, { m(Switch, {
label: 'people have to register to attend this event', label: 'people have to register to attend this event',
...@@ -314,41 +308,24 @@ export default class newEvent extends EditView { ...@@ -314,41 +308,24 @@ export default class newEvent extends EditView {
} }
}, },
}), }),
...this.hasregistration && this.form.renderPage({ ...this.hasregistration && this.form.renderSchema(['spots', 'time_register_start', 'time_register_end']),
spots: { this.hasregistration && this.form._renderField('add_fields_food', {
type: 'number', type: 'boolean',
label: 'Number of Spots', label: 'Food Limitations'
help: '0 for open event',
focusHelp: true,
min: 0,
},
time_register_start: { type: 'datetime', label: 'Start of Registration' },
time_register_end: { type: 'datetime', label: 'End of Registration' },
add_fields_food: { type: 'checkbox', label: 'Food limitations' },
add_fields_sbb: { type: 'checkbox', label: 'SBB Abbonement' },
}), }),
m('br'), this.hasregistration && this.form._renderField('add_fields_sbb', {
...this.hasregistration && this.form.renderPage({ type: 'boolean',
allow_email_signup: { type: 'checkbox', label: 'Allow Email Signup' }, label: 'SBB Abbonement',
}), }),
m('br'),
...this.hasregistration && this.form.renderSchema(['allow_email_signup']),
this.hasregistration && radioButtonSelectionMode, this.hasregistration && radioButtonSelectionMode,
]), ]),
// page 4: advertisement // page 4: advertisement
m('div', { m('div', {
style: { display: (this.currentpage === 4) ? 'block' : 'none' }, style: { display: (this.currentpage === 4) ? 'block' : 'none' },
}, [ }, [
...this.form.renderPage({ ...this.form.renderSchema(['time_advertising_start', 'time_advertising_end']),
time_advertising_start: {
type: 'datetime',
label: 'Start of Advertisement',
required: true,
},
time_advertising_end: {
type: 'datetime',
label: 'End of Advertisement',
required: true,
},
}),
// TODO is deactivated now // TODO is deactivated now
/* /*
m.trust('Priority<br>'), m.trust('Priority<br>'),
...@@ -361,14 +338,7 @@ export default class newEvent extends EditView { ...@@ -361,14 +338,7 @@ export default class newEvent extends EditView {
// onChange: ({ value }) => { this.data.priority = value; }, // onChange: ({ value }) => { this.data.priority = value; },
}), }),
*/ */
...this.form.renderPage({ ...this.form.renderSchema(['show_website', 'show_announce', 'show_infoscreen']),
show_website: { type: 'checkbox', label: 'Advertise on Website' },
show_announce: { type: 'checkbox', label: 'Advertise in Announce' },
show_infoscreen: {
type: 'checkbox',
label: 'Advertise on Infoscreen',
},
}),
]), ]),
// page 5: images // page 5: images
m('div', { m('div', {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment