Files
LarsandClaude Opus 5.5 d2b1a853dc Banner zentral: je Website, Saison und Prioritaet, auch fuer Sonderangebote
Hinweise werden zu Bannern mit Website, Erscheinungsbildern, Prioritaet und
optionalem Sonderangebot (Text, Termin und Link aus dem Angebot, sichtbar nur
solange es beworben wird). Sonderangebote lassen sich mit einem Klick als Banner
zeigen; die Liste nennt das heute sichtbare Banner. Banner-Texte der
Erscheinungsbilder werden zu saisonalen Bannern.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 19:01:48 +01:00

37 lines
1016 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Filament\Resources\Notices\Pages;
use App\Filament\Resources\Notices\NoticeResource;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;
class ListNotices extends ListRecords
{
protected static string $resource = NoticeResource::class;
/**
* Which banner the website shows today – the answer to "why do I see this banner?".
*/
public function getSubheading(): ?string
{
$today = NoticeResource::bannersToday();
if ($today === []) {
return null;
}
return collect($today)->map(function (array $entry) use ($today): string {
$prefix = count($today) > 1 ? $entry['site']->name.': ' : '';
return $prefix.($entry['banner'] ? 'Heute sichtbar: „'.$entry['banner']->text.'“' : 'Heute ist kein Banner sichtbar.');
})->implode(' · ');
}
protected function getHeaderActions(): array
{
return [
CreateAction::make(),
];
}
}