Neuigkeiten und Termine (vorgezogen)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m8s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m12s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m12s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m5s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m6s
CI / Build-Artefakte aktuell (pull_request) Failing after 43s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m8s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m12s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m12s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m5s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m6s
CI / Build-Artefakte aktuell (pull_request) Failing after 43s
- Neuigkeiten mit Kategorien, Titelbild (WebP-Varianten), Lesezeit, geplanter Veröffentlichung und Hervorhebung; Text wird beim Speichern bereinigt - Termine mit Ort, Online-Link, ganztägigen Terminen und .ics-Export - Startseite nach Intranet-Vorbild: Slider, Neuigkeiten, Termine, Aktuelles aus den Bereichen; mobil in sinnvoller Reihenfolge - Admin: Beiträge, Kategorien und Termine - Bildverarbeitung für Shared Hosting: nur eine Vollbild-Kopie im Speicher, Speicherlimit bei Bedarf auf 256 MB angehoben (wie WordPress) - Demo-Inhalte für die Entwicklung Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f813a0fff3
commit
a36752e09a
103 changed files with 2810 additions and 124 deletions
45
app/Http/Controllers/EventController.php
Normal file
45
app/Http/Controllers/EventController.php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Resources\EventResource;
|
||||
use App\Models\Event;
|
||||
use App\Support\Branding;
|
||||
use App\Support\Calendar;
|
||||
use Illuminate\Http\Response as HttpResponse;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
|
||||
class EventController extends Controller
|
||||
{
|
||||
public function index(): Response
|
||||
{
|
||||
return Inertia::render('Events/Index', [
|
||||
'events' => EventResource::collection(
|
||||
Event::query()->upcoming()->limit(200)->get()
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
public function show(Event $event): Response
|
||||
{
|
||||
abort_unless($event->is_published, 404);
|
||||
|
||||
return Inertia::render('Events/Show', [
|
||||
'event' => [
|
||||
...(new EventResource($event))->resolve(),
|
||||
'description_html' => $event->description_html,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function ics(Event $event, Calendar $calendar, Branding $branding): HttpResponse
|
||||
{
|
||||
abort_unless($event->is_published, 404);
|
||||
|
||||
return response($calendar->toIcs($event, $branding->portalName()), 200, [
|
||||
'Content-Type' => 'text/calendar; charset=utf-8',
|
||||
'Content-Disposition' => 'attachment; filename="termin-'.$event->id.'.ics"',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue