Remove assets
This commit is contained in:
parent
e2d3e8222a
commit
70f9f85624
|
@ -1,145 +0,0 @@
|
|||
import scrollToElement from "./scrollToElement.js";
|
||||
|
||||
var toastedOptions = {
|
||||
position: "bottom-right",
|
||||
duration: 3000,
|
||||
fitToScreen: false,
|
||||
fullWidth: false,
|
||||
theme: "material",
|
||||
};
|
||||
|
||||
export default function (toasted) {
|
||||
var toasted = new toasted(toastedOptions);
|
||||
|
||||
return {
|
||||
data: {
|
||||
event_id: null,
|
||||
gender: "",
|
||||
firstname: "",
|
||||
lastname: "",
|
||||
birthday: "",
|
||||
group: null,
|
||||
phone: "",
|
||||
email: "",
|
||||
agegroup_leader: null,
|
||||
food_preferences: [],
|
||||
foto: false,
|
||||
misc: "",
|
||||
},
|
||||
loading: false,
|
||||
finished: false,
|
||||
submitRequest: null,
|
||||
errorFields: [],
|
||||
active: 0,
|
||||
slides: ["Persönliches", "Veranstaltung", "Sonstiges"],
|
||||
genders: [
|
||||
{ id: "Männlich", name: "Männlich" },
|
||||
{ id: "Weiblich", name: "Weiblich" },
|
||||
{ id: "Divers", name: "Divers" },
|
||||
],
|
||||
groups: [
|
||||
{ id: "Gallier", name: "Gallier (Wuppertal)" },
|
||||
{ id: "Gandalf", name: "Gandalf (SG-Mangenberg)" },
|
||||
{ id: "Gravenrode", name: "Gravenrode (SG-Gräfrath)" },
|
||||
{ id: "Lennep", name: "Lennep (RS-Lennep)" },
|
||||
{ id: "Silva", name: "Silva (SG-Wald)" },
|
||||
{ id: "Sugambrer", name: "Sugambrer (SG-Höhscheid)" },
|
||||
{ id: "Tenkterer", name: "Tenkterer (SG-Löhdorf)" },
|
||||
{ id: "von Berg", name: "von Berg (SG-Ohligs)" },
|
||||
],
|
||||
agegroupLeaders: [
|
||||
{ id: "Biber", name: "Biber" },
|
||||
{ id: "Wölfling", name: "Wölfling" },
|
||||
{ id: "Jungpfadfinder", name: "Jungpfadfinder" },
|
||||
{ id: "Pfadfinder", name: "Pfadfinder" },
|
||||
{ id: "Rover", name: "Rover" },
|
||||
],
|
||||
boolean: [
|
||||
{ id: "Ja", name: "Ja" },
|
||||
{ id: "Nein", name: "Nein" },
|
||||
],
|
||||
foodPreferences: [
|
||||
{ id: "Fleisch", name: "Ich esse Fleisch" },
|
||||
{ id: "Vegan", name: "Ich ernähre mich vegan" },
|
||||
{ id: "Glutenfrei", name: "Ich vertrage kein Gluten" },
|
||||
{ id: "Laktosefrei", name: "Ich vertrage keine Laktose" },
|
||||
],
|
||||
slideTo(e, index) {
|
||||
if (e !== null) {
|
||||
e.preventDefault();
|
||||
}
|
||||
if (index < 0 || index > this.slides.length - 1) {
|
||||
return;
|
||||
}
|
||||
this.scrollForm(this.$refs.form);
|
||||
this.active = index;
|
||||
this.$refs.slider.scrollLeft =
|
||||
(this.$refs.slider.scrollWidth / this.slides.length) * index;
|
||||
this.$refs.mobileSlider.scrollLeft =
|
||||
(this.$refs.mobileSlider.scrollWidth / this.slides.length) * index;
|
||||
},
|
||||
scrollForm(el) {
|
||||
var margin = window.getComputedStyle(el).marginTop.replace("px", "");
|
||||
scrollToElement(el, 300, (margin ? margin : 0) * -1);
|
||||
},
|
||||
submit() {
|
||||
var _self = this;
|
||||
_self.loading = true;
|
||||
var promise = fetch(window.location.href, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"X-WINTER-REQUEST-HANDLER": this.submitRequest,
|
||||
"X-WINTER-REQUEST-PARTIALS": [],
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
},
|
||||
body: JSON.stringify(this.data),
|
||||
});
|
||||
|
||||
promise.then(function (response) {
|
||||
_self.loading = false;
|
||||
if (response.status === 422) {
|
||||
response.json().then((errors) => {
|
||||
_self.scrollToFirstError(errors);
|
||||
Object.keys(errors).forEach((field) => {
|
||||
toasted.error(errors[field].join("<br>"));
|
||||
});
|
||||
});
|
||||
}
|
||||
if (response.status === 201) {
|
||||
_self.finished = true;
|
||||
_self.scrollForm(_self.$refs.form);
|
||||
}
|
||||
});
|
||||
},
|
||||
scrollToFirstError(errors) {
|
||||
if (Object.keys(errors).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var firstField = Object.keys(errors)[0];
|
||||
var field = this.$refs.form.querySelector('[name="' + firstField + '"]');
|
||||
|
||||
if (field === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var slideElement = field.closest(".slider-element");
|
||||
this.slideTo(
|
||||
null,
|
||||
Array.from(slideElement.parentNode.children).indexOf(slideElement)
|
||||
);
|
||||
},
|
||||
prevButton: {
|
||||
[":class"]() {
|
||||
return this.active == 0 ? "opacity-40" : "";
|
||||
},
|
||||
},
|
||||
nextButton: {
|
||||
[":class"]() {
|
||||
return this.active == this.slides.length - 1 ? "opacity-40" : "";
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
|
@ -1,143 +0,0 @@
|
|||
import scrollToElement from './scrollToElement.js';
|
||||
|
||||
var toastedOptions = {
|
||||
position: 'bottom-right',
|
||||
duration: 3000,
|
||||
fitToScreen: false,
|
||||
fullWidth: false,
|
||||
theme: 'material',
|
||||
};
|
||||
|
||||
export default function (toasted) {
|
||||
var toasted = new toasted(toastedOptions);
|
||||
|
||||
return {
|
||||
data: {
|
||||
event_id: null,
|
||||
gender: '',
|
||||
firstname: '',
|
||||
lastname: '',
|
||||
birthday: '',
|
||||
phone: '',
|
||||
email: '',
|
||||
group: null,
|
||||
agegroup: null,
|
||||
food_preferences: [],
|
||||
misc: '',
|
||||
parent: false,
|
||||
foto: false,
|
||||
},
|
||||
loading: false,
|
||||
finished: false,
|
||||
submitRequest: null,
|
||||
errorFields: [],
|
||||
active: 0,
|
||||
slides: [
|
||||
'Persönliches',
|
||||
'Veranstaltung',
|
||||
'Sonstiges'
|
||||
],
|
||||
genders: [
|
||||
{"id": "Männlich", "name": "Männlich"},
|
||||
{"id": "Weiblich", "name": "Weiblich"},
|
||||
{"id": "Divers", "name": "Divers"},
|
||||
],
|
||||
groups: [
|
||||
{"id": "Gallier", "name": "Gallier (Wuppertal)"},
|
||||
{"id": "Gandalf", "name": "Gandalf (SG-Mangenberg)"},
|
||||
{"id": "Gravenrode", "name": "Gravenrode (SG-Gräfrath)"},
|
||||
{"id": "Lennep", "name": "Lennep (RS-Lennep)"},
|
||||
{"id": "Silva", "name": "Silva (SG-Wald)"},
|
||||
{"id": "Sugambrer", "name": "Sugambrer (SG-Höhscheid)"},
|
||||
{"id": "Tenkterer", "name": "Tenkterer (SG-Löhdorf)"},
|
||||
{"id": "von Berg", "name": "von Berg (SG-Ohligs)"},
|
||||
],
|
||||
agegroups: [
|
||||
{"id": "Rover", "name": "Rover"},
|
||||
{"id": "Leiter*in", "name": "Leiter*in"},
|
||||
],
|
||||
boolean: [
|
||||
{"id": "Ja", "name": "Ja"},
|
||||
{"id": "Nein", "name": "Nein"},
|
||||
],
|
||||
foodPreferences: [
|
||||
{"id": "Fleisch", "name": "Ich esse Fleisch"},
|
||||
{"id": "Vegan", "name": "Ich ernähre mich vegan"},
|
||||
{"id": "Glutenfrei", "name": "Ich vertrage kein Gluten"},
|
||||
{"id": "Laktosefrei", "name": "Ich vertrage keine Laktose"},
|
||||
],
|
||||
slideTo(e, index) {
|
||||
if (e !== null) {
|
||||
e.preventDefault();
|
||||
}
|
||||
if (index < 0 || index > this.slides.length-1) {
|
||||
return;
|
||||
}
|
||||
this.scrollForm(this.$refs.form);
|
||||
this.active = index;
|
||||
this.$refs.slider.scrollLeft = this.$refs.slider.scrollWidth / this.slides.length * index;
|
||||
this.$refs.mobileSlider.scrollLeft = this.$refs.mobileSlider.scrollWidth / this.slides.length * index;
|
||||
},
|
||||
scrollForm(el) {
|
||||
var margin = window.getComputedStyle(el).marginTop.replace('px', '');
|
||||
scrollToElement(el, 300, (margin?margin:0) * -1);
|
||||
},
|
||||
submit() {
|
||||
var _self = this;
|
||||
_self.loading = true;
|
||||
var promise = fetch(window.location.href, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
'X-WINTER-REQUEST-HANDLER': this.submitRequest,
|
||||
'X-WINTER-REQUEST-PARTIALS': [],
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
},
|
||||
body: JSON.stringify(this.data),
|
||||
});
|
||||
|
||||
promise.then(function(response) {
|
||||
_self.loading = false;
|
||||
if (response.status === 422) {
|
||||
response.json().then((errors) => {
|
||||
_self.scrollToFirstError(errors);
|
||||
Object.keys(errors).forEach((field) => {
|
||||
toasted.error(errors[field].join('<br>'));
|
||||
});
|
||||
});
|
||||
}
|
||||
if (response.status === 201) {
|
||||
_self.finished = true;
|
||||
_self.scrollForm(_self.$refs.form);
|
||||
}
|
||||
});
|
||||
},
|
||||
scrollToFirstError(errors) {
|
||||
if (Object.keys(errors).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var firstField = Object.keys(errors)[0];
|
||||
var field = this.$refs.form.querySelector('[name="'+firstField+'"]');
|
||||
|
||||
if (field === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var slideElement = field.closest('.slider-element');
|
||||
this.slideTo(null, Array.from(slideElement.parentNode.children).indexOf(slideElement));
|
||||
},
|
||||
prevButton: {
|
||||
[':class']() {
|
||||
return this.active == 0 ? 'opacity-40' : '';
|
||||
}
|
||||
},
|
||||
nextButton: {
|
||||
[':class']() {
|
||||
return this.active == this.slides.length - 1 ? 'opacity-40' : '';
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
@ -1,174 +0,0 @@
|
|||
import scrollToElement from './scrollToElement.js';
|
||||
|
||||
var toastedOptions = {
|
||||
position: 'bottom-right',
|
||||
duration: 3000,
|
||||
fitToScreen: false,
|
||||
fullWidth: false,
|
||||
theme: 'material',
|
||||
};
|
||||
|
||||
export default function (toasted) {
|
||||
var toasted = new toasted(toastedOptions);
|
||||
|
||||
return {
|
||||
data: {
|
||||
event_id: null,
|
||||
firstname: '',
|
||||
lastname: '',
|
||||
address: '',
|
||||
zip: '',
|
||||
location: '',
|
||||
food_preferences: [],
|
||||
activity: 'Teilnehmer*in',
|
||||
gender: '',
|
||||
email: '',
|
||||
birthday: '',
|
||||
agegroup: '',
|
||||
group: '',
|
||||
agegroup_leader: '',
|
||||
emergency_phone: '',
|
||||
phone: '',
|
||||
misc: '',
|
||||
foto: false,
|
||||
parent: false,
|
||||
vorteam: false,
|
||||
},
|
||||
loading: false,
|
||||
finished: false,
|
||||
submitRequest: null,
|
||||
errorFields: [],
|
||||
active: 0,
|
||||
slides: [
|
||||
'Persönliches',
|
||||
'Veranstaltung',
|
||||
'Sonstiges'
|
||||
],
|
||||
activities: [
|
||||
{"id": "Orga", "name": "Orga"},
|
||||
{"id": "Teilnehmer*in", "name": "Teilnehmer*in"},
|
||||
],
|
||||
genders: [
|
||||
{"id": "Männlich", "name": "Männlich"},
|
||||
{"id": "Weiblich", "name": "Weiblich"},
|
||||
{"id": "Divers", "name": "Divers"},
|
||||
],
|
||||
groups: [
|
||||
{"id": "Gallier", "name": "Gallier (Wuppertal)"},
|
||||
{"id": "Gandalf", "name": "Gandalf (SG-Mangenberg)"},
|
||||
{"id": "Gravenrode", "name": "Gravenrode (SG-Gräfrath)"},
|
||||
{"id": "Lennep", "name": "Lennep (RS-Lennep)"},
|
||||
{"id": "Silva", "name": "Silva (SG-Wald)"},
|
||||
{"id": "Sugambrer", "name": "Sugambrer (SG-Höhscheid)"},
|
||||
{"id": "Tenkterer", "name": "Tenkterer (SG-Löhdorf)"},
|
||||
{"id": "von Berg", "name": "von Berg (SG-Ohligs)"},
|
||||
],
|
||||
agegroups: [
|
||||
{"id": "Biber", "name": "Biber"},
|
||||
{"id": "Wölfling", "name": "Wölfling"},
|
||||
{"id": "Jungpfadfinder", "name": "Jungpfadfinder"},
|
||||
{"id": "Pfadfinder", "name": "Pfadfinder"},
|
||||
{"id": "Rover", "name": "Rover"},
|
||||
{"id": "Leiter*in", "name": "Leiter*in"},
|
||||
],
|
||||
agegroupsroverleiter: [
|
||||
{"id": "Rover", "name": "Rover"},
|
||||
{"id": "Leiter*in", "name": "Leiter*in"},
|
||||
],
|
||||
agegroups_leaders: [
|
||||
{"id": "Biber", "name": "Biber"},
|
||||
{"id": "Wölfling", "name": "Wölfling"},
|
||||
{"id": "Jungpfadfinder", "name": "Jungpfadfinder"},
|
||||
{"id": "Pfadfinder", "name": "Pfadfinder"},
|
||||
{"id": "Rover", "name": "Rover"},
|
||||
],
|
||||
boolean: [
|
||||
{"id": "Ja", "name": "Ja"},
|
||||
{"id": "Nein", "name": "Nein"},
|
||||
],
|
||||
foodPreferences: [
|
||||
{"id": "Fleisch", "name": "Ich esse Fleisch"},
|
||||
{"id": "Vegan", "name": "Ich ernähre mich vegan"},
|
||||
{"id": "Glutenfrei", "name": "Ich vertrage kein Gluten"},
|
||||
{"id": "Laktosefrei", "name": "Ich vertrage keine Laktose"},
|
||||
],
|
||||
foodPreferencesVeg: [
|
||||
{"id": "Vegan", "name": "Ich ernähre mich vegan"},
|
||||
{"id": "Glutenfrei", "name": "Ich vertrage kein Gluten"},
|
||||
{"id": "Laktosefrei", "name": "Ich vertrage keine Laktose"},
|
||||
],
|
||||
slideTo(e, index) {
|
||||
if (e !== null) {
|
||||
e.preventDefault();
|
||||
}
|
||||
if (index < 0 || index > this.slides.length-1) {
|
||||
return;
|
||||
}
|
||||
this.scrollForm(this.$refs.form);
|
||||
this.active = index;
|
||||
this.$refs.slider.scrollLeft = this.$refs.slider.scrollWidth / this.slides.length * index;
|
||||
this.$refs.mobileSlider.scrollLeft = this.$refs.mobileSlider.scrollWidth / this.slides.length * index;
|
||||
},
|
||||
scrollForm(el) {
|
||||
var margin = window.getComputedStyle(el).marginTop.replace('px', '');
|
||||
scrollToElement(el, 300, (margin?margin:0) * -1);
|
||||
},
|
||||
submit() {
|
||||
var _self = this;
|
||||
_self.loading = true;
|
||||
var promise = fetch(window.location.href, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
'X-WINTER-REQUEST-HANDLER': this.submitRequest,
|
||||
'X-WINTER-REQUEST-PARTIALS': [],
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
},
|
||||
body: JSON.stringify(this.data),
|
||||
});
|
||||
|
||||
promise.then(function(response) {
|
||||
_self.loading = false;
|
||||
if (response.status === 422) {
|
||||
response.json().then((errors) => {
|
||||
_self.scrollToFirstError(errors);
|
||||
Object.keys(errors).forEach((field) => {
|
||||
toasted.error(errors[field].join('<br>'));
|
||||
});
|
||||
});
|
||||
}
|
||||
if (response.status === 201) {
|
||||
_self.finished = true;
|
||||
_self.scrollForm(_self.$refs.form);
|
||||
}
|
||||
});
|
||||
},
|
||||
scrollToFirstError(errors) {
|
||||
if (Object.keys(errors).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var firstField = Object.keys(errors)[0];
|
||||
var field = this.$refs.form.querySelector('[name="'+firstField+'"]');
|
||||
|
||||
if (field === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var slideElement = field.closest('.slider-element');
|
||||
this.slideTo(null, Array.from(slideElement.parentNode.children).indexOf(slideElement));
|
||||
},
|
||||
prevButton: {
|
||||
[':class']() {
|
||||
return this.active == 0 ? 'opacity-40' : '';
|
||||
}
|
||||
},
|
||||
nextButton: {
|
||||
[':class']() {
|
||||
return this.active == this.slides.length - 1 ? 'opacity-40' : '';
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
@ -1,152 +0,0 @@
|
|||
import scrollToElement from './scrollToElement.js';
|
||||
|
||||
var toastedOptions = {
|
||||
position: 'bottom-right',
|
||||
duration: 3000,
|
||||
fitToScreen: false,
|
||||
fullWidth: false,
|
||||
theme: 'material',
|
||||
};
|
||||
|
||||
export default function (toasted) {
|
||||
var toasted = new toasted(toastedOptions);
|
||||
|
||||
return {
|
||||
data: {
|
||||
event_id: null,
|
||||
gender: '',
|
||||
firstname: '',
|
||||
lastname: '',
|
||||
birthday: '',
|
||||
address: '',
|
||||
zip: '',
|
||||
location: '',
|
||||
phone: '',
|
||||
email: '',
|
||||
group: null,
|
||||
agegroup: null,
|
||||
food_preferences: [],
|
||||
evening: false,
|
||||
misc: '',
|
||||
parent: false,
|
||||
foto: false,
|
||||
ticket: false,
|
||||
},
|
||||
loading: false,
|
||||
finished: false,
|
||||
submitRequest: null,
|
||||
errorFields: [],
|
||||
active: 0,
|
||||
slides: [
|
||||
'Persönliches',
|
||||
'Veranstaltung',
|
||||
'Sonstiges'
|
||||
],
|
||||
genders: [
|
||||
{"id": "Männlich", "name": "Männlich"},
|
||||
{"id": "Weiblich", "name": "Weiblich"},
|
||||
{"id": "Divers", "name": "Divers"},
|
||||
],
|
||||
groups: [
|
||||
{"id": "Gallier", "name": "Gallier (Wuppertal)"},
|
||||
{"id": "Gandalf", "name": "Gandalf (SG-Mangenberg)"},
|
||||
{"id": "Gravenrode", "name": "Gravenrode (SG-Gräfrath)"},
|
||||
{"id": "Lennep", "name": "Lennep (RS-Lennep)"},
|
||||
{"id": "Silva", "name": "Silva (SG-Wald)"},
|
||||
{"id": "Sugambrer", "name": "Sugambrer (SG-Höhscheid)"},
|
||||
{"id": "Tenkterer", "name": "Tenkterer (SG-Löhdorf)"},
|
||||
{"id": "von Berg", "name": "von Berg (SG-Ohligs)"},
|
||||
],
|
||||
agegroups: [
|
||||
{"id": "Biber", "name": "Biber"},
|
||||
{"id": "Wölfling", "name": "Wölfling"},
|
||||
{"id": "Jungpfadfinder", "name": "Jungpfadfinder"},
|
||||
{"id": "Pfadfinder", "name": "Pfadfinder"},
|
||||
{"id": "Rover", "name": "Rover"},
|
||||
{"id": "Leiter*in", "name": "Leiter*in"},
|
||||
],
|
||||
boolean: [
|
||||
{"id": "Ja", "name": "Ja"},
|
||||
{"id": "Nein", "name": "Nein"},
|
||||
],
|
||||
foodPreferences: [
|
||||
{"id": "Fleisch", "name": "Ich esse Fleisch"},
|
||||
{"id": "Vegan", "name": "Ich ernähre mich vegan"},
|
||||
{"id": "Glutenfrei", "name": "Ich vertrage kein Gluten"},
|
||||
{"id": "Laktosefrei", "name": "Ich vertrage keine Laktose"},
|
||||
],
|
||||
slideTo(e, index) {
|
||||
if (e !== null) {
|
||||
e.preventDefault();
|
||||
}
|
||||
if (index < 0 || index > this.slides.length-1) {
|
||||
return;
|
||||
}
|
||||
this.scrollForm(this.$refs.form);
|
||||
this.active = index;
|
||||
this.$refs.slider.scrollLeft = this.$refs.slider.scrollWidth / this.slides.length * index;
|
||||
this.$refs.mobileSlider.scrollLeft = this.$refs.mobileSlider.scrollWidth / this.slides.length * index;
|
||||
},
|
||||
scrollForm(el) {
|
||||
var margin = window.getComputedStyle(el).marginTop.replace('px', '');
|
||||
scrollToElement(el, 300, (margin?margin:0) * -1);
|
||||
},
|
||||
submit() {
|
||||
var _self = this;
|
||||
_self.loading = true;
|
||||
var promise = fetch(window.location.href, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
'X-WINTER-REQUEST-HANDLER': this.submitRequest,
|
||||
'X-WINTER-REQUEST-PARTIALS': [],
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
},
|
||||
body: JSON.stringify(this.data),
|
||||
});
|
||||
|
||||
promise.then(function(response) {
|
||||
_self.loading = false;
|
||||
if (response.status === 422) {
|
||||
response.json().then((errors) => {
|
||||
_self.scrollToFirstError(errors);
|
||||
Object.keys(errors).forEach((field) => {
|
||||
toasted.error(errors[field].join('<br>'));
|
||||
});
|
||||
});
|
||||
}
|
||||
if (response.status === 201) {
|
||||
_self.finished = true;
|
||||
_self.scrollForm(_self.$refs.form);
|
||||
}
|
||||
});
|
||||
},
|
||||
scrollToFirstError(errors) {
|
||||
if (Object.keys(errors).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var firstField = Object.keys(errors)[0];
|
||||
var field = this.$refs.form.querySelector('[name="'+firstField+'"]');
|
||||
|
||||
if (field === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var slideElement = field.closest('.slider-element');
|
||||
this.slideTo(null, Array.from(slideElement.parentNode.children).indexOf(slideElement));
|
||||
},
|
||||
prevButton: {
|
||||
[':class']() {
|
||||
return this.active == 0 ? 'opacity-40' : '';
|
||||
}
|
||||
},
|
||||
nextButton: {
|
||||
[':class']() {
|
||||
return this.active == this.slides.length - 1 ? 'opacity-40' : '';
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
@ -1,148 +0,0 @@
|
|||
import scrollToElement from './scrollToElement.js';
|
||||
|
||||
var toastedOptions = {
|
||||
position: 'bottom-right',
|
||||
duration: 3000,
|
||||
fitToScreen: false,
|
||||
fullWidth: false,
|
||||
theme: 'material',
|
||||
};
|
||||
|
||||
export default function (toasted) {
|
||||
var toasted = new toasted(toastedOptions);
|
||||
|
||||
return {
|
||||
data: {
|
||||
event_id: null,
|
||||
gender: '',
|
||||
firstname: '',
|
||||
lastname: '',
|
||||
birthday: '',
|
||||
address: '',
|
||||
zip: '',
|
||||
location: '',
|
||||
phone: '',
|
||||
email: '',
|
||||
group: '',
|
||||
agegroup: '',
|
||||
food_preferences: [],
|
||||
allergies: '',
|
||||
misc: '',
|
||||
foto: false,
|
||||
parent: false,
|
||||
ab12: false,
|
||||
},
|
||||
loading: false,
|
||||
finished: false,
|
||||
submitRequest: null,
|
||||
errorFields: [],
|
||||
active: 0,
|
||||
slides: [
|
||||
'Persönliches',
|
||||
'Veranstaltung',
|
||||
'Sonstiges'
|
||||
],
|
||||
genders: [
|
||||
{"id": "Männlich", "name": "Männlich"},
|
||||
{"id": "Weiblich", "name": "Weiblich"},
|
||||
{"id": "Divers", "name": "Divers"},
|
||||
],
|
||||
groups: [
|
||||
{"id": "Gallier", "name": "Gallier (Wuppertal)"},
|
||||
{"id": "Gandalf", "name": "Gandalf (SG-Mangenberg)"},
|
||||
{"id": "Gravenrode", "name": "Gravenrode (SG-Gräfrath)"},
|
||||
{"id": "Lennep", "name": "Lennep (RS-Lennep)"},
|
||||
{"id": "Silva", "name": "Silva (SG-Wald)"},
|
||||
{"id": "Sugambrer", "name": "Sugambrer (SG-Höhscheid)"},
|
||||
{"id": "Tenkterer", "name": "Tenkterer (SG-Löhdorf)"},
|
||||
{"id": "von Berg", "name": "von Berg (SG-Ohligs)"},
|
||||
],
|
||||
agegroups: [
|
||||
{"id": "Jungpfadfinder", "name": "Jungpfadfinder"},
|
||||
{"id": "Leiter*in", "name": "Leiter*in"},
|
||||
],
|
||||
boolean: [
|
||||
{"id": "Ja", "name": "Ja"},
|
||||
{"id": "Nein", "name": "Nein"},
|
||||
],
|
||||
foodPreferences: [
|
||||
{"id": "Fleisch", "name": "Ich esse Fleisch"},
|
||||
{"id": "Vegan", "name": "Ich ernähre mich vegan"},
|
||||
{"id": "Glutenfrei", "name": "Ich vertrage kein Gluten"},
|
||||
{"id": "Laktosefrei", "name": "Ich vertrage keine Laktose"},
|
||||
],
|
||||
slideTo(e, index) {
|
||||
if (e !== null) {
|
||||
e.preventDefault();
|
||||
}
|
||||
if (index < 0 || index > this.slides.length-1) {
|
||||
return;
|
||||
}
|
||||
this.scrollForm(this.$refs.form);
|
||||
this.active = index;
|
||||
this.$refs.slider.scrollLeft = this.$refs.slider.scrollWidth / this.slides.length * index;
|
||||
this.$refs.mobileSlider.scrollLeft = this.$refs.mobileSlider.scrollWidth / this.slides.length * index;
|
||||
},
|
||||
scrollForm(el) {
|
||||
var margin = window.getComputedStyle(el).marginTop.replace('px', '');
|
||||
scrollToElement(el, 300, (margin?margin:0) * -1);
|
||||
},
|
||||
submit() {
|
||||
var _self = this;
|
||||
_self.loading = true;
|
||||
var promise = fetch(window.location.href, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
'X-WINTER-REQUEST-HANDLER': this.submitRequest,
|
||||
'X-WINTER-REQUEST-PARTIALS': [],
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
},
|
||||
body: JSON.stringify(this.data),
|
||||
});
|
||||
|
||||
promise.then(function(response) {
|
||||
_self.loading = false;
|
||||
if (response.status === 422) {
|
||||
response.json().then((errors) => {
|
||||
_self.scrollToFirstError(errors);
|
||||
Object.keys(errors).forEach((field) => {
|
||||
toasted.error(errors[field].join('<br>'));
|
||||
});
|
||||
});
|
||||
}
|
||||
if (response.status === 201) {
|
||||
_self.finished = true;
|
||||
_self.scrollForm(_self.$refs.form);
|
||||
}
|
||||
});
|
||||
},
|
||||
scrollToFirstError(errors) {
|
||||
if (Object.keys(errors).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var firstField = Object.keys(errors)[0];
|
||||
var field = this.$refs.form.querySelector('[name="'+firstField+'"]');
|
||||
|
||||
if (field === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var slideElement = field.closest('.slider-element');
|
||||
this.slideTo(null, Array.from(slideElement.parentNode.children).indexOf(slideElement));
|
||||
},
|
||||
prevButton: {
|
||||
[':class']() {
|
||||
return this.active == 0 ? 'opacity-40' : '';
|
||||
}
|
||||
},
|
||||
nextButton: {
|
||||
[':class']() {
|
||||
return this.active == this.slides.length - 1 ? 'opacity-40' : '';
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
@ -1,143 +0,0 @@
|
|||
import scrollToElement from './scrollToElement.js';
|
||||
|
||||
var toastedOptions = {
|
||||
position: 'bottom-right',
|
||||
duration: 3000,
|
||||
fitToScreen: false,
|
||||
fullWidth: false,
|
||||
theme: 'material',
|
||||
};
|
||||
|
||||
export default function (toasted) {
|
||||
var toasted = new toasted(toastedOptions);
|
||||
|
||||
return {
|
||||
data: {
|
||||
event_id: null,
|
||||
gender: '',
|
||||
firstname: '',
|
||||
lastname: '',
|
||||
birthday: '',
|
||||
phone: '',
|
||||
email: '',
|
||||
group: null,
|
||||
agegroup: null,
|
||||
food_preferences: [],
|
||||
misc: '',
|
||||
parent: false,
|
||||
foto: false,
|
||||
},
|
||||
loading: false,
|
||||
finished: false,
|
||||
submitRequest: null,
|
||||
errorFields: [],
|
||||
active: 0,
|
||||
slides: [
|
||||
'Persönliches',
|
||||
'Veranstaltung',
|
||||
'Sonstiges'
|
||||
],
|
||||
genders: [
|
||||
{"id": "Männlich", "name": "Männlich"},
|
||||
{"id": "Weiblich", "name": "Weiblich"},
|
||||
{"id": "Divers", "name": "Divers"},
|
||||
],
|
||||
groups: [
|
||||
{"id": "Gallier", "name": "Gallier (Wuppertal)"},
|
||||
{"id": "Gandalf", "name": "Gandalf (SG-Mangenberg)"},
|
||||
{"id": "Gravenrode", "name": "Gravenrode (SG-Gräfrath)"},
|
||||
{"id": "Lennep", "name": "Lennep (RS-Lennep)"},
|
||||
{"id": "Silva", "name": "Silva (SG-Wald)"},
|
||||
{"id": "Sugambrer", "name": "Sugambrer (SG-Höhscheid)"},
|
||||
{"id": "Tenkterer", "name": "Tenkterer (SG-Löhdorf)"},
|
||||
{"id": "von Berg", "name": "von Berg (SG-Ohligs)"},
|
||||
],
|
||||
agegroups: [
|
||||
{"id": "Rover", "name": "Rover"},
|
||||
{"id": "Leiter*in", "name": "Leiter*in"},
|
||||
],
|
||||
boolean: [
|
||||
{"id": "Ja", "name": "Ja"},
|
||||
{"id": "Nein", "name": "Nein"},
|
||||
],
|
||||
foodPreferences: [
|
||||
{"id": "Fleisch", "name": "Ich esse Fleisch"},
|
||||
{"id": "Vegan", "name": "Ich ernähre mich vegan"},
|
||||
{"id": "Glutenfrei", "name": "Ich vertrage kein Gluten"},
|
||||
{"id": "Laktosefrei", "name": "Ich vertrage keine Laktose"},
|
||||
],
|
||||
slideTo(e, index) {
|
||||
if (e !== null) {
|
||||
e.preventDefault();
|
||||
}
|
||||
if (index < 0 || index > this.slides.length-1) {
|
||||
return;
|
||||
}
|
||||
this.scrollForm(this.$refs.form);
|
||||
this.active = index;
|
||||
this.$refs.slider.scrollLeft = this.$refs.slider.scrollWidth / this.slides.length * index;
|
||||
this.$refs.mobileSlider.scrollLeft = this.$refs.mobileSlider.scrollWidth / this.slides.length * index;
|
||||
},
|
||||
scrollForm(el) {
|
||||
var margin = window.getComputedStyle(el).marginTop.replace('px', '');
|
||||
scrollToElement(el, 300, (margin?margin:0) * -1);
|
||||
},
|
||||
submit() {
|
||||
var _self = this;
|
||||
_self.loading = true;
|
||||
var promise = fetch(window.location.href, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
'X-WINTER-REQUEST-HANDLER': this.submitRequest,
|
||||
'X-WINTER-REQUEST-PARTIALS': [],
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
},
|
||||
body: JSON.stringify(this.data),
|
||||
});
|
||||
|
||||
promise.then(function(response) {
|
||||
_self.loading = false;
|
||||
if (response.status === 422) {
|
||||
response.json().then((errors) => {
|
||||
_self.scrollToFirstError(errors);
|
||||
Object.keys(errors).forEach((field) => {
|
||||
toasted.error(errors[field].join('<br>'));
|
||||
});
|
||||
});
|
||||
}
|
||||
if (response.status === 201) {
|
||||
_self.finished = true;
|
||||
_self.scrollForm(_self.$refs.form);
|
||||
}
|
||||
});
|
||||
},
|
||||
scrollToFirstError(errors) {
|
||||
if (Object.keys(errors).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var firstField = Object.keys(errors)[0];
|
||||
var field = this.$refs.form.querySelector('[name="'+firstField+'"]');
|
||||
|
||||
if (field === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var slideElement = field.closest('.slider-element');
|
||||
this.slideTo(null, Array.from(slideElement.parentNode.children).indexOf(slideElement));
|
||||
},
|
||||
prevButton: {
|
||||
[':class']() {
|
||||
return this.active == 0 ? 'opacity-40' : '';
|
||||
}
|
||||
},
|
||||
nextButton: {
|
||||
[':class']() {
|
||||
return this.active == this.slides.length - 1 ? 'opacity-40' : '';
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
@ -1,163 +0,0 @@
|
|||
import scrollToElement from "./scrollToElement.js";
|
||||
|
||||
var toastedOptions = {
|
||||
position: "bottom-right",
|
||||
duration: 3000,
|
||||
fitToScreen: false,
|
||||
fullWidth: false,
|
||||
theme: "material",
|
||||
};
|
||||
|
||||
export default function (toasted) {
|
||||
var toasted = new toasted(toastedOptions);
|
||||
|
||||
return {
|
||||
data: {
|
||||
event_id: null,
|
||||
firstname: "",
|
||||
lastname: "",
|
||||
address: "",
|
||||
zip: "",
|
||||
location: "",
|
||||
ticket: false,
|
||||
essen: [],
|
||||
food_preferences: [],
|
||||
essen_misc: '',
|
||||
gender: "",
|
||||
email: "",
|
||||
birthday: "",
|
||||
group: "",
|
||||
emergency_phone: "",
|
||||
phone: "",
|
||||
misc: "",
|
||||
foto: false,
|
||||
parent: false,
|
||||
vorteam: null,
|
||||
},
|
||||
loading: false,
|
||||
finished: false,
|
||||
submitRequest: null,
|
||||
errorFields: [],
|
||||
active: 0,
|
||||
slides: ["Persönliches", "Veranstaltung", "Sonstiges"],
|
||||
activities: [
|
||||
{ id: "Orga", name: "Orga" },
|
||||
{ id: "Teilnehmer*in", name: "Teilnehmer*in" },
|
||||
],
|
||||
genders: [
|
||||
{ id: "Männlich", name: "Männlich" },
|
||||
{ id: "Weiblich", name: "Weiblich" },
|
||||
{ id: "Divers", name: "Divers" },
|
||||
],
|
||||
essens: [
|
||||
// { id: "Rohkost", name: "Rohkost" },
|
||||
{ id: "Pizzaschnecken", name: "Pizzaschnecken" },
|
||||
{ id: "Brot / Brötchen", name: "Brot / Brötchen" },
|
||||
{ id: "Muffins / Kuchen", name: "Muffins / Kuchen" },
|
||||
{ id: "Dips", name: "Dips" },
|
||||
{ id: "Frikadellen", name: "Frikadellen" },
|
||||
{ id: "Sandwiches", name: "Sandwiches" },
|
||||
{ id: "Zimtschnecken", name: "Zimtschnecken" },
|
||||
{ id: "Gummibärchen", name: "Gummibärchen" },
|
||||
{ id: "Obst", name: "Obst" },
|
||||
{ id: "Käse", name: "Käse" }
|
||||
],
|
||||
groups: [
|
||||
{ id: "Gallier", name: "Gallier (Wuppertal)" },
|
||||
{ id: "Gandalf", name: "Gandalf (SG-Mangenberg)" },
|
||||
{ id: "Gravenrode", name: "Gravenrode (SG-Gräfrath)" },
|
||||
{ id: "Lennep", name: "Lennep (RS-Lennep)" },
|
||||
{ id: "Silva", name: "Silva (SG-Wald)" },
|
||||
{ id: "Sugambrer", name: "Sugambrer (SG-Höhscheid)" },
|
||||
{ id: "Tenkterer", name: "Tenkterer (SG-Löhdorf)" },
|
||||
{ id: "von Berg", name: "von Berg (SG-Ohligs)" },
|
||||
],
|
||||
boolean: [
|
||||
{ id: "Ja", name: "Ja" },
|
||||
{ id: "Nein", name: "Nein" },
|
||||
],
|
||||
foodPreferences: [
|
||||
{ id: "Fleisch", name: "Ich esse Fleisch" },
|
||||
{ id: "Vegan", name: "Ich ernähre mich vegan" },
|
||||
{ id: "Glutenfrei", name: "Ich vertrage kein Gluten" },
|
||||
{ id: "Laktosefrei", name: "Ich vertrage keine Laktose" },
|
||||
],
|
||||
slideTo(e, index) {
|
||||
if (e !== null) {
|
||||
e.preventDefault();
|
||||
}
|
||||
if (index < 0 || index > this.slides.length - 1) {
|
||||
return;
|
||||
}
|
||||
this.scrollForm(this.$refs.form);
|
||||
this.active = index;
|
||||
this.$refs.slider.scrollLeft =
|
||||
(this.$refs.slider.scrollWidth / this.slides.length) * index;
|
||||
this.$refs.mobileSlider.scrollLeft =
|
||||
(this.$refs.mobileSlider.scrollWidth / this.slides.length) * index;
|
||||
},
|
||||
scrollForm(el) {
|
||||
var margin = window.getComputedStyle(el).marginTop.replace("px", "");
|
||||
scrollToElement(el, 300, (margin ? margin : 0) * -1);
|
||||
},
|
||||
submit() {
|
||||
var _self = this;
|
||||
_self.loading = true;
|
||||
var promise = fetch(window.location.href, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"X-WINTER-REQUEST-HANDLER": this.submitRequest,
|
||||
"X-WINTER-REQUEST-PARTIALS": [],
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
},
|
||||
body: JSON.stringify(this.data),
|
||||
});
|
||||
|
||||
promise.then(function (response) {
|
||||
_self.loading = false;
|
||||
if (response.status === 422) {
|
||||
response.json().then((errors) => {
|
||||
_self.scrollToFirstError(errors);
|
||||
Object.keys(errors).forEach((field) => {
|
||||
toasted.error(errors[field].join("<br>"));
|
||||
});
|
||||
});
|
||||
}
|
||||
if (response.status === 201) {
|
||||
_self.finished = true;
|
||||
_self.scrollForm(_self.$refs.form);
|
||||
}
|
||||
});
|
||||
},
|
||||
scrollToFirstError(errors) {
|
||||
if (Object.keys(errors).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var firstField = Object.keys(errors)[0];
|
||||
var field = this.$refs.form.querySelector('[name="' + firstField + '"]');
|
||||
|
||||
if (field === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var slideElement = field.closest(".slider-element");
|
||||
this.slideTo(
|
||||
null,
|
||||
Array.from(slideElement.parentNode.children).indexOf(slideElement)
|
||||
);
|
||||
},
|
||||
prevButton: {
|
||||
[":class"]() {
|
||||
return this.active == 0 ? "opacity-40" : "";
|
||||
},
|
||||
},
|
||||
nextButton: {
|
||||
[":class"]() {
|
||||
return this.active == this.slides.length - 1 ? "opacity-40" : "";
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
|
@ -1,163 +0,0 @@
|
|||
import scrollToElement from "./scrollToElement.js";
|
||||
|
||||
var toastedOptions = {
|
||||
position: "bottom-right",
|
||||
duration: 3000,
|
||||
fitToScreen: false,
|
||||
fullWidth: false,
|
||||
theme: "material",
|
||||
};
|
||||
|
||||
export default function (toasted) {
|
||||
var toasted = new toasted(toastedOptions);
|
||||
|
||||
return {
|
||||
data: {
|
||||
event_id: null,
|
||||
firstname: "",
|
||||
lastname: "",
|
||||
address: "",
|
||||
zip: "",
|
||||
location: "",
|
||||
ticket: false,
|
||||
essen: [],
|
||||
food_preferences: [],
|
||||
essen_misc: '',
|
||||
gender: "",
|
||||
email: "",
|
||||
birthday: "",
|
||||
group: "",
|
||||
emergency_phone: "",
|
||||
phone: "",
|
||||
misc: "",
|
||||
foto: false,
|
||||
parent: false,
|
||||
vorteam: null,
|
||||
},
|
||||
loading: false,
|
||||
finished: false,
|
||||
submitRequest: null,
|
||||
errorFields: [],
|
||||
active: 0,
|
||||
slides: ["Persönliches", "Veranstaltung", "Sonstiges"],
|
||||
activities: [
|
||||
{ id: "Orga", name: "Orga" },
|
||||
{ id: "Teilnehmer*in", name: "Teilnehmer*in" },
|
||||
],
|
||||
genders: [
|
||||
{ id: "Männlich", name: "Männlich" },
|
||||
{ id: "Weiblich", name: "Weiblich" },
|
||||
{ id: "Divers", name: "Divers" },
|
||||
],
|
||||
essens: [
|
||||
// { id: "Rohkost", name: "Rohkost" },
|
||||
{ id: "Pizzaschnecken", name: "Pizzaschnecken" },
|
||||
{ id: "Brot / Brötchen", name: "Brot / Brötchen" },
|
||||
{ id: "Muffins / Kuchen", name: "Muffins / Kuchen" },
|
||||
{ id: "Dips", name: "Dips" },
|
||||
{ id: "Frikadellen", name: "Frikadellen" },
|
||||
{ id: "Sandwiches", name: "Sandwiches" },
|
||||
{ id: "Zimtschnecken", name: "Zimtschnecken" },
|
||||
{ id: "Gummibärchen", name: "Gummibärchen" },
|
||||
{ id: "Obst", name: "Obst" },
|
||||
{ id: "Käse", name: "Käse" }
|
||||
],
|
||||
groups: [
|
||||
{ id: "Gallier", name: "Gallier (Wuppertal)" },
|
||||
{ id: "Gandalf", name: "Gandalf (SG-Mangenberg)" },
|
||||
{ id: "Gravenrode", name: "Gravenrode (SG-Gräfrath)" },
|
||||
{ id: "Lennep", name: "Lennep (RS-Lennep)" },
|
||||
{ id: "Silva", name: "Silva (SG-Wald)" },
|
||||
{ id: "Sugambrer", name: "Sugambrer (SG-Höhscheid)" },
|
||||
{ id: "Tenkterer", name: "Tenkterer (SG-Löhdorf)" },
|
||||
{ id: "von Berg", name: "von Berg (SG-Ohligs)" },
|
||||
],
|
||||
boolean: [
|
||||
{ id: "Ja", name: "Ja" },
|
||||
{ id: "Nein", name: "Nein" },
|
||||
],
|
||||
foodPreferences: [
|
||||
{ id: "Fleisch", name: "Ich esse Fleisch" },
|
||||
{ id: "Vegan", name: "Ich ernähre mich vegan" },
|
||||
{ id: "Glutenfrei", name: "Ich vertrage kein Gluten" },
|
||||
{ id: "Laktosefrei", name: "Ich vertrage keine Laktose" },
|
||||
],
|
||||
slideTo(e, index) {
|
||||
if (e !== null) {
|
||||
e.preventDefault();
|
||||
}
|
||||
if (index < 0 || index > this.slides.length - 1) {
|
||||
return;
|
||||
}
|
||||
this.scrollForm(this.$refs.form);
|
||||
this.active = index;
|
||||
this.$refs.slider.scrollLeft =
|
||||
(this.$refs.slider.scrollWidth / this.slides.length) * index;
|
||||
this.$refs.mobileSlider.scrollLeft =
|
||||
(this.$refs.mobileSlider.scrollWidth / this.slides.length) * index;
|
||||
},
|
||||
scrollForm(el) {
|
||||
var margin = window.getComputedStyle(el).marginTop.replace("px", "");
|
||||
scrollToElement(el, 300, (margin ? margin : 0) * -1);
|
||||
},
|
||||
submit() {
|
||||
var _self = this;
|
||||
_self.loading = true;
|
||||
var promise = fetch(window.location.href, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"X-WINTER-REQUEST-HANDLER": this.submitRequest,
|
||||
"X-WINTER-REQUEST-PARTIALS": [],
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
},
|
||||
body: JSON.stringify(this.data),
|
||||
});
|
||||
|
||||
promise.then(function (response) {
|
||||
_self.loading = false;
|
||||
if (response.status === 422) {
|
||||
response.json().then((errors) => {
|
||||
_self.scrollToFirstError(errors);
|
||||
Object.keys(errors).forEach((field) => {
|
||||
toasted.error(errors[field].join("<br>"));
|
||||
});
|
||||
});
|
||||
}
|
||||
if (response.status === 201) {
|
||||
_self.finished = true;
|
||||
_self.scrollForm(_self.$refs.form);
|
||||
}
|
||||
});
|
||||
},
|
||||
scrollToFirstError(errors) {
|
||||
if (Object.keys(errors).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var firstField = Object.keys(errors)[0];
|
||||
var field = this.$refs.form.querySelector('[name="' + firstField + '"]');
|
||||
|
||||
if (field === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var slideElement = field.closest(".slider-element");
|
||||
this.slideTo(
|
||||
null,
|
||||
Array.from(slideElement.parentNode.children).indexOf(slideElement)
|
||||
);
|
||||
},
|
||||
prevButton: {
|
||||
[":class"]() {
|
||||
return this.active == 0 ? "opacity-40" : "";
|
||||
},
|
||||
},
|
||||
nextButton: {
|
||||
[":class"]() {
|
||||
return this.active == this.slides.length - 1 ? "opacity-40" : "";
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
|
@ -1,228 +0,0 @@
|
|||
import scrollToElement from "./scrollToElement.js";
|
||||
|
||||
var toastedOptions = {
|
||||
position: "bottom-right",
|
||||
duration: 3000,
|
||||
fitToScreen: false,
|
||||
fullWidth: false,
|
||||
theme: "material",
|
||||
};
|
||||
|
||||
export default function (toasted) {
|
||||
var toasted = new toasted(toastedOptions);
|
||||
|
||||
return {
|
||||
data: {
|
||||
event_id: null,
|
||||
firstname: "",
|
||||
lastname: "",
|
||||
address: "",
|
||||
zip: "",
|
||||
location: "",
|
||||
courses: [],
|
||||
fcourses: [],
|
||||
food_preferences: [],
|
||||
activity: "Teilnehmer*in",
|
||||
gender: "",
|
||||
email: "",
|
||||
birthday: "",
|
||||
agegroup: "",
|
||||
group: "",
|
||||
agegroup_leader: "",
|
||||
emergency_phone: "",
|
||||
phone: "",
|
||||
misc: "",
|
||||
foto: false,
|
||||
parent: false,
|
||||
vorteam: null,
|
||||
},
|
||||
finished: false,
|
||||
submitRequest: null,
|
||||
errorFields: [],
|
||||
active: 0,
|
||||
slides: ["Persönliches", "Veranstaltung", "Sonstiges"],
|
||||
activities: [
|
||||
{ id: "Orga", name: "Orga" },
|
||||
{ id: "Teilnehmer*in", name: "Teilnehmer*in" },
|
||||
],
|
||||
genders: [
|
||||
{ id: "Männlich", name: "Männlich" },
|
||||
{ id: "Weiblich", name: "Weiblich" },
|
||||
{ id: "Divers", name: "Divers" },
|
||||
],
|
||||
fcourses: [
|
||||
{
|
||||
id: "Ich bin Samstags beim Abendprogramm dabei",
|
||||
name: "Ich bin Samstags beim Abendprogramm dabei",
|
||||
},
|
||||
{
|
||||
id: "Ich esse sonntag Mittag mit",
|
||||
name: "Ich esse sonntag Mittag mit",
|
||||
},
|
||||
],
|
||||
groups: [
|
||||
{ id: "Gallier", name: "Gallier (Wuppertal)" },
|
||||
{ id: "Gandalf", name: "Gandalf (SG-Mangenberg)" },
|
||||
{ id: "Gravenrode", name: "Gravenrode (SG-Gräfrath)" },
|
||||
{ id: "Lennep", name: "Lennep (RS-Lennep)" },
|
||||
{ id: "Silva", name: "Silva (SG-Wald)" },
|
||||
{ id: "Sugambrer", name: "Sugambrer (SG-Höhscheid)" },
|
||||
{ id: "Tenkterer", name: "Tenkterer (SG-Löhdorf)" },
|
||||
{ id: "von Berg", name: "von Berg (SG-Ohligs)" },
|
||||
],
|
||||
agegroups: [
|
||||
{ id: "Biber", name: "Biber" },
|
||||
{ id: "Wölfling", name: "Wölfling" },
|
||||
{ id: "Jungpfadfinder", name: "Jungpfadfinder" },
|
||||
{ id: "Pfadfinder", name: "Pfadfinder" },
|
||||
{ id: "Rover", name: "Rover" },
|
||||
{ id: "Leiter*in", name: "Leiter*in" },
|
||||
],
|
||||
agegroupsroverleiter: [
|
||||
{ id: "Rover", name: "Rover" },
|
||||
{ id: "Leiter*in", name: "Leiter*in" },
|
||||
],
|
||||
agegroups_leaders: [
|
||||
{ id: "Biber", name: "Biber" },
|
||||
{ id: "Wölfling", name: "Wölfling" },
|
||||
{ id: "Jungpfadfinder", name: "Jungpfadfinder" },
|
||||
{ id: "Pfadfinder", name: "Pfadfinder" },
|
||||
{ id: "Rover", name: "Rover" },
|
||||
],
|
||||
boolean: [
|
||||
{ id: "Ja", name: "Ja" },
|
||||
{ id: "Nein", name: "Nein" },
|
||||
],
|
||||
foodPreferences: [
|
||||
{ id: "Fleisch", name: "Ich esse Fleisch" },
|
||||
{ id: "Vegan", name: "Ich ernähre mich vegan" },
|
||||
{ id: "Glutenfrei", name: "Ich vertrage kein Gluten" },
|
||||
{ id: "Laktosefrei", name: "Ich vertrage keine Laktose" },
|
||||
],
|
||||
foodPreferencesVeg: [
|
||||
{ id: "Vegan", name: "Ich ernähre mich vegan" },
|
||||
{ id: "Glutenfrei", name: "Ich vertrage kein Gluten" },
|
||||
{ id: "Laktosefrei", name: "Ich vertrage keine Laktose" },
|
||||
],
|
||||
updateCourses() {
|
||||
this.data.courses.forEach((course) => {
|
||||
let currentCourseOption = this.courses.find((c) => c.id === course);
|
||||
currentCourseOption.without.forEach((c) => {
|
||||
this.data.courses = this.data.courses.filter((tc) => tc !== c);
|
||||
});
|
||||
});
|
||||
},
|
||||
get courses() {
|
||||
return this.data.agegroup === "Rover"
|
||||
? [
|
||||
{
|
||||
id: "s2",
|
||||
name: "Schritt 2",
|
||||
hint: "Sonntag, 10 - 18 Uhr",
|
||||
without: ["3c", "2e"],
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
id: "2c",
|
||||
name: "Baustein 2c",
|
||||
hint: "Pfadfinderische Methodik - Samstag 10 - 18 Uhr",
|
||||
without: [],
|
||||
},
|
||||
{
|
||||
id: "3c",
|
||||
name: "Baustein 3c",
|
||||
hint: "Finanzen, Haftung, Versicherung - Sonntag 10 - 13 Uhr",
|
||||
without: ["s2"],
|
||||
},
|
||||
{
|
||||
id: "2e",
|
||||
name: "Baustein 2e",
|
||||
hint: "Präventionsschulung - Sonntag 14 - 17 Uhr",
|
||||
without: ["s2"],
|
||||
},
|
||||
{
|
||||
id: "s2",
|
||||
name: "Schritt 2",
|
||||
hint: "Sonntag, 10 - 18 Uhr",
|
||||
without: ["3c", "2e"],
|
||||
},
|
||||
];
|
||||
},
|
||||
slideTo(e, index) {
|
||||
if (e !== null) {
|
||||
e.preventDefault();
|
||||
}
|
||||
if (index < 0 || index > this.slides.length - 1) {
|
||||
return;
|
||||
}
|
||||
this.scrollForm(this.$refs.form);
|
||||
this.active = index;
|
||||
this.$refs.slider.scrollLeft =
|
||||
(this.$refs.slider.scrollWidth / this.slides.length) * index;
|
||||
this.$refs.mobileSlider.scrollLeft =
|
||||
(this.$refs.mobileSlider.scrollWidth / this.slides.length) * index;
|
||||
},
|
||||
scrollForm(el) {
|
||||
var margin = window.getComputedStyle(el).marginTop.replace("px", "");
|
||||
scrollToElement(el, 300, (margin ? margin : 0) * -1);
|
||||
},
|
||||
submit() {
|
||||
var _self = this;
|
||||
var promise = fetch(window.location.href, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"X-WINTER-REQUEST-HANDLER": this.submitRequest,
|
||||
"X-WINTER-REQUEST-PARTIALS": [],
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
},
|
||||
body: JSON.stringify(this.data),
|
||||
});
|
||||
|
||||
promise.then(function (response) {
|
||||
if (response.status === 422) {
|
||||
response.json().then((errors) => {
|
||||
_self.scrollToFirstError(errors);
|
||||
Object.keys(errors).forEach((field) => {
|
||||
toasted.error(errors[field].join("<br>"));
|
||||
});
|
||||
});
|
||||
}
|
||||
if (response.status === 201) {
|
||||
_self.finished = true;
|
||||
_self.scrollForm(_self.$refs.form);
|
||||
}
|
||||
});
|
||||
},
|
||||
scrollToFirstError(errors) {
|
||||
if (Object.keys(errors).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var firstField = Object.keys(errors)[0];
|
||||
var field = this.$refs.form.querySelector('[name="' + firstField + '"]');
|
||||
|
||||
if (field === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var slideElement = field.closest(".slider-element");
|
||||
this.slideTo(
|
||||
null,
|
||||
Array.from(slideElement.parentNode.children).indexOf(slideElement)
|
||||
);
|
||||
},
|
||||
prevButton: {
|
||||
[":class"]() {
|
||||
return this.active == 0 ? "opacity-40" : "";
|
||||
},
|
||||
},
|
||||
nextButton: {
|
||||
[":class"]() {
|
||||
return this.active == this.slides.length - 1 ? "opacity-40" : "";
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* y: the y coordinate to scroll, 0 = top
|
||||
* duration: scroll duration in milliseconds; default is 0 (no transition)
|
||||
* element: the html element that should be scrolled ; default is the main scrolling element
|
||||
*/
|
||||
function scrollToY (y, duration = 0, element = document.scrollingElement) {
|
||||
// cancel if already on target position
|
||||
if (element.scrollTop === y) return;
|
||||
|
||||
const cosParameter = (element.scrollTop - y) / 2;
|
||||
let scrollCount = 0, oldTimestamp = null;
|
||||
|
||||
function step (newTimestamp) {
|
||||
if (oldTimestamp !== null) {
|
||||
// if duration is 0 scrollCount will be Infinity
|
||||
scrollCount += Math.PI * (newTimestamp - oldTimestamp) / duration;
|
||||
if (scrollCount >= Math.PI) return element.scrollTop = y;
|
||||
element.scrollTop = cosParameter + y + cosParameter * Math.cos(scrollCount);
|
||||
}
|
||||
oldTimestamp = newTimestamp;
|
||||
window.requestAnimationFrame(step);
|
||||
}
|
||||
window.requestAnimationFrame(step);
|
||||
}
|
||||
|
||||
export default function(element, duration = 0, addedOffset = 0) {
|
||||
const offset = Math.round(element.getBoundingClientRect().top);
|
||||
scrollToY(document.scrollingElement.scrollTop + offset + addedOffset, duration);
|
||||
}
|
||||
|
|
@ -59,15 +59,19 @@ class ProcessSubmitJob implements ShouldQueue
|
|||
$filesystem = app(Filesystem::class)->client();
|
||||
$orderBy = collect($this->event->loadConfig('orderBy'))->map(fn ($order) => "{$order['key']} {$order['direction']}")->implode(',');
|
||||
$groupBy = $this->event->loadConfig('groupBy');
|
||||
$participants = Participant::where('event_id', $this->event->id)->orderByRaw($orderBy)->get()->groupBy(fn ($p) => data_get($p->payload, $groupBy));
|
||||
|
||||
$s = $this->newSpreadsheet();
|
||||
|
||||
if ($this->event->loadConfig('groupAll')) {
|
||||
$this->makeSheet($s, 'Alle', Participant::where('event_id', $this->event->id)->orderByRaw($orderBy)->get());
|
||||
}
|
||||
|
||||
foreach ($participants as $group => $groupParticipants) {
|
||||
$this->makeSheet($s, $group, $groupParticipants);
|
||||
if ($groupBy) {
|
||||
$participants = Participant::where('event_id', $this->event->id)->orderByRaw($orderBy)->get()->groupBy(fn ($p) => data_get($p->payload, $groupBy));
|
||||
|
||||
foreach ($participants as $group => $groupParticipants) {
|
||||
$this->makeSheet($s, $group, $groupParticipants);
|
||||
}
|
||||
}
|
||||
|
||||
$s = $this->addStat($s);
|
||||
|
|
Loading…
Reference in New Issue