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
56
plugins-core/news/src/EditorialNews.php
Normal file
56
plugins-core/news/src/EditorialNews.php
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\News;
|
||||
|
||||
use App\Models\User;
|
||||
use Inhaus\Plugins\News\Models\NewsPost;
|
||||
|
||||
/**
|
||||
* „Redaktion → Neuigkeiten“: eigene Entwürfe, Beiträge zur Freigabe und Geplantes.
|
||||
*/
|
||||
final class EditorialNews
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public static function props(User $user): array
|
||||
{
|
||||
$publishable = $user->can('news.manage') ? true : $user->permissions()->ids('news.post.publish', 'news_category');
|
||||
$writable = $user->can('news.manage') ? true : $user->permissions()->ids('news.post.create', 'news_category');
|
||||
|
||||
$map = fn (NewsPost $post) => [
|
||||
'id' => $post->id,
|
||||
'title' => $post->title,
|
||||
'category' => $post->category?->name,
|
||||
'author' => $post->author?->name,
|
||||
'status' => $post->status,
|
||||
'status_label' => $post->statusLabel(),
|
||||
'review_note' => $post->review_note,
|
||||
'date' => ($post->published_at ?? $post->submitted_at ?? $post->updated_at)?->toIso8601String(),
|
||||
'edit_url' => route('news.editor.edit', $post),
|
||||
];
|
||||
|
||||
$review = $publishable === [] ? collect() : NewsPost::query()->with(['category', 'author'])
|
||||
->where('status', NewsPost::PENDING)
|
||||
->when($publishable !== true, fn ($q) => $q->whereIn('category_id', $publishable))
|
||||
->oldest('submitted_at')->limit(20)->get();
|
||||
|
||||
$mine = NewsPost::query()->with(['category', 'author'])
|
||||
->where('author_id', $user->id)
|
||||
->where(fn ($q) => $q->whereIn('status', [NewsPost::DRAFT, NewsPost::PENDING])->orWhere('published_at', '>', now()))
|
||||
->latest('updated_at')->limit(20)->get();
|
||||
|
||||
$scheduled = NewsPost::query()->with(['category', 'author'])
|
||||
->where('status', NewsPost::PUBLISHED)->where('published_at', '>', now())
|
||||
->when($writable !== true, fn ($q) => $q->whereIn('category_id', $writable ?: [0]))
|
||||
->whereKeyNot($mine->modelKeys())
|
||||
->oldest('published_at')->limit(20)->get();
|
||||
|
||||
return [
|
||||
'review' => $review->map($map)->all(),
|
||||
'mine' => $mine->map($map)->all(),
|
||||
'scheduled' => $scheduled->map($map)->all(),
|
||||
'canCreate' => app(Policies\NewsPostPolicy::class)->create($user),
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue