Wekan #15 "Schulart"
This commit is contained in:
@@ -27,6 +27,12 @@
|
|||||||
|
|
||||||
let fileInputKey = 0;
|
let fileInputKey = 0;
|
||||||
let pdfDatein = [];
|
let pdfDatein = [];
|
||||||
|
let deutschNote = '';
|
||||||
|
let matheNote = '';
|
||||||
|
let sozialverhalten = '';
|
||||||
|
let ablehnungHinweis = '';
|
||||||
|
let showAblehnungModal = false;
|
||||||
|
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
const res = await fetch('/api/dienststellen');
|
const res = await fetch('/api/dienststellen');
|
||||||
@@ -50,6 +56,9 @@
|
|||||||
wunsch2Id = '';
|
wunsch2Id = '';
|
||||||
wunsch3Id = '';
|
wunsch3Id = '';
|
||||||
motivation = '';
|
motivation = '';
|
||||||
|
deutschNote = '';
|
||||||
|
matheNote = '';
|
||||||
|
sozialverhalten = '';
|
||||||
pdfDateien = [];
|
pdfDateien = [];
|
||||||
fileInputKey += 1;
|
fileInputKey += 1;
|
||||||
success = false;
|
success = false;
|
||||||
@@ -74,11 +83,29 @@
|
|||||||
data.append('wunsch1Id', wunsch1Id);
|
data.append('wunsch1Id', wunsch1Id);
|
||||||
data.append('wunsch2Id', wunsch2Id);
|
data.append('wunsch2Id', wunsch2Id);
|
||||||
data.append('wunsch3Id', wunsch3Id);
|
data.append('wunsch3Id', wunsch3Id);
|
||||||
|
data.append('deutschNote', deutschNote);
|
||||||
|
data.append('matheNote', matheNote);
|
||||||
|
data.append('sozialverhalten', sozialverhalten);
|
||||||
|
|
||||||
for (const pdf of pdfDateien) {
|
for (const pdf of pdfDateien) {
|
||||||
data.append('pdfs', pdf);
|
data.append('pdfs', pdf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const deutsch = parseInt(deutschNote);
|
||||||
|
const mathe = parseInt(matheNote);
|
||||||
|
|
||||||
|
if (isNaN(deutsch) || isNaN(mathe) || deutsch > 3 && mathe > 3) {
|
||||||
|
ablehnungHinweis = 'Du brauchst mindestens eine 3 in Deutsch oder Mathematik, um dich bewerben zu können. Bewirb dich gern erneut, wenn du die Voraussetzung erfüllst.';
|
||||||
|
showAblehnungModal = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sozialverhalten === 'Entspricht den Erwartungen mit Einschränkungen') {
|
||||||
|
ablehnungHinweis = 'Dein Sozialverhalten muss mindestens den Erwartungen entsprechen. Bewirb dich gern erneut, wenn du die Voraussetzung erfüllst.';
|
||||||
|
showAblehnungModal = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const res = await fetch('/api/anmelden', {
|
const res = await fetch('/api/anmelden', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: data
|
body: data
|
||||||
@@ -120,7 +147,29 @@
|
|||||||
<input bind:value={ort} placeholder="Ort" required class="input" />
|
<input bind:value={ort} placeholder="Ort" required class="input" />
|
||||||
<input bind:value={telefon} placeholder="Telefonnummer" required class="input col-span-2" />
|
<input bind:value={telefon} placeholder="Telefonnummer" required class="input col-span-2" />
|
||||||
<input bind:value={email} type="email" placeholder="E-Mail-Adresse" required class="input col-span-2" />
|
<input bind:value={email} type="email" placeholder="E-Mail-Adresse" required class="input col-span-2" />
|
||||||
<input bind:value={schulart} placeholder="Schulart" required class="input col-span-2" />
|
<!-- input bind:value={schulart} placeholder="Schulart" required class="input col-span-2" /-->
|
||||||
|
<!-- Schulart Dropdown -->
|
||||||
|
<select bind:value={schulart} required class="input">
|
||||||
|
<option value="" disabled selected hidden>Schulart wählen</option>
|
||||||
|
<option value="Mittelschule">Mittelschule</option>
|
||||||
|
<option value="Realschule">Realschule</option>
|
||||||
|
<option value="Gymnasium">Gymnasium</option>
|
||||||
|
<option value="FOS">Fachoberschule (FOS)</option>
|
||||||
|
<option value="BOS">Berufsoberschule (BOS)</option>
|
||||||
|
</select>
|
||||||
|
<!-- Noten -->
|
||||||
|
<div class="grid grid-cols-2 gap-4">
|
||||||
|
<input bind:value={deutschNote} type="number" min="1" max="6" placeholder="Note in Deutsch" required class="input" />
|
||||||
|
<input bind:value={matheNote} type="number" min="1" max="6" placeholder="Note in Mathe" required class="input" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Sozialverhalten -->
|
||||||
|
<select bind:value={sozialverhalten} required class="input">
|
||||||
|
<option value="" disabled selected hidden>Sozialverhalten auswählen</option>
|
||||||
|
<option value="Entspricht den Erwartungen in vollem Umfang">Entspricht den Erwartungen in vollem Umfang</option>
|
||||||
|
<option value="Entspricht den Erwartungen">Entspricht den Erwartungen</option>
|
||||||
|
<option value="Entspricht den Erwartungen mit Einschränkungen">Entspricht den Erwartungen mit Einschränkungen</option>
|
||||||
|
</select>
|
||||||
<input bind:value={zeitraum} placeholder="Wunschzeitraum fürs Praktikum" required class="input col-span-2" />
|
<input bind:value={zeitraum} placeholder="Wunschzeitraum fürs Praktikum" required class="input col-span-2" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -172,6 +221,20 @@
|
|||||||
</div>
|
</div>
|
||||||
{/key}
|
{/key}
|
||||||
|
|
||||||
|
{#if showAblehnungModal}
|
||||||
|
<div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
||||||
|
<div class="bg-white p-6 rounded shadow-lg text-center space-y-4 max-w-sm w-full">
|
||||||
|
<p class="text-red-600 font-semibold">{ablehnungHinweis}</p>
|
||||||
|
<button
|
||||||
|
class="bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700"
|
||||||
|
on:click={() => { resetForm(); showAblehnungModal = false; }}
|
||||||
|
>
|
||||||
|
OK
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<!-- Button -->
|
<!-- Button -->
|
||||||
<button type="submit"
|
<button type="submit"
|
||||||
class="w-full bg-blue-600 text-white py-3 rounded-xl hover:bg-blue-700 transition-all">
|
class="w-full bg-blue-600 text-white py-3 rounded-xl hover:bg-blue-700 transition-all">
|
||||||
|
|||||||
Reference in New Issue
Block a user