Public Access
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7545873aec | ||
|
|
af044ab501 | ||
|
|
4bf6014766 | ||
|
|
c0b853e457 | ||
|
|
c90d0dc806 | ||
|
|
7a6a62da27 |
No files matched your search
@@ -1,61 +1,54 @@
|
||||
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
|
||||
# Bandtool v2
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
|
||||
</p>
|
||||
Bandtool v2 ist eine Webanwendung für Mukke SHG e. V. Das Orga-Team kann für Veranstaltungen Bewerbungsrunden anlegen und festlegen, welches Formular für Bands geöffnet ist. Bands brauchen kein Konto, um ein öffentliches Formular aufzurufen.
|
||||
|
||||
## About Laravel
|
||||
## Aktueller Stand
|
||||
|
||||
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
|
||||
- **Für das Orga-Team:** Bewerbungsrunden anlegen, bearbeiten, aktivieren, deaktivieren und löschen. Pro Runde lassen sich ein Beschreibungstext, ein Bild, Bewerbungsbedingungen als PDF und ein Zeitraum hinterlegen.
|
||||
- **Für Bands:** Das Orga-Team kann den Link `/bewerbungen/{id}/form` teilen. Ist die Runde aktiv, wird das Formular angezeigt; andernfalls erscheint ein Hinweis. Der hinterlegte Zeitraum schaltet das Formular noch nicht automatisch frei oder ab.
|
||||
- **Noch offen:** Das öffentliche Formular nimmt noch keine Einsendungen entgegen und speichert keine Bandbewerbungen.
|
||||
|
||||
- [Simple, fast routing engine](https://laravel.com/docs/routing).
|
||||
- [Powerful dependency injection container](https://laravel.com/docs/container).
|
||||
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
|
||||
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
|
||||
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
|
||||
- [Robust background job processing](https://laravel.com/docs/queues).
|
||||
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
|
||||
Unter `/` erscheint derzeit eine Wartungsseite. Die Projektstartseite liegt unter `/start`, der Orga-Login unter `/login` und die Verwaltung unter `/bewerbungen`.
|
||||
|
||||
Laravel is accessible, powerful, and provides tools required for large, robust applications.
|
||||
## Lokal starten
|
||||
|
||||
## Learning Laravel
|
||||
Vorausgesetzt werden PHP ab 8.2 mit PDO SQLite, Composer 2 sowie Node.js 24 mit npm. Die Anwendung nutzt Laravel 12, Blade, Bootstrap und Vite.
|
||||
|
||||
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
|
||||
1. Dieses Repository klonen und den Branch `try_and_error` auschecken.
|
||||
2. Im Projektverzeichnis eine lokale `.env` anlegen, falls noch keine existiert. Das Repository enthält derzeit keine `.env.example`. Für die lokale Einrichtung genügen diese Werte:
|
||||
|
||||
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
|
||||
```dotenv
|
||||
APP_ENV=local
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://127.0.0.1:8000
|
||||
DB_CONNECTION=sqlite
|
||||
```
|
||||
|
||||
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
|
||||
3. Abhängigkeiten installieren, die lokale Datenbank vorbereiten und die Anwendung starten:
|
||||
|
||||
## Laravel Sponsors
|
||||
```sh
|
||||
composer install
|
||||
php artisan key:generate
|
||||
touch database/database.sqlite
|
||||
php artisan migrate
|
||||
php artisan storage:link
|
||||
npm install
|
||||
npm run build
|
||||
php artisan serve
|
||||
```
|
||||
|
||||
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
|
||||
Danach ist die Anwendung unter <http://127.0.0.1:8000/start> erreichbar. `storage:link` macht hochgeladene Bilder und PDF-Dateien über die Anwendung abrufbar. Die `.env` und die lokale Datenbank gehören nicht ins Repository.
|
||||
|
||||
### Premium Partners
|
||||
## Orga-Zugang
|
||||
|
||||
- **[Vehikl](https://vehikl.com)**
|
||||
- **[Tighten Co.](https://tighten.co)**
|
||||
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
|
||||
- **[64 Robots](https://64robots.com)**
|
||||
- **[Curotec](https://www.curotec.com/services/technologies/laravel)**
|
||||
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
|
||||
- **[Redberry](https://redberry.international/laravel-development)**
|
||||
- **[Active Logic](https://activelogic.com)**
|
||||
Es gibt keine öffentliche Registrierung und kein voreingestelltes Orga-Konto. Nach der Migration muss ein Benutzerkonto in der Datenbank vorhanden sein und ausdrücklich für die Verwaltung freigeschaltet werden. Für ein vorhandenes Konto geht das zum Beispiel über `php artisan tinker`:
|
||||
|
||||
## Contributing
|
||||
```php
|
||||
\App\Models\User::where('email', 'orga@example.org')->firstOrFail()->forceFill(['is_admin' => true])->save();
|
||||
```
|
||||
|
||||
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
Die Beispieladresse durch die E-Mail des vorgesehenen Kontos ersetzen. Danach kann sich das Orga-Team unter `/login` anmelden. Die Standard-Testdaten sind nicht für eine bereitgestellte Instanz gedacht.
|
||||
|
||||
## Code of Conduct
|
||||
## Tests
|
||||
|
||||
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
|
||||
|
||||
## License
|
||||
|
||||
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
Nach der lokalen Einrichtung führt `php artisan test` die Tests aus. Sie prüfen unter anderem, dass Gäste das öffentliche Formular öffnen können, aber nur freigeschaltete Orga-Konten Bewerbungsrunden verwalten dürfen.
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\BandApplication;
|
||||
use App\Models\Bewerbung;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
|
||||
class BandApplicationAdminController extends Controller
|
||||
{
|
||||
// Einzelansicht einer Bewerbung
|
||||
public function show(BandApplication $application)
|
||||
{
|
||||
$application->load(['band','bewerbung']);
|
||||
return view('admin.applications.show', compact('application'));
|
||||
}
|
||||
|
||||
// Status ändern (submitted, in_review, accepted, rejected)
|
||||
public function updateStatus(Request $request, BandApplication $application)
|
||||
{
|
||||
$data = $request->validate([
|
||||
'status' => ['required','in:submitted,in_review,accepted,rejected'],
|
||||
]);
|
||||
|
||||
$application->update($data);
|
||||
|
||||
return back()->with('success', 'Status aktualisiert.');
|
||||
}
|
||||
|
||||
// Optional: CSV-Export aller Bewerbungen einer Runde
|
||||
// public function exportCsv(Bewerbung $bewerbung): StreamedResponse
|
||||
// {
|
||||
// $filename = 'applications_' . $bewerbung->slug . '.csv';
|
||||
// $headers = [
|
||||
// 'Content-Type' => 'text/csv',
|
||||
// 'Content-Disposition' => 'attachment; filename="'.$filename.'"',
|
||||
// ];
|
||||
// $callback = function() use ($bewerbung) {
|
||||
// $handle = fopen('php://output', 'w');
|
||||
// fputcsv($handle, ['ID','Band','Email','Status','Datum','Demo','Nachricht']);
|
||||
// foreach ($bewerbung->applications()->with('band')->cursor() as $app) {
|
||||
// fputcsv($handle, [
|
||||
// $app->id,
|
||||
// optional($app->band)->name,
|
||||
// optional($app->band)->email,
|
||||
// $app->status,
|
||||
// $app->created_at,
|
||||
// $app->demo_link,
|
||||
// preg_replace("/\r|\n/", " ", (string)$app->message),
|
||||
// ]);
|
||||
// }
|
||||
// fclose($handle);
|
||||
// };
|
||||
// return response()->stream($callback, 200, $headers);
|
||||
// }
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Bewerbung;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class BewerbungAdminController extends Controller
|
||||
{
|
||||
// Übersicht aller Runden
|
||||
public function index(Request $request)
|
||||
{
|
||||
$bewerbungen = Bewerbung::query()
|
||||
->withCount('applications')
|
||||
->orderByDesc('start_at')
|
||||
->orderBy('name')
|
||||
->paginate(20);
|
||||
|
||||
return view('admin.bewerbungen.index', compact('bewerbungen'));
|
||||
}
|
||||
|
||||
// Detailseite einer Runde mit Bewerbungs-Tabelle
|
||||
public function show(Bewerbung $bewerbung)
|
||||
{
|
||||
$applications = $bewerbung->applications()
|
||||
->with('band')
|
||||
->latest()
|
||||
->paginate(25);
|
||||
|
||||
return view('admin.bewerbungen.show', compact('bewerbung','applications'));
|
||||
}
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Band;
|
||||
use App\Models\Bewerbung;
|
||||
use App\Models\BandApplication;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class BandApplicationController extends Controller
|
||||
{
|
||||
/**
|
||||
* Speichert eine Bewerbung (Band-Stammdaten + Bewerbung zur Runde).
|
||||
* Route: POST /bewerbung/{bewerbung:slug}/apply (name: band.apply)
|
||||
*/
|
||||
public function store(Request $request, Bewerbung $bewerbung)
|
||||
{
|
||||
// Validierung
|
||||
$data = $request->validate([
|
||||
// Band-Stammdaten
|
||||
'band.name' => ['required','string','max:255'],
|
||||
'band.email' => ['required','email','max:255'],
|
||||
'band.phone' => ['nullable','string','max:100'],
|
||||
'band.city' => ['nullable','string','max:255'],
|
||||
'band.website' => ['nullable','url','max:255'],
|
||||
'band.spotify' => ['nullable','url','max:255'],
|
||||
'band.instagram' => ['nullable','url','max:255'],
|
||||
'band.youtube' => ['nullable','url','max:255'],
|
||||
'band.about' => ['nullable','string','max:5000'],
|
||||
|
||||
// Dateien optional
|
||||
'band.tech_rider' => ['nullable','file','mimes:pdf','max:8192'],
|
||||
'band.stage_plan' => ['nullable','file','mimes:pdf','max:8192'],
|
||||
|
||||
// Bewerbung
|
||||
'message' => ['nullable','string','max:5000'],
|
||||
'demo_link' => ['nullable','url','max:255'],
|
||||
'privacy_ok' => ['accepted'], // muss angehakt sein
|
||||
]);
|
||||
|
||||
$application = DB::transaction(function() use ($data, $request, $bewerbung) {
|
||||
|
||||
// 1) Band per E-Mail finden/neu anlegen
|
||||
$band = Band::firstOrNew(['email' => $data['band']['email']]);
|
||||
$band->fill([
|
||||
'name' => $data['band']['name'],
|
||||
'phone' => $data['band']['phone'] ?? null,
|
||||
'city' => $data['band']['city'] ?? null,
|
||||
'website' => $data['band']['website'] ?? null,
|
||||
'spotify' => $data['band']['spotify'] ?? null,
|
||||
'instagram' => $data['band']['instagram'] ?? null,
|
||||
'youtube' => $data['band']['youtube'] ?? null,
|
||||
'about' => $data['band']['about'] ?? null,
|
||||
]);
|
||||
|
||||
if ($request->hasFile('band.tech_rider')) {
|
||||
$band->tech_rider_path = $request->file('band.tech_rider')->store('bands/tech', 'public');
|
||||
}
|
||||
if ($request->hasFile('band.stage_plan')) {
|
||||
$band->stage_plan_path = $request->file('band.stage_plan')->store('bands/stage', 'public');
|
||||
}
|
||||
$band->save();
|
||||
|
||||
// 2) Bewerbungs-Duplikate verhindern
|
||||
$existing = BandApplication::where('band_id', $band->id)
|
||||
->where('bewerbung_id', $bewerbung->id)
|
||||
->first();
|
||||
|
||||
if ($existing) {
|
||||
// Optional: Nachricht/Demolink aktualisieren
|
||||
$existing->update([
|
||||
'message' => $data['message'] ?? $existing->message,
|
||||
'demo_link' => $data['demo_link'] ?? $existing->demo_link,
|
||||
]);
|
||||
return $existing;
|
||||
}
|
||||
|
||||
// 3) Bewerbung anlegen
|
||||
return BandApplication::create([
|
||||
'band_id' => $band->id,
|
||||
'bewerbung_id' => $bewerbung->id,
|
||||
'status' => 'submitted',
|
||||
'message' => $data['message'] ?? null,
|
||||
'demo_link' => $data['demo_link'] ?? null,
|
||||
'privacy_ok' => true,
|
||||
]);
|
||||
});
|
||||
|
||||
return redirect()
|
||||
->route('bewerbung.show', $bewerbung) // oder ['bewerbung' => $bewerbung->slug]
|
||||
->with('success', 'Danke! Eure Bewerbung ist eingegangen.');
|
||||
}
|
||||
}
|
||||
@@ -4,25 +4,105 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Bewerbung;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class BewerbungController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$bewerbungen = Bewerbung::query()
|
||||
->where('active', true)
|
||||
->orderByDesc('start_at')
|
||||
->get();
|
||||
|
||||
$bewerbungen = Bewerbung::latest()->paginate(15);
|
||||
return view('bewerbung.index', compact('bewerbungen'));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('bewerbung.create');
|
||||
}
|
||||
|
||||
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'],
|
||||
'time' => ['nullable'],
|
||||
'active' => ['nullable'],
|
||||
'start_at' => ['nullable','date'],
|
||||
'end_at' => ['nullable','date','after_or_equal:start_at'],
|
||||
]);
|
||||
|
||||
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');
|
||||
|
||||
$bewerbung = Bewerbung::create($data);
|
||||
|
||||
return redirect()->route('bewerbungen.show', $bewerbung)->with('success', 'Bewerbung erstellt.');
|
||||
}
|
||||
|
||||
public function show(Bewerbung $bewerbung)
|
||||
{
|
||||
if (!$bewerbung->active) abort(404);
|
||||
if ($bewerbung->start_at && $bewerbung->start_at->isFuture()) abort(404);
|
||||
if ($bewerbung->end_at && $bewerbung->end_at->isPast()) abort(404);
|
||||
|
||||
return view('bewerbung.show', compact('bewerbung'));
|
||||
}
|
||||
|
||||
public function edit(Bewerbung $bewerbung)
|
||||
{
|
||||
return view('bewerbung.edit', compact('bewerbung'));
|
||||
}
|
||||
|
||||
public function form(Bewerbung $bewerbung)
|
||||
{
|
||||
if (! $bewerbung->active) {
|
||||
return view('bewerbung.forminactive', compact('bewerbung'));
|
||||
}
|
||||
|
||||
return view('bewerbung.form', compact('bewerbung'));
|
||||
}
|
||||
|
||||
public function update(Request $request, Bewerbung $bewerbung)
|
||||
{
|
||||
$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'],
|
||||
'time' => ['nullable'],
|
||||
'active' => ['nullable'],
|
||||
'start_at' => ['nullable','date'],
|
||||
'end_at' => ['nullable','date','after_or_equal:start_at'],
|
||||
]);
|
||||
|
||||
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.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
class OrgaSessionController extends Controller
|
||||
{
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$credentials = $request->validate([
|
||||
'email' => ['required', 'email', 'max:255'],
|
||||
'password' => ['required', 'string'],
|
||||
]);
|
||||
|
||||
if (! Auth::attempt($credentials + ['is_admin' => true])) {
|
||||
throw ValidationException::withMessages(['email' => 'E-Mail-Adresse oder Passwort ist ungültig.']);
|
||||
}
|
||||
|
||||
$request->session()->regenerate();
|
||||
|
||||
return redirect()->intended(route('bewerbungen.index'));
|
||||
}
|
||||
|
||||
public function destroy(Request $request): RedirectResponse
|
||||
{
|
||||
Auth::logout();
|
||||
$request->session()->invalidate();
|
||||
$request->session()->regenerateToken();
|
||||
|
||||
return redirect()->route('login');
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Band extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'phone',
|
||||
'city',
|
||||
'website',
|
||||
'spotify',
|
||||
'instagram',
|
||||
'youtube',
|
||||
'about',
|
||||
'tech_rider_path',
|
||||
'stage_plan_path',
|
||||
];
|
||||
|
||||
public function applications()
|
||||
{
|
||||
return $this->hasMany(BandApplication::class);
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class BandApplication extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'band_id',
|
||||
'bewerbung_id',
|
||||
'status', // submitted, in_review, accepted, rejected
|
||||
'message',
|
||||
'demo_link',
|
||||
'privacy_ok',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'privacy_ok' => 'boolean',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function band()
|
||||
{
|
||||
return $this->belongsTo(Band::class);
|
||||
}
|
||||
|
||||
public function bewerbung()
|
||||
{
|
||||
return $this->belongsTo(Bewerbung::class);
|
||||
}
|
||||
}
|
||||
@@ -28,15 +28,4 @@ class Bewerbung extends Model
|
||||
'start_at' => 'datetime',
|
||||
'end_at' => 'datetime',
|
||||
];
|
||||
// app/Models/Bewerbung.php
|
||||
public function applications()
|
||||
{
|
||||
return $this->hasMany(\App\Models\BandApplication::class, 'bewerbung_id');
|
||||
}
|
||||
|
||||
public function getRouteKeyName()
|
||||
{
|
||||
return 'slug';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ class User extends Authenticatable
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
'is_admin' => 'boolean',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
@@ -19,6 +21,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
Gate::define('manage-bewerbungen', fn (User $user): bool => $user->is_admin === true);
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,8 @@ return new class extends Migration
|
||||
$table->id();
|
||||
$table->string('name', 255);
|
||||
$table->text('text');
|
||||
$table->string('pic')->nullable(); // storage path
|
||||
$table->string('pdf')->nullable(); // storage path
|
||||
$table->string('pic_path')->nullable(); // storage path
|
||||
$table->string('bedingungen_path')->nullable(); // storage path
|
||||
$table->boolean('active')->default(false);
|
||||
$table->boolean('time')->default(false);
|
||||
$table->timestamp('start_at')->nullable();
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('bewerbungen', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('slug')->unique();
|
||||
$table->text('text')->nullable();
|
||||
$table->boolean('active')->default(false);
|
||||
$table->boolean('time')->default(false);
|
||||
$table->string('pdf_path')->nullable();
|
||||
$table->string('pic_path')->nullable();
|
||||
$table->string('bedingungen_path')->nullable();
|
||||
$table->timestamp('start_at')->nullable();
|
||||
$table->timestamp('end_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('bewerbungen');
|
||||
}
|
||||
};
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('bands', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->string('phone')->nullable();
|
||||
$table->string('city')->nullable();
|
||||
$table->string('website')->nullable();
|
||||
$table->string('spotify')->nullable();
|
||||
$table->string('instagram')->nullable();
|
||||
$table->string('youtube')->nullable();
|
||||
$table->text('about')->nullable();
|
||||
$table->string('tech_rider_path')->nullable();
|
||||
$table->string('stage_plan_path')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('bands');
|
||||
}
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('band_applications', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('band_id')->constrained('bands')->cascadeOnDelete();
|
||||
$table->foreignId('bewerbung_id')->constrained('bewerbungen')->cascadeOnDelete();
|
||||
$table->string('status')->default('submitted');
|
||||
$table->text('message')->nullable();
|
||||
$table->string('demo_link')->nullable();
|
||||
$table->boolean('privacy_ok')->default(false);
|
||||
$table->timestamps();
|
||||
$table->unique(['band_id','bewerbung_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('band_applications');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('bewerbungen', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('bewerbungen', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->boolean('is_admin')->default(false);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('is_admin');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -1,83 +0,0 @@
|
||||
/*! admin-live-filters.js — Vue 3 (CDN) */
|
||||
(function() {
|
||||
// Debounce helper
|
||||
function debounce(fn, delay) {
|
||||
let t; return function(...args) {
|
||||
clearTimeout(t); t = setTimeout(() => fn.apply(this, args), delay);
|
||||
};
|
||||
}
|
||||
|
||||
// Mount for rounds list (index)
|
||||
const elIndex = document.getElementById('admin-bewerbungen-index');
|
||||
if (elIndex) {
|
||||
const dataEl = document.getElementById('admin-bewerbungen-index-data');
|
||||
const raw = dataEl ? JSON.parse(dataEl.textContent) : { items: [] };
|
||||
const { createApp, computed, ref, watch } = Vue;
|
||||
|
||||
createApp({
|
||||
setup() {
|
||||
const q = ref('');
|
||||
const activeOnly = ref(false);
|
||||
const items = ref(raw.items || []);
|
||||
|
||||
const filtered = computed(() => {
|
||||
const needle = q.value.trim().toLowerCase();
|
||||
return items.value.filter(it => {
|
||||
const text = ((it.name || '') + ' ' + (it.period || '')).toLowerCase();
|
||||
const okText = !needle || text.includes(needle);
|
||||
const okActive = !activeOnly.value || !!it.active;
|
||||
return okText && okActive;
|
||||
});
|
||||
});
|
||||
|
||||
const clear = () => { q.value = ''; activeOnly.value = false; };
|
||||
|
||||
return { q, activeOnly, items, filtered, clear };
|
||||
}
|
||||
}).mount('#admin-bewerbungen-index');
|
||||
}
|
||||
|
||||
// Mount for applications table (show)
|
||||
const elShow = document.getElementById('admin-bewerbungen-show');
|
||||
if (elShow) {
|
||||
const dataEl = document.getElementById('admin-bewerbungen-show-data');
|
||||
const raw = dataEl ? JSON.parse(dataEl.textContent) : { items: [] };
|
||||
const { createApp, computed, ref } = Vue;
|
||||
|
||||
createApp({
|
||||
setup() {
|
||||
const q = ref('');
|
||||
const status = ref('');
|
||||
const dateFrom = ref('');
|
||||
const dateTo = ref('');
|
||||
const items = ref(raw.items || []);
|
||||
|
||||
const filtered = computed(() => {
|
||||
const needle = q.value.trim().toLowerCase();
|
||||
const from = dateFrom.value ? new Date(dateFrom.value + 'T00:00:00') : null;
|
||||
const to = dateTo.value ? new Date(dateTo.value + 'T23:59:59') : null;
|
||||
|
||||
return items.value.filter(it => {
|
||||
// text match
|
||||
const text = ((it.band || '') + ' ' + (it.email || '')).toLowerCase();
|
||||
const okText = !needle || text.includes(needle);
|
||||
|
||||
// status match
|
||||
const okStatus = !status.value || it.status === status.value;
|
||||
|
||||
// date range match (created_at ISO string expected)
|
||||
const t = it.created_at ? new Date(it.created_at) : null;
|
||||
const okFrom = !from || (t && t >= from);
|
||||
const okTo = !to || (t && t <= to);
|
||||
|
||||
return okText && okStatus && okFrom && okTo;
|
||||
});
|
||||
});
|
||||
|
||||
const reset = () => { q.value = ''; status.value=''; dateFrom.value=''; dateTo.value=''; };
|
||||
|
||||
return { q, status, dateFrom, dateTo, items, filtered, reset };
|
||||
}
|
||||
}).mount('#admin-bewerbungen-show');
|
||||
}
|
||||
})();
|
||||
@@ -1,82 +0,0 @@
|
||||
@extends('template')
|
||||
@section('title','Admin · Bewerbung #'.$application->id)
|
||||
@section('content')
|
||||
@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="h4 mb-0">Bewerbung #{{ $application->id }}</h1>
|
||||
<a class="btn btn-outline-secondary btn-sm" href="{{ route('admin.bewerbungen.show', $application->bewerbung) }}">Zurück zur Runde</a>
|
||||
</div>
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-lg-7">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Band</h5>
|
||||
<div class="mb-2"><strong>Name:</strong> {{ optional($application->band)->name }}</div>
|
||||
<div class="mb-2"><strong>E-Mail:</strong> {{ optional($application->band)->email }}</div>
|
||||
@if(optional($application->band)->phone)
|
||||
<div class="mb-2"><strong>Telefon:</strong> {{ $application->band->phone }}</div>
|
||||
@endif
|
||||
<div class="mb-2 d-flex flex-wrap gap-2">
|
||||
@if(optional($application->band)->website)<a href="{{ $application->band->website }}" target="_blank" class="btn btn-sm btn-outline-secondary">Website</a>@endif
|
||||
@if(optional($application->band)->spotify)<a href="{{ $application->band->spotify }}" target="_blank" class="btn btn-sm btn-outline-secondary">Spotify</a>@endif
|
||||
@if(optional($application->band)->instagram)<a href="{{ $application->band->instagram }}" target="_blank" class="btn btn-sm btn-outline-secondary">Instagram</a>@endif
|
||||
@if(optional($application->band)->youtube)<a href="{{ $application->band->youtube }}" target="_blank" class="btn btn-sm btn-outline-secondary">YouTube</a>@endif
|
||||
@if(optional($application->band)->tech_rider_path)<a href="{{ Storage::disk('public')->url($application->band->tech_rider_path) }}" target="_blank" class="btn btn-sm btn-outline-secondary">Tech Rider</a>@endif
|
||||
@if(optional($application->band)->stage_plan_path)<a href="{{ Storage::disk('public')->url($application->band->stage_plan_path) }}" target="_blank" class="btn btn-sm btn-outline-secondary">Stage Plan</a>@endif
|
||||
</div>
|
||||
@if(optional($application->band)->about)
|
||||
<div class="mt-3">
|
||||
<strong>Über die Band</strong>
|
||||
<p class="mb-0">{{ $application->band->about }}</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Bewerbung</h5>
|
||||
<div class="mb-2"><strong>Runde:</strong> {{ $application->bewerbung->name }}</div>
|
||||
<div class="mb-2"><strong>Eingang:</strong> {{ $application->created_at->format('d.m.Y H:i') }}</div>
|
||||
<div class="mb-2"><strong>Status:</strong> @include('components.status-badge', ['status' => $application->status])</div>
|
||||
|
||||
<form class="mt-2 d-flex gap-2" method="POST" action="{{ route('admin.applications.status', $application) }}">
|
||||
@csrf
|
||||
@method('PATCH')
|
||||
<select name="status" class="form-select form-select-sm" style="max-width: 240px;">
|
||||
@foreach(['submitted' => 'Eingereicht','in_review' => 'In Prüfung','accepted' => 'Zugesagt','rejected' => 'Abgesagt'] as $val => $label)
|
||||
<option value="{{ $val }}" @selected(old('status', $application->status) === $val)>{{ $label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<button class="btn btn-sm btn-primary">Speichern</button>
|
||||
</form>
|
||||
|
||||
@if($errors->any())
|
||||
<div class="alert alert-danger mt-3">
|
||||
<ul class="mb-0">
|
||||
@foreach($errors->all() as $e)
|
||||
<li>{{ $e }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Nachricht</h5>
|
||||
<p class="mb-0" style="white-space: pre-wrap;">{{ $application->message }}</p>
|
||||
@if($application->demo_link)
|
||||
<p class="mt-2"><strong>Demo:</strong> <a href="{{ $application->demo_link }}" target="_blank">{{ $application->demo_link }}</a></p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -1,87 +0,0 @@
|
||||
@extends('template')
|
||||
@section('title','Admin · Bewerbungsrunden')
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h1 class="h4 mb-0">Bewerbungsrunden</h1>
|
||||
</div>
|
||||
|
||||
{{-- Live-Filter UI (Vue) --}}
|
||||
<div id="admin-bewerbungen-index" class="card mb-3">
|
||||
<div class="card-body">
|
||||
<div class="row g-2 align-items-center">
|
||||
<div class="col-md-6">
|
||||
<input type="search" class="form-control" placeholder="Suchen (Name/Zeitraum)..." v-model="q">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="activeOnly" v-model="activeOnly">
|
||||
<label class="form-check-label" for="activeOnly">Nur aktive anzeigen</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 text-md-end">
|
||||
<button class="btn btn-sm btn-outline-secondary" @click="clear">Zurücksetzen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Zeitraum</th>
|
||||
<th>Aktiv</th>
|
||||
<th class="text-end">Bewerbungen</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-if="filtered.length">
|
||||
<tr v-for="b in filtered" :key="b.id">
|
||||
<td class="fw-semibold">@{{ b.name }}</td>
|
||||
<td>@{{ b.period }}</td>
|
||||
<td>
|
||||
<span class="badge" :class="b.active ? 'text-bg-success' : 'text-bg-secondary'">
|
||||
@{{ b.active ? 'aktiv' : 'inaktiv' }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-end">@{{ b.applications_count }}</td>
|
||||
<td class="text-end">
|
||||
<a class="btn btn-sm btn-outline-primary" :href="b.url">Öffnen</a>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
<tr v-else><td colspan="5" class="text-muted">Keine Treffer.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{-- Original Laravel-Pagination ist ausgeblendet, da die Liste clientseitig gefiltert wird. --}}
|
||||
{{-- {{ $bewerbungen->links() }} --}}
|
||||
|
||||
{{-- Serverdaten für Vue als JSON bereitstellen --}}
|
||||
<script type="application/json" id="admin-bewerbungen-index-data">
|
||||
@php
|
||||
echo json_encode([
|
||||
'items' => $bewerbungen->map(function($b){
|
||||
return [
|
||||
'id' => $b->id,
|
||||
'name' => $b->name,
|
||||
'period' => trim(($b->start_at ? $b->start_at->format('d.m.Y') : '') . ' – ' . ($b->end_at ? $b->end_at->format('d.m.Y') : '')),
|
||||
'active' => (bool)$b->active,
|
||||
'applications_count' => (int)($b->applications_count ?? 0),
|
||||
'url' => route('admin.bewerbungen.show', $b),
|
||||
];
|
||||
})->values(),
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
@endphp
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
{{-- Vue 3 CDN + App --}}
|
||||
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
|
||||
<script src="/js/admin-live-filters.js"></script>
|
||||
@endpush
|
||||
@@ -1,121 +0,0 @@
|
||||
@extends('template')
|
||||
@section('title','Admin · Runde: ' . $bewerbung->name)
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<div>
|
||||
<h1 class="h4 mb-0">Runde: {{ $bewerbung->name }}</h1>
|
||||
<small class="text-muted">
|
||||
@if($bewerbung->start_at) Start: {{ $bewerbung->start_at->format('d.m.Y') }} @endif
|
||||
@if($bewerbung->end_at) · Ende: {{ $bewerbung->end_at->format('d.m.Y') }} @endif
|
||||
· Status: @if($bewerbung->active)<span class="badge text-bg-success">aktiv</span>@else<span class="badge text-bg-secondary">inaktiv</span>@endif
|
||||
</small>
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<a class="btn btn-outline-secondary btn-sm" href="{{ route('admin.bewerbungen.index') }}">Zurück</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Live-Filter UI --}}
|
||||
<div id="admin-bewerbungen-show" class="card mb-3">
|
||||
<div class="card-body">
|
||||
<div class="row g-2">
|
||||
<div class="col-lg-4">
|
||||
<input type="search" class="form-control" placeholder="Suchen (Band/E-Mail)..." v-model="q">
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<select class="form-select" v-model="status">
|
||||
<option value="">Alle Status</option>
|
||||
<option value="submitted">Eingereicht</option>
|
||||
<option value="in_review">In Prüfung</option>
|
||||
<option value="accepted">Zugesagt</option>
|
||||
<option value="rejected">Abgesagt</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<input type="date" class="form-control" v-model="dateFrom" placeholder="von">
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<input type="date" class="form-control" v-model="dateTo" placeholder="bis">
|
||||
</div>
|
||||
<div class="col-lg-1 text-lg-end">
|
||||
<button class="btn btn-outline-secondary w-100" @click="reset">Reset</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Band</th>
|
||||
<th>E-Mail</th>
|
||||
<th>Status</th>
|
||||
<th>Datum</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-if="filtered.length">
|
||||
<tr v-for="app in filtered" :key="app.id">
|
||||
<td>@{{ app.id }}</td>
|
||||
<td>@{{ app.band }}</td>
|
||||
<td>@{{ app.email }}</td>
|
||||
<td>
|
||||
<span class="badge"
|
||||
:class="{
|
||||
'text-bg-secondary': app.status==='submitted',
|
||||
'text-bg-warning': app.status==='in_review',
|
||||
'text-bg-success': app.status==='accepted',
|
||||
'text-bg-danger': app.status==='rejected'
|
||||
}">
|
||||
@{{ app.status_label }}
|
||||
</span>
|
||||
</td>
|
||||
<td>@{{ app.created_label }}</td>
|
||||
<td class="text-end">
|
||||
<a class="btn btn-sm btn-outline-primary" :href="app.url">Öffnen</a>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
<tr v-else><td colspan="6" class="text-muted">Keine Treffer.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{-- Serverseitige Pagination ausgeblendet, da wir clientseitig filtern. --}}
|
||||
{{-- {{ $applications->links() }} --}}
|
||||
|
||||
{{-- Serverdaten als JSON --}}
|
||||
<script type="application/json" id="admin-bewerbungen-show-data">
|
||||
@php
|
||||
echo json_encode([
|
||||
'items' => $applications->map(function($app){
|
||||
return [
|
||||
'id' => $app->id,
|
||||
'band' => optional($app->band)->name,
|
||||
'email' => optional($app->band)->email,
|
||||
'status' => $app->status,
|
||||
'status_label' => match($app->status) {
|
||||
'submitted' => 'Eingereicht',
|
||||
'in_review' => 'In Prüfung',
|
||||
'accepted' => 'Zugesagt',
|
||||
'rejected' => 'Abgesagt',
|
||||
default => $app->status,
|
||||
},
|
||||
'created_at' => optional($app->created_at)?->toIso8601String(),
|
||||
'created_label' => optional($app->created_at)?->format('d.m.Y H:i'),
|
||||
'url' => route('admin.applications.show', $app),
|
||||
];
|
||||
})->values(),
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
@endphp
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
|
||||
<script src="/js/admin-live-filters.js"></script>
|
||||
@endpush
|
||||
@@ -0,0 +1,28 @@
|
||||
@extends('template')
|
||||
|
||||
@section('title', 'Orga-Login')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-6 mx-auto p-4">
|
||||
<h1 class="h3 mb-3">Orga-Login</h1>
|
||||
|
||||
<form method="POST" action="{{ route('login.store') }}">
|
||||
@csrf
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">E-Mail-Adresse</label>
|
||||
<input id="email" name="email" type="email" class="form-control" value="{{ old('email') }}" autocomplete="username" required autofocus>
|
||||
@error('email')
|
||||
<p class="text-danger mt-2" role="alert">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Passwort</label>
|
||||
<input id="password" name="password" type="password" class="form-control" autocomplete="current-password" required>
|
||||
@error('password')
|
||||
<p class="text-danger mt-2" role="alert">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Anmelden</button>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -14,7 +14,26 @@
|
||||
<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">
|
||||
@@ -29,28 +48,9 @@
|
||||
@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">
|
||||
@@ -61,7 +61,7 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="mt-3 mb-3">
|
||||
<div class="mt-3">
|
||||
<a href="{{ route('bewerbungen.index') }}" class="btn btn-outline-secondary">Abbrechen</a>
|
||||
<button class="btn btn-primary">Speichern</button>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
@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 }} Form</h1>
|
||||
@can('manage-bewerbungen')
|
||||
<div>
|
||||
<a href="{{ route('bewerbungen.edit', $bewerbung->id) }}" class="btn btn-sm btn-primary">Bearbeiten</a>
|
||||
<a href="{{ route('bewerbungen.index') }}" class="btn btn-sm btn-outline-secondary">Zur Liste</a>
|
||||
</div>
|
||||
@endcan
|
||||
</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>
|
||||
|
||||
@if($bewerbung->pic_path)
|
||||
<p><strong>Bild:</strong> <br>
|
||||
<img src="{{ Storage::url($bewerbung->pic_path) }}" alt="" style="max-height:180px"></p>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
//Ab Hier Bewerbungsformular
|
||||
|
||||
<div class="col-md-3"> </div><div id="head" class="col-md-6"> </div>
|
||||
<div class="col-md-12"><div class="col-md-3"> </div><div class="col-md-4 col-lg-4">
|
||||
<p>{{ $bewerbung->text }}</p>
|
||||
|
||||
@if($bewerbung->bedingungen_path)
|
||||
<p><strong>Bewerbungsbedingungen:</strong> <a href="{{ Storage::url($bewerbung->bedingungen_path) }}" target="_blank">Bewerbungsbedingungen</a></p>
|
||||
@endif
|
||||
<form method="POST" action="">
|
||||
<label for="bname">Bandname*</label>
|
||||
<input type="text" name="bname" id="bname" class="text form-control mb-3" placeholder="Bandname" value="" required>
|
||||
<label for="musik">Musikrichtung</label>
|
||||
<input type="text" name="musik" id="musik" class="text form-control mb-3" list="musik" placeholder="Rock" value="">
|
||||
<datalist id="musik">
|
||||
<option value="Rock">
|
||||
<option value="Metal">
|
||||
<option value="Blues">
|
||||
<option value="Rock´n´Roll">
|
||||
<option value="Alternative Rock">
|
||||
<option value="Hard Rock">
|
||||
<option value="Heavy Metal">
|
||||
<option value="Black Metal">
|
||||
<option value="Bluesrock">
|
||||
<option value="Classic Rock">
|
||||
<option value="Country">
|
||||
<option value="Deutschrock">
|
||||
<option value="Funk">
|
||||
<option value="Garage Rock">
|
||||
<option value="Glam Rock">
|
||||
<option value="Grunge">
|
||||
<option value="Glam Metal">
|
||||
<option value="Indie">
|
||||
<option value="Indie Rock">
|
||||
<option value="Punk">
|
||||
<option value="Punk Rock">
|
||||
<option value="Mittelalter Rock">
|
||||
<option value="Post Grunge">
|
||||
<option value="Raggae">
|
||||
<option value="Ska">
|
||||
<option value="Jazz">
|
||||
<option value="Soul">
|
||||
<option value="Death Metal">
|
||||
<option value="Grindcore">
|
||||
<option value="Matalcore">
|
||||
<option value="Trashmetal">
|
||||
<option value="Neue Deutsche Härte">
|
||||
</datalist>
|
||||
<label for="ansprechpartner">Ansprechpartner*</label>
|
||||
<input type="text" name="ansprechpartner" id="ansprechpartner" class="text form-control mb-3" placeholder="Max Mustermann" value="" required>
|
||||
<label for="email">E-Mail*</label>
|
||||
<input type="email" name="mail" id="email" class="text form-control mb-3" placeholder="mustermann@mail.de" value="" required>
|
||||
<label for="tel">Telefonnummer</label>
|
||||
<input type="tel" name="tel" id="tel" class="text form-control mb-3" placeholder="123456789" value="">
|
||||
<label for="textf">Beschreibung der Band</label>
|
||||
<textarea name="text" id="textf" class="form-control mb-3" placeholder="Text ...."></textarea>
|
||||
<label for="www">Internetseite</label>
|
||||
<input type="url" inputmode="url" name="www" id="www" class="text form-control mb-3" placeholder="http://www.meine-homepage.de" value="">
|
||||
<label for="fb">Facebook</label>
|
||||
<input type="url" inputmode="url" name="fb" id="fb" class="text form-control mb-3" placeholder="https://www.facebook.com/MukkeSchaumburg/" value="">
|
||||
<label for="yt">Youtube</label>
|
||||
<input type="url" inputmode="url" name="yt" id="yt" class="text form-control mb-3" placeholder="https://www.youtube.com/channel/UC-Ax6znXrptgwCQRlY0soUw" value="">
|
||||
<label for="in">Instagram</label>
|
||||
<input type="url" inputmode="url" name="in" id="in" class="text form-control mb-3" placeholder="https://www.instagram.com/mukke_shg/" value="">
|
||||
<label for="bsp">Link zum Hörbeispiel*</label>
|
||||
<input type="text" inputmode="url" name="bsp" id="bsp" class="text form-control mb-3" placeholder="https://www.hörbeispiel.de" value="">
|
||||
<label for="heimat">Heimatort der Band</label>
|
||||
<input type="text" name="heimat" id="heimat" class="text form-control mb-3" placeholder="Stadthagen" value="">
|
||||
<br><br>
|
||||
<div class="form-check form-switch mb-3">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="daten" name="daten">
|
||||
<label class="form-check-label" for="daten"> *Hiermit bestätige ich die Korrektheit der Daten.</label>
|
||||
</div>
|
||||
<div class="form-check form-switch mb-3">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="mailinfonext" name="mailinfonext">
|
||||
<label class="form-check-label" for="mailinfonext">Ich möchte über erneute Bewerbungsmöglichkeiten per E-Mail informiert werden.</label>
|
||||
</div>
|
||||
<div class="form-check form-switch mb-3">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="datensch" name="datensch">
|
||||
<label class="form-check-label" for="datensch"> *Ich stimme der <a href="https://www.live-rock-schaumburg.de/datenschutzerklaerung/" target="_blank">Datenschutzerklärung</a> zu.</label>
|
||||
</div>
|
||||
<input type="submit" name="submit" value="Bewerbung abschicken" class="submit btn btn-primary">
|
||||
</form>
|
||||
<h2 class="red">Info:</h2>
|
||||
<p>Die mit * markierten Felder sind Pflichtangaben!</p>
|
||||
<p>Die eingetragenen Daten werden zur Auswertung und (mit Einwilligung) zur erneuten Kontaktaufnahme gespeichert.<!-- Wenn sie die Löschung ihrer daten wünschen klicken sie hier.--></p>
|
||||
</div><div class="col-md-3"> </div></div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,41 @@
|
||||
@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 }} Form</h1>
|
||||
@can('manage-bewerbungen')
|
||||
<div>
|
||||
<a href="{{ route('bewerbungen.edit', $bewerbung->id) }}" class="btn btn-sm btn-primary">Bearbeiten</a>
|
||||
<a href="{{ route('bewerbungen.index') }}" class="btn btn-sm btn-outline-secondary">Zur Liste</a>
|
||||
</div>
|
||||
@endcan
|
||||
</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>
|
||||
|
||||
@if($bewerbung->pic_path)
|
||||
<p><strong>Bild:</strong> <br>
|
||||
<img src="{{ Storage::url($bewerbung->pic_path) }}" alt="" style="max-height:180px"></p>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
//Ab Hier Bewerbungsformular inaktiv
|
||||
|
||||
<div class="col-md-3"> </div><div id="head" class="col-md-6"> </div>
|
||||
<div class="col-md-12"><div class="col-md-3"> </div><div class="col-md-4 col-lg-4">
|
||||
<p>Diese Bewerbung ist Inaktiv</p>
|
||||
|
||||
</div><div class="col-md-3"> </div></div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -1,25 +1,66 @@
|
||||
@extends('template')
|
||||
|
||||
@section('title', 'Bewerbungen')
|
||||
|
||||
@section('content')
|
||||
<h1 class="h3 mb-3">Aktive Bewerbungen</h1>
|
||||
|
||||
@if($bewerbungen->isEmpty())
|
||||
<div class="alert alert-info">Derzeit sind keine aktiven Bewerbungen sichtbar.</div>
|
||||
@else
|
||||
<div class="list-group">
|
||||
@foreach($bewerbungen as $b)
|
||||
<a class="list-group-item list-group-item-action" href="{{ route('bewerbung.show', $b) }}">
|
||||
<strong>{{ $b->name }}</strong>
|
||||
@if($b->start_at || $b->end_at)
|
||||
<small class="text-muted d-block">
|
||||
@if($b->start_at) Start: {{ $b->start_at->format('d.m.Y') }} @endif
|
||||
@if($b->end_at) – Ende: {{ $b->end_at->format('d.m.Y') }} @endif
|
||||
</small>
|
||||
@endif
|
||||
<small class="d-block">{{ Str::limit($b->text, 160) }}</small>
|
||||
</a>
|
||||
@endforeach
|
||||
<div class="container mt-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h1 class="h3">Bewerbungen</h1>
|
||||
<div class="d-flex gap-2">
|
||||
<a href="{{ route('bewerbungen.create') }}" class="btn btn-primary">Neu</a>
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-outline-secondary">Abmelden</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@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.form', $b) }}" class="btn btn-sm btn-outline-secondary">Form</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
|
||||
@@ -1,118 +1,44 @@
|
||||
@extends('template')
|
||||
@section('title', $bewerbung->name)
|
||||
|
||||
@section('title', 'Bewerbung anzeigen')
|
||||
@section('content')
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success">{{ session('success') }}</div>
|
||||
@endif
|
||||
<div class="container mt-4">
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success">{{ session('success') }}</div>
|
||||
@endif
|
||||
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-7">
|
||||
<h1 class="h3 mb-2">{{ $bewerbung->name }}</h1>
|
||||
|
||||
@if($bewerbung->pic_path ?? false)
|
||||
<img class="img-fluid rounded mb-3" src="{{ Storage::disk('public')->url($bewerbung->pic_path) }}" alt="{{ $bewerbung->name }}">
|
||||
@endif
|
||||
|
||||
<div class="mb-3" style="white-space: pre-wrap;">{{ $bewerbung->text }}</div>
|
||||
|
||||
@if($bewerbung->bedingungen_path ?? false)
|
||||
<p class="mb-4">
|
||||
<a href="{{ Storage::disk('public')->url($bewerbung->bedingungen_path) }}" target="_blank" class="btn btn-outline-secondary btn-sm">
|
||||
Bewerbungsbedingungen (PDF)
|
||||
</a>
|
||||
</p>
|
||||
@endif
|
||||
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<strong>Bitte prüfen:</strong>
|
||||
<ul class="mb-0">
|
||||
@foreach ($errors->all() as $e)
|
||||
<li>{{ $e }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('band.apply', $bewerbung) }}" enctype="multipart/form-data" class="mt-3">
|
||||
@csrf
|
||||
<h2 class="h5 mt-2 mb-3">Band</h2>
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Bandname*</label>
|
||||
<input type="text" name="band[name]" class="form-control" value="{{ old('band.name') }}" required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">E-Mail*</label>
|
||||
<input type="email" name="band[email]" class="form-control" value="{{ old('band.email') }}" required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Telefon</label>
|
||||
<input type="text" name="band[phone]" class="form-control" value="{{ old('band.phone') }}">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Stadt</label>
|
||||
<input type="text" name="band[city]" class="form-control" value="{{ old('band.city') }}">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Website</label>
|
||||
<input type="url" name="band[website]" class="form-control" value="{{ old('band.website') }}">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Spotify</label>
|
||||
<input type="url" name="band[spotify]" class="form-control" value="{{ old('band.spotify') }}">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Instagram</label>
|
||||
<input type="url" name="band[instagram]" class="form-control" value="{{ old('band.instagram') }}">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">YouTube</label>
|
||||
<input type="url" name="band[youtube]" class="form-control" value="{{ old('band.youtube') }}">
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label">Über die Band</label>
|
||||
<textarea name="band[about]" class="form-control" rows="4">{{ old('band.about') }}</textarea>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Tech Rider (PDF)</label>
|
||||
<input type="file" name="band[tech_rider]" class="form-control" accept="application/pdf">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Stage Plan (PDF)</label>
|
||||
<input type="file" name="band[stage_plan]" class="form-control" accept="application/pdf">
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="h5 mt-4 mb-3">Bewerbung</h2>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Nachricht / Motivation</label>
|
||||
<textarea name="message" class="form-control" rows="4">{{ old('message') }}</textarea>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Demo-Link</label>
|
||||
<input type="url" name="demo_link" class="form-control" value="{{ old('demo_link') }}">
|
||||
</div>
|
||||
<div class="form-check form-switch mb-4">
|
||||
<input class="form-check-input" type="checkbox" id="privacy_ok" name="privacy_ok" {{ old('privacy_ok', true) ? 'checked' : '' }} required>
|
||||
<label class="form-check-label" for="privacy_ok">
|
||||
Ich stimme der Verarbeitung meiner Daten gemäß Datenschutzhinweis zu.
|
||||
</label>
|
||||
</div>
|
||||
<button class="btn btn-primary">Jetzt bewerben</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title mb-3">Eckdaten</h5>
|
||||
<ul class="list-unstyled mb-0">
|
||||
@if($bewerbung->start_at)<li><strong>Start:</strong> {{ $bewerbung->start_at->format('d.m.Y') }}</li>@endif
|
||||
@if($bewerbung->end_at)<li><strong>Ende:</strong> {{ $bewerbung->end_at->format('d.m.Y') }}</li>@endif
|
||||
<li><strong>Status:</strong> {{ $bewerbung->active ? 'Aktiv' : 'Inaktiv' }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<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->id) }}" 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
|
||||
@@ -1,10 +0,0 @@
|
||||
@php
|
||||
$map = [
|
||||
'submitted' => ['label' => 'Eingereicht', 'class' => 'text-bg-secondary'],
|
||||
'in_review' => ['label' => 'In Prüfung', 'class' => 'text-bg-warning'],
|
||||
'accepted' => ['label' => 'Zugesagt', 'class' => 'text-bg-success'],
|
||||
'rejected' => ['label' => 'Abgesagt', 'class' => 'text-bg-danger'],
|
||||
];
|
||||
$cfg = $map[$status] ?? ['label' => $status, 'class' => 'text-bg-light'];
|
||||
@endphp
|
||||
<span class="badge {{ $cfg['class'] }}">{{ $cfg['label'] }}</span>
|
||||
@@ -44,7 +44,7 @@
|
||||
<p class="lead">Hier findet ihr in Zukunft Infos zu Veranstaltungen, für die wir nach Bands Suchen. Zusätzlich soll in Zukunft auch die Möglichkeit entstehen eure Bands hier zu Presentieren.</p>
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-start mb-4 mb-lg-3">
|
||||
<button type="button" class="btn btn-primary btn-lg px-4 me-md-2 fw-bold" data-bs-toggle="modal" data-bs-target="#signupModal">Registrieren</button>
|
||||
<button type="button" class="btn btn-outline-secondary btn-lg px-4" data-bs-toggle="modal" data-bs-target="#loginModal">Zum Login</button>
|
||||
<a class="btn btn-outline-secondary btn-lg px-4" href="{{ route('bewerbungen.index') }}">Zur Orga-Verwaltung</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 offset-lg-1 p-0 overflow-hidden shadow-lg">
|
||||
@@ -76,34 +76,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="loginModal" tabindex="-1" aria-labelledby="loginModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="loginModalLabel">Login</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="Login" method="POST" action="./index.php">
|
||||
<div class="mb-3">
|
||||
<input type="text" name="user" class="form-control" placeholder="User" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<input type="password" name="pwd" class="form-control" placeholder="Password" required>
|
||||
</div>
|
||||
<div class="forgot">
|
||||
<a href="./resetpwd.php?u=reset">Passwort Vergessen?</a>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-primary">Login</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<footer class="mt-auto">
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use App\Http\Controllers\Admin\BewerbungAdminController;
|
||||
use App\Http\Controllers\Admin\BandApplicationAdminController;
|
||||
|
||||
Route::middleware(['web']) // ggf. ['web','auth']
|
||||
->prefix('admin/bewerbungen')
|
||||
->name('admin.bewerbungen.')
|
||||
->group(function () {
|
||||
Route::get('/', [BewerbungAdminController::class, 'index'])->name('index');
|
||||
Route::get('/{bewerbung:slug}', [BewerbungAdminController::class, 'show'])->name('show');
|
||||
});
|
||||
|
||||
Route::middleware(['web']) // ggf. ['web','auth']
|
||||
->prefix('admin/applications')
|
||||
->name('admin.applications.')
|
||||
->group(function () {
|
||||
Route::get('/{application}', [BandApplicationAdminController::class, 'show'])->name('show');
|
||||
Route::patch('/{application}/status', [BandApplicationAdminController::class, 'updateStatus'])->name('status');
|
||||
// Optional: CSV-Export aller Bewerbungen einer Runde:
|
||||
// Route::get('/export/{bewerbung:slug}', [BandApplicationAdminController::class, 'exportCsv'])->name('export');
|
||||
});
|
||||
@@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\BewerbungController;
|
||||
use App\Http\Controllers\BandApplicationController;
|
||||
|
||||
Route::get('/bewerbung', [BewerbungController::class, 'index'])->name('bewerbung.index');
|
||||
Route::get('/bewerbung/{bewerbung:slug}', [BewerbungController::class, 'show'])->name('bewerbung.show');
|
||||
Route::post('/bewerbung/{bewerbung:slug}/apply', [BandApplicationController::class, 'store'])->name('band.apply');
|
||||
+15
-6
@@ -4,9 +4,9 @@ use Illuminate\Support\Facades\Route;
|
||||
|
||||
use App\Http\Controllers\BandsController;
|
||||
use App\Http\Controllers\BewerbungController;
|
||||
use App\Http\Controllers\OrgaSessionController;
|
||||
|
||||
|
||||
require __DIR__ . '/admin_bewerbung.php';
|
||||
require __DIR__ . '/bewerbung_routes.php';
|
||||
|
||||
Route::get('/', function () {
|
||||
return view('wartung');
|
||||
@@ -18,7 +18,9 @@ Route::get('/', function () {
|
||||
Route::get('info', function() {
|
||||
return view('info');
|
||||
});
|
||||
//Route::get('bewerbung', function() { return view('bewerbung');});
|
||||
Route::get('bewerbung', function() {
|
||||
return view('bewerbung');
|
||||
});
|
||||
Route::get('start', function() {
|
||||
return view('start');
|
||||
});
|
||||
@@ -30,6 +32,13 @@ Route::get('kontakt', function() {
|
||||
|
||||
|
||||
|
||||
// Bewerbung CRUD
|
||||
//Route::resource('bewerbungen', BewerbungController::class)
|
||||
//->parameters(['bewerbungen' => 'bewerbung']); // ← erzwingt {bewerbung}
|
||||
Route::view('/login', 'auth.login')->name('login');
|
||||
Route::post('/login', [OrgaSessionController::class, 'store'])->middleware('throttle:5,1')->name('login.store');
|
||||
Route::post('/logout', [OrgaSessionController::class, 'destroy'])->middleware('auth')->name('logout');
|
||||
|
||||
Route::resource('bewerbungen', BewerbungController::class)
|
||||
->parameters(['bewerbungen' => 'bewerbung'])
|
||||
->middleware(['auth', 'can:manage-bewerbungen']);
|
||||
|
||||
Route::get('/bewerbungen/{bewerbung}/form', [BewerbungController::class, 'form'])
|
||||
->name('bewerbungen.form');
|
||||
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\Bewerbung;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class BewerbungAccessTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_guests_cannot_use_the_management_routes(): void
|
||||
{
|
||||
$this->withoutVite();
|
||||
$round = Bewerbung::create(['name' => 'Festival', 'text' => 'Band gesucht']);
|
||||
|
||||
foreach ([
|
||||
['GET', route('bewerbungen.index')],
|
||||
['GET', route('bewerbungen.create')],
|
||||
['POST', route('bewerbungen.store')],
|
||||
['GET', route('bewerbungen.show', $round)],
|
||||
['GET', route('bewerbungen.edit', $round)],
|
||||
['PUT', route('bewerbungen.update', $round)],
|
||||
['PATCH', route('bewerbungen.update', $round)],
|
||||
['DELETE', route('bewerbungen.destroy', $round)],
|
||||
] as [$method, $url]) {
|
||||
$this->call($method, $url)->assertRedirect('/login');
|
||||
}
|
||||
|
||||
$this->assertDatabaseCount('bewerbungen', 1);
|
||||
}
|
||||
|
||||
public function test_public_form_is_accessible_without_an_account(): void
|
||||
{
|
||||
$this->withoutVite();
|
||||
$round = Bewerbung::create(['name' => 'Festival', 'text' => 'Band gesucht', 'active' => true]);
|
||||
|
||||
$this->get(route('bewerbungen.form', $round))
|
||||
->assertOk()
|
||||
->assertSee('Band gesucht')
|
||||
->assertSee('name="bname"', false)
|
||||
->assertDontSee(route('bewerbungen.edit', $round));
|
||||
|
||||
$round->update(['active' => false]);
|
||||
$this->get(route('bewerbungen.form', $round))
|
||||
->assertOk()
|
||||
->assertSee('Diese Bewerbung ist Inaktiv')
|
||||
->assertDontSee('name="bname"', false);
|
||||
}
|
||||
|
||||
public function test_regular_users_cannot_log_in_to_or_access_management(): void
|
||||
{
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->from('/login')->post('/login', ['email' => $user->email, 'password' => 'password'])
|
||||
->assertRedirect('/login')
|
||||
->assertSessionHasErrors('email');
|
||||
$this->assertGuest();
|
||||
|
||||
$this->actingAs($user)->get(route('bewerbungen.create'))->assertForbidden();
|
||||
$this->post(route('bewerbungen.store'), ['name' => 'Festival', 'text' => 'Band gesucht'])->assertForbidden();
|
||||
$this->assertDatabaseCount('bewerbungen', 0);
|
||||
}
|
||||
|
||||
public function test_admin_can_log_in_manage_rounds_and_log_out(): void
|
||||
{
|
||||
$this->withoutVite();
|
||||
$admin = User::factory()->create(['is_admin' => true]);
|
||||
|
||||
$this->get(route('bewerbungen.create'))->assertRedirect('/login');
|
||||
$this->get('/login')->assertOk();
|
||||
$this->from('/login')->post('/login', ['email' => $admin->email, 'password' => 'wrong-password'])
|
||||
->assertRedirect('/login')
|
||||
->assertSessionHasErrors('email');
|
||||
$this->assertGuest();
|
||||
$this->post('/login', ['email' => $admin->email, 'password' => 'password'])
|
||||
->assertRedirect(route('bewerbungen.create'));
|
||||
$this->assertAuthenticatedAs($admin);
|
||||
$this->get(route('bewerbungen.create'))->assertOk();
|
||||
|
||||
$response = $this->post(route('bewerbungen.store'), ['name' => 'Festival', 'text' => 'Band gesucht']);
|
||||
$round = Bewerbung::sole();
|
||||
$response->assertRedirect(route('bewerbungen.show', $round));
|
||||
$this->patch(route('bewerbungen.update', $round), ['name' => 'Sommerfestival', 'text' => 'Band gesucht'])
|
||||
->assertRedirect(route('bewerbungen.show', $round));
|
||||
$this->assertDatabaseHas('bewerbungen', ['id' => $round->id, 'name' => 'Sommerfestival']);
|
||||
$this->delete(route('bewerbungen.destroy', $round))->assertRedirect(route('bewerbungen.index'));
|
||||
$this->assertDatabaseCount('bewerbungen', 0);
|
||||
|
||||
$this->post('/logout')->assertRedirect('/login');
|
||||
$this->assertGuest();
|
||||
$this->get(route('bewerbungen.create'))->assertRedirect('/login');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user