Gib Website-Bilder aus dem Medienmanager frei, ohne sie zu lizenzieren.
Deploy Test / test (push) Successful in 48s
Deploy Test / deploy (push) Successful in 29s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-11-18 22:01:05 +01:00
1 parent 72130d66c5
commit 13530b8171
18 files changed
+940 -2

No files matched your search

@@ -15,6 +15,8 @@
use App\Domain\Cms\Catalog\PublicMaterialReader;
use App\Domain\Cms\Widgets\RenderContext;
use App\Domain\Media\ThumbnailRef;
use App\Domain\Media\WebsiteMedia;
use App\Domain\Media\WebsiteRelease;
use App\Filament\Resources\ContentElements\ContentElementResource;
use App\Filament\Support\CatalogReading;
use App\Filament\Support\EditorialCatalog;
@@ -67,6 +69,12 @@ class ViewContentElement extends ViewRecord
public string $licenseNote = '';
public string $websiteCredit = '';
public string $websiteAlt = '';
public string $websiteFeedback = '';
public int|string|null $kindId = null;
/** @var list<int|string> */
@@ -453,6 +461,8 @@ public function saveEditorial(): void
'description' => $this->descriptionText,
'usage_note' => $this->usageNote,
'license_note' => $this->licenseNote,
'website_credit' => $this->websiteCredit,
'website_alt' => $this->websiteAlt,
'thumbnail_alt' => $this->thumbnailAlt,
'editorial_content_kind_id' => filled($this->kindId) ? (int) $this->kindId : null,
], auth()->user());
@@ -476,6 +486,41 @@ public function saveEditorial(): void
: 'Gespeichert. Prüfe die Fassungen, ihre Zahl hat sich geändert.';
}
public function releaseForWebsite(): void
{
abort_unless(ContentElementResource::editor(), 403);
/** @var ContentElement $element */
$element = $this->getRecord();
app(IdentityProfile::class)->fill($element, [
'website_credit' => $this->websiteCredit,
'website_alt' => $this->websiteAlt,
], auth()->user());
$element->refresh();
$this->websiteFeedback = app(WebsiteRelease::class)->release($element, auth()->user());
$element->refresh();
$this->fillEditorial();
}
public function withdrawWebsite(): void
{
abort_unless(ContentElementResource::editor(), 403);
/** @var ContentElement $element */
$element = $this->getRecord();
$this->websiteFeedback = app(WebsiteRelease::class)->withdraw($element, auth()->user());
$element->refresh();
$this->fillEditorial();
}
public function websiteIsPublic(): bool
{
/** @var ContentElement $element */
$element = $this->getRecord();
return app(WebsiteMedia::class)->present($element->fresh()) !== null;
}
public function adoptLibraryImage(): void
{
abort_unless(ContentElementResource::editor(), 403);
@@ -610,6 +655,9 @@ public function editorialHistory(): array
'summary' => 'Kurzbeschreibung',
'usage_note' => 'Einsatzhinweis',
'license_note' => 'Interner Lizenzvermerk',
'website_credit' => 'Quellenzeile',
'website_alt' => 'Alternativtext der Website',
'website_released_at' => 'Website-Freigabe',
'thumbnail_alt' => 'Alternativtext',
'thumbnail_path' => 'Vorschaubild',
'thumbnail_source' => 'Herkunft des Vorschaubilds',
@@ -651,6 +699,8 @@ private function fillEditorial(): void
$this->descriptionText = (string) ($element->description ?? '');
$this->usageNote = (string) ($element->usage_note ?? '');
$this->licenseNote = (string) ($element->license_note ?? '');
$this->websiteCredit = (string) ($element->website_credit ?? '');
$this->websiteAlt = (string) ($element->website_alt ?? '');
$this->kindId = $element->editorial_content_kind_id;
$this->pillarIds = $element->pillars()->pluck('pillars.id')->all();
$this->dimensionIds = IdentityDimensionValue::query()