Files
bandtoolv2/resources/views/bewerbung/create.blade.php
T

71 lines
3.2 KiB
PHP

@extends('template')
@section('title', 'Bewerbung erstellen')
@section('content')
<div class="container mt-4">
<h1 class="h3 mb-3">Bewerbung erstellen</h1>
<form action="{{ route('bewerbungen.store') }}" method="POST" enctype="multipart/form-data" novalidate>
@csrf
<div class="row">
<div class="col-md-6 mt-3">
<label for="name" class="mb-2">Bewerbungsname*</label>
<input type="text" id="name" name="name" class="form-control mb-3" value="{{ old('name', $bewerbung->name ?? '') }}" required>
<label for="text" class="mb-2">Bewerbungstext*</label>
<textarea name="text" id="text" class="form-control mb-3" rows="6" required>{{ old('text', $bewerbung->text ?? '') }}</textarea>
</div>
<div class="col-md-6 mt-3">
<label for="pic" class="mb-2">Bild (jpg/png, optional)</label>
<input type="file" id="pic" name="pic" class="form-control mb-3" accept="image/jpeg,image/png">
@isset($bewerbung->pic_path)
<p>Aktuell: <a href="{{ Storage::url($bewerbung->pic_path) }}" target="_blank">Bild ansehen</a></p>
@endisset
<label for="bedingungen" class="mb-2">Bewerbungsbedingungen (PDF, optional)</label>
<input type="file" id="bedingungen" name="bedingungen" class="form-control mb-3" accept="application/pdf">
@isset($bewerbung->bedingungen_path)
<p>Aktuell: <a href="{{ Storage::url($bewerbung->bedingungen_path) }}" target="_blank">PDF ansehen</a></p>
@endisset
<div class="form-check form-switch mb-3">
<input class="form-check-input" type="checkbox" role="switch" id="active" name="active" {{ old('active', $bewerbung->active ?? true) ? 'checked' : '' }}>
<label class="form-check-label" for="active">Aktiv</label>
</div>
<div class="form-check form-switch mb-3">
<input class="form-check-input" type="checkbox" role="switch" id="time" name="time" {{ old('time', $bewerbung->time ?? false) ? 'checked' : '' }}>
<label class="form-check-label" for="time">Mit Zeitraum</label>
</div>
</div>
</div>
<div class="row g-2">
<div class="col-md-6 mt-3">
<label class="mb-2" for="start_at">Start</label>
<input type="datetime-local" id="start_at" name="start_at" class="form-control mb-3" value="{{ old('start_at', isset($bewerbung->start_at) ? $bewerbung->start_at->format('Y-m-d\TH:i') : '') }}">
</div>
<div class="col-md-6 mt-3">
<label class="mb-2" for="end_at">Ende</label>
<input type="datetime-local" id="end_at" name="end_at" class="form-control mb-3" value="{{ old('end_at', isset($bewerbung->end_at) ? $bewerbung->end_at->format('Y-m-d\TH:i') : '') }}">
</div>
</div>
@if ($errors->any())
<div class="alert alert-danger mt-3">
<ul class="mb-0">
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="mt-3 mb-3">
<a href="{{ route('bewerbungen.index') }}" class="btn btn-outline-secondary">Abbrechen</a>
<button class="btn btn-primary">Speichern</button>
</div>
</form>
</div>
@endsection