Public Access
bugfixes
This commit is contained in:
1 parent
3db040e243
commit
9a3187f9b6
11 files changed
+332
-114
No files matched your search
@@ -2,36 +2,34 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Models\Bewerbung;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use App\Models\Bewerbung;
|
|
||||||
|
|
||||||
class BewerbungController extends Controller
|
class BewerbungController extends Controller
|
||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$bewerbungen = Bewerbung::orderByDesc('created_at')->paginate(15);
|
$bewerbungen = Bewerbung::latest()->paginate(15);
|
||||||
return view('bewerbung_index', compact('bewerbungen'));
|
return view('bewerbung.index', compact('bewerbungen'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
return view('bewerbungc');
|
return view('bewerbung.create');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$data = $request->validate([
|
$data = $request->validate([
|
||||||
'name' => ['required','string','max:255'],
|
'name' => ['required','string','max:255'],
|
||||||
'text' => ['required','string','max:5000'],
|
'text' => ['required','string','max:5000'],
|
||||||
'pic' => ['nullable','image','mimes:jpg,jpeg,png','max:4096'],
|
'pic' => ['nullable','image','mimes:jpg,jpeg,png','max:4096'],
|
||||||
'bedingungen' => ['nullable','file','mimetypes:application/pdf','max:8192'],
|
'bedingungen' => ['nullable','file','mimetypes:application/pdf','max:8192'],
|
||||||
'active' => ['nullable','boolean'],
|
'time' => ['nullable'],
|
||||||
'time' => ['nullable','boolean'],
|
'active' => ['nullable'],
|
||||||
'sdate' => ['nullable','date'],
|
'start_at' => ['nullable','date'],
|
||||||
'edate' => ['nullable','date','after_or_equal:sdate'],
|
'end_at' => ['nullable','date','after_or_equal:start_at'],
|
||||||
'stime' => ['nullable','date_format:H:i'],
|
|
||||||
'etime' => ['nullable','date_format:H:i'],
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($request->hasFile('pic')) {
|
if ($request->hasFile('pic')) {
|
||||||
@@ -41,42 +39,61 @@ class BewerbungController extends Controller
|
|||||||
$data['bedingungen_path'] = $request->file('bedingungen')->store('bewerbungen/bedingungen', 'public');
|
$data['bedingungen_path'] = $request->file('bedingungen')->store('bewerbungen/bedingungen', 'public');
|
||||||
}
|
}
|
||||||
|
|
||||||
$data['active'] = (bool) $request->input('active', false);
|
$data['active'] = $request->boolean('active');
|
||||||
$data['time'] = (bool) $request->input('time', false);
|
$data['time'] = $request->boolean('time');
|
||||||
|
|
||||||
// Build datetime columns if provided
|
$bewerbung = Bewerbung::create($data);
|
||||||
$start_at = null;
|
|
||||||
$end_at = null;
|
|
||||||
|
|
||||||
if ($request->filled('sdate')) {
|
return redirect()->route('bewerbungen.show', $bewerbung)->with('success', 'Bewerbung erstellt.');
|
||||||
$start_at = $request->input('sdate');
|
}
|
||||||
if ($request->filled('stime')) {
|
|
||||||
$start_at .= ' '.$request->input('stime').':00';
|
|
||||||
} else {
|
|
||||||
$start_at .= ' 00:00:00';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($request->filled('edate')) {
|
public function show(Bewerbung $bewerbung)
|
||||||
$end_at = $request->input('edate');
|
{
|
||||||
if ($request->filled('etime')) {
|
return view('bewerbung.show', compact('bewerbung'));
|
||||||
$end_at .= ' '.$request->input('etime').':00';
|
}
|
||||||
} else {
|
|
||||||
$end_at .= ' 23:59:59';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$bewerbung = Bewerbung::create([
|
public function edit(Bewerbung $bewerbung)
|
||||||
'name' => $data['name'],
|
{
|
||||||
'text' => $data['text'],
|
return view('bewerbung.edit', compact('bewerbung'));
|
||||||
'pic_path' => $data['pic_path'] ?? null,
|
}
|
||||||
'bedingungen_path' => $data['bedingungen_path'] ?? null,
|
|
||||||
'active' => $data['active'],
|
public function update(Request $request, Bewerbung $bewerbung)
|
||||||
'time' => $data['time'],
|
{
|
||||||
'start_at' => $start_at,
|
$data = $request->validate([
|
||||||
'end_at' => $end_at,
|
'name' => ['required','string','max:255'],
|
||||||
|
'text' => ['required','string','max:5000'],
|
||||||
|
'pic' => ['nullable','image','mimes:jpg,jpeg,png','max:4096'],
|
||||||
|
'bedingungen' => ['nullable','file','mimetypes:application/pdf','max:8192'],
|
||||||
|
'time' => ['nullable'],
|
||||||
|
'active' => ['nullable'],
|
||||||
|
'start_at' => ['nullable','date'],
|
||||||
|
'end_at' => ['nullable','date','after_or_equal:start_at'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return redirect()->route('bewerbung.index')->with('success', 'Bewerbung gespeichert.');
|
if ($request->hasFile('pic')) {
|
||||||
|
if ($bewerbung->pic_path) Storage::disk('public')->delete($bewerbung->pic_path);
|
||||||
|
$data['pic_path'] = $request->file('pic')->store('bewerbungen/pics', 'public');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->hasFile('bedingungen')) {
|
||||||
|
if ($bewerbung->bedingungen_path) Storage::disk('public')->delete($bewerbung->bedingungen_path);
|
||||||
|
$data['bedingungen_path'] = $request->file('bedingungen')->store('bewerbungen/bedingungen', 'public');
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['active'] = $request->boolean('active');
|
||||||
|
$data['time'] = $request->boolean('time');
|
||||||
|
|
||||||
|
$bewerbung->update($data);
|
||||||
|
|
||||||
|
return redirect()->route('bewerbungen.show', $bewerbung)->with('success', 'Bewerbung aktualisiert.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy(Bewerbung $bewerbung)
|
||||||
|
{
|
||||||
|
if ($bewerbung->pic_path) Storage::disk('public')->delete($bewerbung->pic_path);
|
||||||
|
if ($bewerbung->bedingungen_path) Storage::disk('public')->delete($bewerbung->bedingungen_path);
|
||||||
|
$bewerbung->delete();
|
||||||
|
|
||||||
|
return redirect()->route('bewerbungen.index')->with('success', 'Bewerbung gelöscht.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
|
|
||||||
class bewerbung extends Controller
|
|
||||||
{
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
$data = $request->validate([
|
|
||||||
'name' => ['required','string','max:255'],
|
|
||||||
'text' => ['required','string','max:5000'],
|
|
||||||
'pic' => ['nullable','image','mimes:jpg,jpeg,png','max:4096'],
|
|
||||||
'bedingungen' => ['nullable','file','mimetypes:application/pdf','max:8192'],
|
|
||||||
'active' => ['sometimes','accepted'],
|
|
||||||
'time' => ['sometimes','accepted'],
|
|
||||||
'sdate' => ['nullable','date'],
|
|
||||||
'edate' => ['nullable','date','after_or_equal:sdate'],
|
|
||||||
'stime' => ['nullable','date_format:H:i'],
|
|
||||||
'etime' => ['nullable','date_format:H:i'],
|
|
||||||
]);
|
|
||||||
|
|
||||||
if ($request->hasFile('pic')) {
|
|
||||||
$data['pic_path'] = $request->file('pic')->store('bewerbungen/pics', 'public');
|
|
||||||
}
|
|
||||||
if ($request->hasFile('bedingungen')) {
|
|
||||||
$data['bedingungen_path'] = $request->file('bedingungen')->store('bewerbungen/bedingungen', 'public');
|
|
||||||
}
|
|
||||||
|
|
||||||
$data['active'] = $request->boolean('active');
|
|
||||||
$data['time'] = $request->boolean('time');
|
|
||||||
|
|
||||||
// TODO: $bewerbung = Bewerbung::create($data);
|
|
||||||
|
|
||||||
return redirect()->back()->with('success', 'Bewerbung gespeichert.');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -12,14 +12,20 @@ class Bewerbung extends Model
|
|||||||
protected $table = 'bewerbungen';
|
protected $table = 'bewerbungen';
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'name','text','pic_path','bedingungen_path','active','time',
|
'name',
|
||||||
'start_at','end_at'
|
'text',
|
||||||
|
'pic_path',
|
||||||
|
'bedingungen_path',
|
||||||
|
'active',
|
||||||
|
'time',
|
||||||
|
'start_at',
|
||||||
|
'end_at',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'active' => 'boolean',
|
'active' => 'boolean',
|
||||||
'time' => 'boolean',
|
'time' => 'boolean',
|
||||||
'start_at' => 'datetime',
|
'start_at' => 'datetime',
|
||||||
'end_at' => 'datetime',
|
'end_at' => 'datetime',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -10,31 +10,17 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('bewerbungen', function (Blueprint $table) {
|
Schema::create('bewerbungen', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
|
|
||||||
// Basisdaten
|
|
||||||
$table->string('name', 255);
|
$table->string('name', 255);
|
||||||
$table->text('text'); // Bewerbungstext ist i.d.R. länger als 255
|
$table->text('text');
|
||||||
|
$table->string('pic')->nullable(); // storage path
|
||||||
// Dateien (optional) – Pfade in /storage/app/public/...
|
$table->string('pdf')->nullable(); // storage path
|
||||||
$table->string('pic_path', 2048)->nullable();
|
$table->boolean('active')->default(false);
|
||||||
$table->string('bedingungen_path', 2048)->nullable();
|
$table->boolean('time')->default(false);
|
||||||
|
$table->timestamp('start_at')->nullable();
|
||||||
// Status & Zeitsteuerung
|
$table->timestamp('end_at')->nullable();
|
||||||
$table->boolean('active')->default(true)->index(); // "aktiv" -> lieber englisch/konsequent
|
|
||||||
$table->boolean('timed')->default(false)->index(); // ob zeitgesteuert
|
|
||||||
|
|
||||||
// Zeitraum (optional, wenn timed = true)
|
|
||||||
$table->timestamp('start_at')->nullable()->index();
|
|
||||||
$table->timestamp('end_at')->nullable()->index();
|
|
||||||
|
|
||||||
$table->timestampsTz();
|
$table->timestampsTz();
|
||||||
$table->softDeletesTz();
|
$table->softDeletesTz();
|
||||||
});
|
});
|
||||||
|
|
||||||
// OPTIONAL: DB-Check (MySQL 8+/Postgres) – nur wenn deine DB & Laravel-Version das unterstützen
|
|
||||||
// Schema::table('bewerbungen', function (Blueprint $table) {
|
|
||||||
// $table->check('(end_at IS NULL OR start_at IS NULL OR end_at >= start_at)');
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(): void
|
public function down(): void
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<div class="col-md-12"><div class="col-md-3"> </div><div class="col-md-4 col-lg-4">
|
<div class="col-md-12"><div class="col-md-3"> </div><div class="col-md-4 col-lg-4">
|
||||||
<p>Muss noch variabel gefüllt werden</p>
|
<p>Muss noch variabel gefüllt werden</p>
|
||||||
<p><a href="#" target="_blank">Bewerbungsbedingungen</a></p>
|
<p><a href="#" target="_blank">Bewerbungsbedingungen</a></p>
|
||||||
<form method="POST" action="{{ route('bewerbung.store') }}" enctype="multipart/form-data">@csrf
|
<form method="POST" action="">
|
||||||
<label for="bname">Bandname*</label>
|
<label for="bname">Bandname*</label>
|
||||||
<input type="text" name="bname" id="bname" class="text" placeholder="Bandname" value="" required>
|
<input type="text" name="bname" id="bname" class="text" placeholder="Bandname" value="" required>
|
||||||
<label for="musik">Musikrichtung</label>
|
<label for="musik">Musikrichtung</label>
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
@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 class="form-check form-switch mb-3">
|
||||||
|
<input class="form-check-input" type="checkbox" role="switch" id="active" name="active" {{ old('active', $bewerbung->active ?? false) ? '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 class="row g-2">
|
||||||
|
<div class="col">
|
||||||
|
<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">
|
||||||
|
<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>
|
||||||
|
</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>
|
||||||
|
</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">
|
||||||
|
<a href="{{ route('bewerbungen.index') }}" class="btn btn-outline-secondary">Abbrechen</a>
|
||||||
|
<button class="btn btn-primary">Speichern</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
@extends('template')
|
||||||
|
|
||||||
|
@section('title', 'Bewerbung bearbeiten')
|
||||||
|
@section('content')
|
||||||
|
<div class="container mt-4">
|
||||||
|
<h1 class="h3 mb-3">Bewerbung bearbeiten</h1>
|
||||||
|
<form action="{{ route('bewerbungen.update', $bewerbung) }}" method="POST" enctype="multipart/form-data" novalidate>
|
||||||
|
@method('PUT')
|
||||||
|
@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 class="form-check form-switch mb-3">
|
||||||
|
<input class="form-check-input" type="checkbox" role="switch" id="active" name="active" {{ old('active', $bewerbung->active ?? false) ? '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 class="row g-2">
|
||||||
|
<div class="col">
|
||||||
|
<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">
|
||||||
|
<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>
|
||||||
|
</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>
|
||||||
|
</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">
|
||||||
|
<a href="{{ route('bewerbungen.show', $bewerbung) }}" class="btn btn-outline-secondary">Abbrechen</a>
|
||||||
|
<button class="btn btn-primary">Speichern</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
@extends('template')
|
||||||
|
|
||||||
|
@section('title', 'Bewerbungen')
|
||||||
|
@section('content')
|
||||||
|
<div class="container mt-4">
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||||
|
<h1 class="h3">Bewerbungen</h1>
|
||||||
|
<a href="{{ route('bewerbungen.create') }}" class="btn btn-primary">Neu</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if(session('success'))
|
||||||
|
<div class="alert alert-success">{{ session('success') }}</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<table class="table table-striped align-middle">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Aktiv</th>
|
||||||
|
<th>Zeitraum</th>
|
||||||
|
<th>Erstellt</th>
|
||||||
|
<th class="text-end">Aktionen</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@forelse($bewerbungen as $b)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $b->id }}</td>
|
||||||
|
<td>{{ $b->name }}</td>
|
||||||
|
<td>
|
||||||
|
<span class="badge {{ $b->active ? 'bg-success' : 'bg-secondary' }}">
|
||||||
|
{{ $b->active ? 'Ja' : 'Nein' }}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@if($b->start_at) {{ $b->start_at->format('d.m.Y H:i') }} @endif
|
||||||
|
@if($b->end_at) – {{ $b->end_at->format('d.m.Y H:i') }} @endif
|
||||||
|
</td>
|
||||||
|
<td>{{ optional($b->created_at)->format('d.m.Y H:i') }}</td>
|
||||||
|
<td class="text-end">
|
||||||
|
<a href="{{ route('bewerbungen.show', $b) }}" class="btn btn-sm btn-outline-secondary">Anzeigen</a>
|
||||||
|
<a href="{{ route('bewerbungen.edit', $b) }}" class="btn btn-sm btn-outline-primary">Bearbeiten</a>
|
||||||
|
<form action="{{ route('bewerbungen.destroy', $b) }}" method="POST" class="d-inline" onsubmit="return confirm('Wirklich löschen?');">
|
||||||
|
@csrf
|
||||||
|
@method('DELETE')
|
||||||
|
<button class="btn btn-sm btn-outline-danger">Löschen</button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@empty
|
||||||
|
<tr><td colspan="6">Keine Bewerbungen vorhanden.</td></tr>
|
||||||
|
@endforelse
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
{{ $bewerbungen->links() }}
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
@extends('template')
|
||||||
|
|
||||||
|
@section('title', 'Bewerbung anzeigen')
|
||||||
|
@section('content')
|
||||||
|
<div class="container mt-4">
|
||||||
|
@if(session('success'))
|
||||||
|
<div class="alert alert-success">{{ session('success') }}</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||||
|
<h1 class="h3 mb-0">{{ $bewerbung->name }}</h1>
|
||||||
|
<div>
|
||||||
|
<a href="{{ route('bewerbungen.edit', $bewerbung) }}" class="btn btn-sm btn-primary">Bearbeiten</a>
|
||||||
|
<a href="{{ route('bewerbungen.index') }}" class="btn btn-sm btn-outline-secondary">Zur Liste</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p><strong>Aktiv:</strong> {{ $bewerbung->active ? 'Ja' : 'Nein' }}</p>
|
||||||
|
<p><strong>Zeitraum:</strong>
|
||||||
|
@if($bewerbung->start_at) {{ $bewerbung->start_at->format('d.m.Y H:i') }} @endif
|
||||||
|
@if($bewerbung->end_at) – {{ $bewerbung->end_at->format('d.m.Y H:i') }} @endif
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<strong>Text:</strong>
|
||||||
|
<div class="border rounded p-3 bg-light mt-1">{{ $bewerbung->text }}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if($bewerbung->pic_path)
|
||||||
|
<p><strong>Bild:</strong> <br>
|
||||||
|
<img src="{{ Storage::url($bewerbung->pic_path) }}" alt="" style="max-height:180px"></p>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if($bewerbung->bedingungen_path)
|
||||||
|
<p><strong>Bewerbungsbedingungen:</strong> <a href="{{ Storage::url($bewerbung->bedingungen_path) }}" target="_blank">PDF öffnen</a></p>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<form action="{{ route('bewerbungen.destroy', $bewerbung) }}" method="POST" class="mt-4" onsubmit="return confirm('Wirklich löschen?');">
|
||||||
|
@csrf
|
||||||
|
@method('DELETE')
|
||||||
|
<button class="btn btn-outline-danger">Löschen</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
@section('title', 'Bewerbung erstellen')
|
@section('title', 'Bewerbung erstellen')
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="formgroup">
|
<div class="formgroup">
|
||||||
<form action="{{ route('bewerbung.store') }}" method="post" enctype="multipart/form-data" novalidate>
|
<form action="{{ route('bewerbungen.store') }}" method="post" enctype="multipart/form-data" novalidate>
|
||||||
@csrf
|
@csrf
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6 mt-3">
|
<div class="col-md-6 mt-3">
|
||||||
|
|||||||
+7
-3
@@ -5,6 +5,9 @@ use Illuminate\Support\Facades\Route;
|
|||||||
use App\Http\Controllers\BandsController;
|
use App\Http\Controllers\BandsController;
|
||||||
use App\Http\Controllers\BewerbungController;
|
use App\Http\Controllers\BewerbungController;
|
||||||
|
|
||||||
|
Route::resource('bewerbungen', BewerbungController::class);
|
||||||
|
Route::post('bewerbung', [BewerbungController::class, 'store'])->name('bewerbung.store');
|
||||||
|
|
||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
return view('wartung');
|
return view('wartung');
|
||||||
});Route
|
});Route
|
||||||
@@ -24,6 +27,7 @@ Route::get('kontakt', function() {
|
|||||||
return 'Nils Bonorden';
|
return 'Nils Bonorden';
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::get('bewerbungen', [BewerbungController::class, 'index'])->name('bewerbung.index');
|
|
||||||
Route::get('bewerbung/create', [BewerbungController::class, 'create'])->name('bewerbung.create');
|
|
||||||
Route::post('bewerbung', [BewerbungController::class, 'store'])->name('bewerbung.store');
|
// Bewerbung CRUD
|
||||||
|
Route::resource('bewerbungen', BewerbungController::class);
|
||||||
Reference in new issue
Block a user