fix vorteam

This commit is contained in:
philipp lang 2023-01-07 17:51:26 +01:00
parent ade334e2f9
commit f066456b81
3 changed files with 18 additions and 10 deletions

View File

@ -24,13 +24,13 @@ export default function (toasted) {
email: 'philipp@aaa.de',
birthday: '1991-06-20',
agegroup: 'Leiter',
group: '',
agegroup_leader: '',
emergency_phone: '',
group: 'Leiter',
agegroup_leader: 'Wölfling',
emergency_phone: '+49 1756 70342425',
phone: '+49 176 70342420',
misc: '',
misc: 'Lrem ipfrgfg',
foto: false,
vorteam: false,
vorteam: null,
},
meta: {
submitRequest: null,

View File

@ -25,7 +25,7 @@ class EventForm extends ComponentBase
public function onSubmit(): JsonResponse
{
$validator = Validator::make(Input::all(), [
$rules = [
'activity' => 'required|max:255',
'gender' => 'required|max:255',
'firstname' => 'required|max:255',
@ -43,7 +43,15 @@ class EventForm extends ComponentBase
'food_preferences' => 'array',
'misc' => '',
'foto' => '',
], [], Lang::get('zoomyboy.event::validation.attributes'));
];
if ('Orga' === Input::get('activity')) {
$rules['vorteam'] = 'in:Ja,Nein';
}
$validator = Validator::make(Input::all(), $rules, [
'vorteam.in' => 'Bitte gebe an, ob du am Vorteam teilnehmen willst.',
], Lang::get('zoomyboy.event::validation.attributes'));
if ($validator->fails()) {
return response()->json($validator->errors(), 422);

View File

@ -1,14 +1,14 @@
<div class="flex flex-col items-center space-y-4 md:space-y-0 md:flex-row mt-10 justify-start md:justify-evenly">
{% if not first %}
<div class="bg-primary hover:bg-emerald-600 px-4 py-2 shadow text-teal-200 leading-none rounded-lg" @click.prevent="slideTo($event, meta.active - 1)">
<div class="bg-primary hover:bg-emerald-600 px-4 py-2 shadow text-teal-200 leading-none cursor-pointer rounded-lg" @click.prevent="slideTo($event, meta.active - 1)">
Zurück
</div>
{% endif %}
{% if not last %}
<div class="bg-primary hover:bg-emerald-600 px-4 py-2 shadow text-teal-200 leading-none rounded-lg" @click.prevent="slideTo($event, meta.active + 1)">
<div class="bg-primary hover:bg-emerald-600 px-4 py-2 shadow text-teal-200 leading-none cursor-pointer rounded-lg" @click.prevent="slideTo($event, meta.active + 1)">
Weiter
</div>
{% else %}
<button type="submit" class="bg-primary hover:bg-emerald-600 px-4 py-2 shadow text-teal-200 leading-none rounded-lg">{% if p %} Anmeldung aktualisieren {% else %} Anmeldung absenden {% endif %}</button>
<button type="submit" class="bg-primary hover:bg-emerald-600 px-4 py-2 shadow text-teal-200 leading-none cursor-pointer rounded-lg">{% if p %} Anmeldung aktualisieren {% else %} Anmeldung absenden {% endif %}</button>
{% endif %}
</div>