Phase 4: Seiten mit Pagebuilder, Redaktion und Freigaben
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m56s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m56s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m2s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m9s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m40s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m35s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 2m29s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m38s
CI / Build-Artefakte aktuell (pull_request) Successful in 55s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m56s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m56s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m2s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m9s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m40s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m35s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 2m29s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m38s
CI / Build-Artefakte aktuell (pull_request) Successful in 55s
- Seiten-Plugin: Seitenbaum mit Adressen, Seitennavigation, Brotkrumen und optional Hauptnavigation; Sichtbarkeit vererbt sich auf Unterseiten - Pagebuilder (Block-Registry im Kern, Plugins tragen Blöcke bei): Abschnitt, Spalten, Tabs, Akkordeon, Box, Überschrift, Text (TipTap), Zitat, Schaltflächen, Symbolliste, Tabelle, Trennlinie, Abstand, Bild, Galerie, Video (erst nach Klick), Titelbild, Ansprechpartner, Downloads, Unterseiten, Neuigkeiten, Termine; Sichtbarkeit je Block; Bereinigung beim Speichern - Editor im Portal: Ziehen und Ablegen, Autospeichern als Entwurf, Rückgängig, Gerätevorschau, Versionen, Zeitsteuerung, Bearbeitungssperre, Freigabe anfordern - Rechte „inkl. Unterseiten“ werden im Rechte-Cache aufgelöst - Neuigkeiten: Schreiben im Portal, Freigabe-Workflow mit Benachrichtigungen - Bereich „Redaktion“, Benachrichtigungen im Portal - storage/.migrations-fingerprint nicht mehr ausliefern Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6269d3302c
commit
f3987e8386
328 changed files with 10618 additions and 389 deletions
20
app/Http/Controllers/EditorialController.php
Normal file
20
app/Http/Controllers/EditorialController.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Editorial\Editorial;
|
||||
use Illuminate\Http\Request;
|
||||
use Inertia\Inertia;
|
||||
use Inertia\Response;
|
||||
|
||||
class EditorialController extends Controller
|
||||
{
|
||||
public function __invoke(Request $request, Editorial $editorial): Response
|
||||
{
|
||||
abort_unless($editorial->visibleFor($request->user()), 403);
|
||||
|
||||
return Inertia::render('Editorial/Index', [
|
||||
'sections' => $editorial->resolve($request->user()),
|
||||
]);
|
||||
}
|
||||
}
|
||||
50
app/Http/Controllers/NotificationController.php
Normal file
50
app/Http/Controllers/NotificationController.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Notifications\DatabaseNotification;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* Glocke im Portal-Header: Benachrichtigungen anzeigen und als gelesen markieren.
|
||||
*/
|
||||
class NotificationController extends Controller
|
||||
{
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$notifications = $request->user()->notifications()->limit(20)->get();
|
||||
|
||||
return response()->json([
|
||||
'notifications' => $notifications->map(fn (DatabaseNotification $n) => [
|
||||
'id' => $n->id,
|
||||
'title' => (string) ($n->data['title'] ?? ''),
|
||||
'body' => (string) ($n->data['body'] ?? ''),
|
||||
'icon' => (string) ($n->data['icon'] ?? 'bell'),
|
||||
'has_url' => filled($n->data['url'] ?? null),
|
||||
'read' => $n->read_at !== null,
|
||||
'created_at' => $n->created_at?->toIso8601String(),
|
||||
]),
|
||||
'unread' => $request->user()->unreadNotifications()->count(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function open(Request $request, string $id): RedirectResponse
|
||||
{
|
||||
$notification = $request->user()->notifications()->whereKey($id)->firstOrFail();
|
||||
$notification->markAsRead();
|
||||
$url = (string) ($notification->data['url'] ?? '');
|
||||
|
||||
// Nur Adressen innerhalb des Portals ansteuern.
|
||||
return redirect()->to($url !== '' && (Str::startsWith($url, '/') && ! Str::startsWith($url, '//') || Str::startsWith($url, url('/'))) ? $url : '/');
|
||||
}
|
||||
|
||||
public function markAllRead(Request $request): JsonResponse
|
||||
{
|
||||
$request->user()->unreadNotifications()->update(['read_at' => now()]);
|
||||
|
||||
return response()->json(['unread' => 0]);
|
||||
}
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ use App\Http\Resources\PersonResource;
|
|||
use App\Models\User;
|
||||
use App\Support\ProfileFields;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Inertia\Inertia;
|
||||
|
|
@ -55,6 +56,30 @@ class PeopleController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Personenauswahl in Formularen (z. B. Block „Ansprechpartner“): Suche oder Abruf per ID.
|
||||
*/
|
||||
public function search(Request $request): JsonResponse
|
||||
{
|
||||
$data = $request->validate([
|
||||
'q' => ['nullable', 'string', 'max:100'],
|
||||
'ids' => ['nullable', 'array', 'max:50'],
|
||||
'ids.*' => ['integer'],
|
||||
]);
|
||||
|
||||
$search = trim($data['q'] ?? '');
|
||||
$like = '%'.str_replace(['\\', '%', '_'], ['\\\\', '\\%', '\\_'], $search).'%';
|
||||
|
||||
$people = User::query()->active()
|
||||
->when(isset($data['ids']), fn (Builder $q) => $q->whereIn('id', $data['ids']))
|
||||
->when(! isset($data['ids']), fn (Builder $q) => $q->where(fn (Builder $q) => $q->where('name', 'like', $like)->orWhere('email', 'like', $like)))
|
||||
->orderBy('name')
|
||||
->limit(20)
|
||||
->get();
|
||||
|
||||
return response()->json(['people' => PersonResource::collection($people)->resolve()]);
|
||||
}
|
||||
|
||||
public function show(User $user): Response
|
||||
{
|
||||
abort_unless($user->is_active, 404);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue