Add thanks

This commit is contained in:
philipp lang 2023-01-07 18:13:03 +01:00
parent f066456b81
commit 17f8f50866
5 changed files with 32 additions and 111 deletions

View File

@ -33,6 +33,7 @@ export default function (toasted) {
vorteam: null, vorteam: null,
}, },
meta: { meta: {
finished: true,
submitRequest: null, submitRequest: null,
errorFields: [], errorFields: [],
active: 2, active: 2,
@ -123,6 +124,9 @@ export default function (toasted) {
}); });
}); });
} }
if (response.status === 201) {
_self.meta.finished = true;
}
}); });
}, },
scrollToFirstError(errors) { scrollToFirstError(errors) {

View File

@ -7,6 +7,7 @@ use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Lang; use Illuminate\Support\Facades\Lang;
use Input; use Input;
use Winter\Storm\Support\Facades\Validator; use Winter\Storm\Support\Facades\Validator;
use Zoomyboy\Event\Models\Participant;
class EventForm extends ComponentBase class EventForm extends ComponentBase
{ {
@ -57,7 +58,10 @@ class EventForm extends ComponentBase
return response()->json($validator->errors(), 422); return response()->json($validator->errors(), 422);
} }
$fields = $validator->validated(); Participant::create(array_merge($validator->validated(), [
dd($fields); 'vorteam' => 'Ja' === Input::get('vorteam'),
]));
return response()->json([], 201);
} }
} }

View File

@ -97,7 +97,7 @@
{#+++ registrationForm +++#} {#+++ registrationForm +++#}
<form x-ref="form" @submit.prevent="submit" class="my-6" novalidate> <form x-ref="form" @submit.prevent="submit" class="my-6" novalidate>
<div x-ref="eventFormContainer" class="{{formContainerClass}}"> <div x-ref="eventFormContainer" class="{{formContainerClass}}" x-show="meta.finished === false">
{% set arrowClass = "flex flex-col md:flex-row items-center justify-center md:justify-start px-2 flex-auto md:pl-6 h-12 md:h-16 transition duration-300" %} {% set arrowClass = "flex flex-col md:flex-row items-center justify-center md:justify-start px-2 flex-auto md:pl-6 h-12 md:h-16 transition duration-300" %}
{% set positionClass = "flex items-center justify-center w-4 md:w-6 h-4 md:h-6 rounded-full bg-teal-800 text-teal-200 font-goudy transition duration-300" %} {% set positionClass = "flex items-center justify-center w-4 md:w-6 h-4 md:h-6 rounded-full bg-teal-800 text-teal-200 font-goudy transition duration-300" %}
{% set arrowFont = "text-sm text-teal-100" %} {% set arrowFont = "text-sm text-teal-100" %}
@ -198,116 +198,29 @@
</div> </div>
</div> </div>
<div class="{{formContainerClass}} max-w-[700px] mx-auto" x-show="meta.finished === true">
<!-- <div class="bg-white shadow-2xl ring-1 ring-gray-900/5 rounded-xl grid grid-cols-1 sm:grid-cols-[1fr_250px] grid-rows-[10rem_1fr] gap-6 overflow-hidden bg-gradient-to-bl from-white via-white to-black/10">
{#+++ Sidebar +++#} <div class="bg-primary w-40 h-40 flex justify-center items-center [clip-path:circle(70%_at_30%_30%)]">
<div class="relative hidden event-form-sidebar lg_block"> <svg class="w-24 h-24 text-emerald-300 relative -left-3 -top-3" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
<div class="absolute w-full h-full"> <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" />
<div class="sticky h-full bg-white rounded-lg shadow top-10"> </svg>
<div class="relative"> </div>
<img src="{{__SELF__.event.header_image | media}}" class="object-cover w-full h-48"> <div class="isolate self-center justify-self-end row-span-2 sm:pt-8 sm:pb-8 relative -right-3">
<div class="absolute bottom-0 w-full px-4 py-2 leading-tight bg-white-t600"> <div class="absolute right-0 top-0 h-full flex items-center justify-end">
<h3 class="text-primary-800 font-goudy">{{__SELF__.event.name}}</h3> <div class="bg-primary w-96 h-96 flex [clip-path:circle(50%_at_110%_50%)] sm:[clip-path:circle(50%_at_80%_50%)]"></div>
<div class="text-xs">{{ __SELF__.event.dates }} {{ __SELF__.event.times }}</div> </div>
<div class="overflow-hidden rounded-l-lg rotate-2 shadow relative z-10 -left-2">
<img class="w-64 h-32 object-cover" src="{{'danke/1.jpg'|media}}" />
</div>
<div class="overflow-hidden rounded-l-lg -rotate-2 shadow relative left-2">
<img class="w-64 h-32 object-cover" src="{{'danke/2.jpg'|media}}" />
</div> </div>
</div> </div>
<div class="overflow-auto" style="height: calc(100% - 12rem);"> <div class="self-end flex-grow pb-8 pl-8 pr-8 sm:pr-0">
<div class="p-4 text-gray-800 grid row-gap-2"> <div class="font-bold text-xl">Vielen Dank für deine Anmeldung.</div>
<h3 class="leading-tight text-primary-800 font-goudy">Persönliche Daten</h3> <div class="text-sm mt-4">In Kürze erhalten Sie eine Bestätigung per E-Mail mit weiteren Zahlungs-Infos. Eine letzte Info wird dir zeitnah vor dem Lager zugeschickt.</div>
<div class="leading-tight">
<div class="text-xs text-gray-600">Funktion</div>
<div class="text-sm" x-html="data.activity"></div>
</div>
<div class="leading-tight" x-show="hasAddress()">
<div class="text-xs text-gray-600">Name & Adresse</div>
<div class="text-sm">
<div x-html="`${data.firstname} ${data.lastname}`"></div>
<div x-html="data.address"></div>
<div x-html="`${data.zip} ${data.location}`"></div>
</div>
</div>
<div class="leading-tight" x-show="data.birthday">
<div class="text-xs text-gray-600">Geburtsdatum</div>
<div class="text-sm" x-html="data.birthday"></div>
</div>
<div class="leading-tight" x-show="data.phone || data.email">
<div class="text-xs text-gray-600">Kontakt</div>
<div class="text-sm">
<div x-show="data.phone" x-html="`Tel: ${data.phone}`"></div>
<div x-show="data.email" x-html="`E-Mail: ${data.email}`"></div>
</div>
</div>
<h3 class="mt-4 leading-tight text-primary-800 font-goudy" x-show="data.region_id !=-1 || data.group_id != -1">Gruppierung</h3>
<div class="leading-tight" x-show="data.region_id != -1 || data.group_id != -1">
<div class="text-xs text-gray-600">Gruppierung</div>
<div class="text-sm">
<div x-html="data.group"></div>
</div>
</div>
<h3 class="mt-4 leading-tight text-primary-800 font-goudy" x-show="data.food_preferences.length > 0">Verpflegung</h3>
<div class="leading-tight" x-show="data.food_preferences.length > 0">
<div class="text-xs text-gray-600">Lebensmittelunverträglichkeiten</div>
<ul>
<template x-for="fi in data.food_preferences">
<li class="text-sm" x-html="fi"></li>
</template>
<li class="text-sm" x-show="data.further_food_intolerances" x-html="data.further_food_intolerances"></li>
</ul>
</div>
<h3 class="mt-4 leading-tight text-primary-800 font-goudy" x-show="data.rooms || data.add_misc !== null || data.misc">Sonstiges</h3>
<div class="leading-tight" x-show="data.add_misc !== null">
<div class="text-xs text-gray-600">Barrierefreiheit</div>
<div class="text-sm" x-html="data.add_misc"></div>
</div>
<div class="leading-tight" x-show="data.rooms">
<div class="text-xs text-gray-600">Zimmerwünsche</div>
<div class="text-sm" x-html="data.rooms"></div>
</div>
<div class="leading-tight" x-show="data.misc">
<div class="text-xs text-gray-600">Sonstige Wünsche</div>
<div class="text-sm" x-html="data.misc"></div>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div>
-->
</form> </form>
<!--
{#+++ Pflichtfeld +++ #}
<div class="mt-2 text-lg text-gray-800">
<span class="text-red-800">*</span> Pflichtfeld
</div>
{#+++ popup +++#}
<div class="popup" id="waiting-popup">
<div class="relative text-gray-600 popup-inner">
<script class="tmpl" type="text/html">
<div class="absolute top-0 right-0 flex items-center justify-center w-16 h-16 mt-4 mr-4 bg-yellow-500 rounded-full opacity-50">
<div class="flex items-center justify-center w-10 h-10 bg-yellow-100 rounded-full">
<svg class="w-10 h-10 text-yellow-700 border-gray-400 fill-current border-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM9 5h2v6H9V5zm0 8h2v2H9v-2z"/></svg>
</div>
</div>
<h2 class="flex-shrink-0 text-xl font-semibold text-gray-800">Auf die Warteliste setzen?</h2>
<h2 class="flex-shrink-0 text-sm font-semibold text-gray-600">Für <%= eventname %></h2>
<div class="relative mt-5 richeditor content small">
<h2>Was ist die Warteliste?</h2>
Wenn du dich für die Warteliste einträgst, wirst du automatisch per E-Mail benachrichtigt, wenn bei dieser Unterveranstaltung ein Platz frei wird. Du hast dann die Möglichkeit, zu dieser Unterveranstaltung zu wechseln, und meldest dich zeitgleich von einer beliebigen anderen Unterveranstaltung ab.
<h2>Was nun</h2>
Wähle bitte neben dieser Unterveranstaltung deine "regulären" Veranstatungen aus.
</div>
<div class="flex justify-end mt-6">
<button class="mr-6 btn btn-shine btn-primary btn-sm" type="button" data-confirm>Auf Warteliste setzen</button>
<button class="btn-shine btn btn-danger btn-sm" type="button" data-reject>Nee, doch nicht</button>
</div>
</script>
<div></div>
</div>
</div>
-->
</div> </div>

View File

@ -39,7 +39,7 @@ class Participant extends Model
/** /**
* @var array Attributes to be cast to JSON * @var array Attributes to be cast to JSON
*/ */
protected $jsonable = []; protected $jsonable = ['food_preferences'];
/** /**
* @var array Attributes to be appended to the API representation of the model (ex. toArray()) * @var array Attributes to be appended to the API representation of the model (ex. toArray())

View File

@ -21,7 +21,7 @@ class CreateParticipantsTable extends Migration
$table->string('group')->nullable(); $table->string('group')->nullable();
$table->string('agegroup'); $table->string('agegroup');
$table->string('agegroup_leader'); $table->string('agegroup_leader');
$table->boolean('vorteam'); $table->boolean('vorteam')->default(false);
$table->boolean('foto'); $table->boolean('foto');
$table->string('emergency_phone'); $table->string('emergency_phone');
$table->string('address'); $table->string('address');