Commit caed397b authored by maspect's avatar maspect
Browse files

Add a button to change the Priority of an event to high

parent 6542d84e
...@@ -37,9 +37,7 @@ export default class newEvent extends EditView { ...@@ -37,9 +37,7 @@ export default class newEvent extends EditView {
console.log(data); console.log(data);
this.form.data = data; this.form.data = data;
} }
if (this.form.data.priority === 10) this.form.data.high_priority = true;
if (!this.form.data.priority) this.form.data.priority = 1;
// read additional_fields to make it editable // read additional_fields to make it editable
if (this.form.data.additional_fields) { if (this.form.data.additional_fields) {
...@@ -131,6 +129,13 @@ export default class newEvent extends EditView { ...@@ -131,6 +129,13 @@ export default class newEvent extends EditView {
this.form.data.additional_fields = null; this.form.data.additional_fields = null;
} }
if (this.form.data.high_priority === true) {
this.form.data.priority = 10;
} else {git
this.form.data.priority = 1;
}
delete this.form.data.high_priority;
// if spots is not set, also remove 'allow_email_signup' // if spots is not set, also remove 'allow_email_signup'
if (!('spots' in this.form.data) && 'allow_email_signup' in this.form.data if (!('spots' in this.form.data) && 'allow_email_signup' in this.form.data
&& !this.form.data.allow_email_signup) { && !this.form.data.allow_email_signup) {
...@@ -372,6 +377,8 @@ export default class newEvent extends EditView { ...@@ -372,6 +377,8 @@ export default class newEvent extends EditView {
type: 'boolean', type: 'boolean',
label: 'SBB Abonnement', label: 'SBB Abonnement',
}), }),
m('br'), m('br'),
...this.hasregistration && addFieldsText, ...this.hasregistration && addFieldsText,
m('br'), m('br'),
...@@ -407,12 +414,20 @@ export default class newEvent extends EditView { ...@@ -407,12 +414,20 @@ export default class newEvent extends EditView {
// onChange: ({ value }) => { this.data.priority = value; }, // onChange: ({ value }) => { this.data.priority = value; },
}), }),
*/ */
...this.form.renderSchema(['show_website', 'show_announce', 'show_infoscreen']), ...this.form.renderSchema(['show_website', 'show_announce', 'show_infoscreen']),
// pritority update
this.form._renderField('high_priority', {
type: 'boolean',
label: 'Set high Priority',
}),
m('div', 'Please send your announce text additionally via email to info@amiv.ch ' + m('div', 'Please send your announce text additionally via email to info@amiv.ch ' +
'until the new announce tool is ready.'), 'until the new announce tool is ready.'),
m('div', 'Please send an email to info@amiv.ch in order to show your event on' + m('div', 'Please send an email to info@amiv.ch in order to show your event on' +
'the infoscreen until the new infoscreen tool is ready.'), 'the infoscreen until the new infoscreen tool is ready.'),
]), ]),
// page 5: images // page 5: images
m('div', { m('div', {
style: { display: (this.currentpage === 5) ? 'block' : 'none' }, style: { display: (this.currentpage === 5) ? 'block' : 'none' },
......
Supports Markdown
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