Frontend: Editorial-Relaunch der öffentlichen Strecke + Ausgaben-Routing

Öffentliche Seiten auf gemeinsames Editorial-Design (x-web.site-header/-footer,
Design-Tokens) und Ausgaben-Präfix /{edition}/ (de|en) umgestellt.

- Routing: neue Middleware SetEdition (Locale + URL::defaults), /{edition}-Gruppe
  in routes/web.php, Root-Redirect auf /de, 301 für Legacy-.html-URLs,
  Baseline-Default in AppServiceProvider.
- Neue URL-Schemata: /{edition}/press-release/{slug}, /{edition}/category/{slug}.
- Ausgabe = Sprache: DE/EN-Umschalter (Region/CH/AT entfernt); EditorialClock
  und Livewire-Komponenten sprachdynamisch.
- Detail-, Kategorie- und Veröffentlichen-Seite mit echten Daten neu aufgebaut.
- Suche aktiviert: Volt-Komponente livewire/web/search (Titel/Text/Keywords +
  Firma + Rubrik, Filter, Sortierung, Pagination, URL-Parameter q/category/sort).
- Rubriken-Navigation statt Übersichtsseite: Helper CategoryNavigation;
  web/kategorien.blade.php + Route entfernt (Legacy-301).
- Tests: Edition-Routing, Kategorie-Seite/-Navigation, Detail, Veröffentlichen,
  Suche, EditorialClock. Doku in "Echte öffentliche Unterseiten.md" aktualisiert.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Kevin Adametz 2026-06-16 16:39:28 +00:00
parent a0547208d3
commit 253141c6dc
64 changed files with 4457 additions and 2971 deletions

View file

@ -3,13 +3,16 @@
use App\Enums\Portal;
use App\Enums\PressReleaseStatus;
use App\Models\PressRelease;
use App\Support\EditorialClock;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Carbon;
use Livewire\Attributes\Locked;
use Livewire\Volt\Component;
use Livewire\WithPagination;
new class extends Component {
new class extends Component
{
use WithPagination;
public string $timeframe = 'all';
@ -17,6 +20,9 @@ new class extends Component {
#[Locked]
public ?string $portal = null;
#[Locked]
public string $language = 'de';
protected array $queryString = [
'timeframe' => ['except' => 'all'],
];
@ -37,13 +43,20 @@ new class extends Component {
private function pressReleases(): LengthAwarePaginator
{
$reference = $this->referenceNow();
return $this->baseQuery()
->when($this->timeframe === 'today', fn (Builder $query) => $query->whereDate('published_at', today()))
->when($this->timeframe === 'week', fn (Builder $query) => $query->where('published_at', '>=', now()->subDays(7)))
->when($this->timeframe === 'today', fn (Builder $query) => $query->whereDate('published_at', $reference->toDateString()))
->when($this->timeframe === 'week', fn (Builder $query) => $query->where('published_at', '>=', $reference->copy()->subDays(7)))
->orderByDesc('published_at')
->paginate(8);
}
private function referenceNow(): Carbon
{
return EditorialClock::reference($this->portalValues(), $this->language);
}
private function totalCount(): int
{
return $this->baseQuery()->count();
@ -54,7 +67,7 @@ new class extends Component {
return PressRelease::query()
->with([
'company',
'category.translations' => fn ($query) => $query->where('locale', 'de'),
'category.translations' => fn ($query) => $query->where('locale', $this->language),
'images' => fn ($query) => $query
->orderByDesc('is_preview')
->orderBy('sort_order')
@ -62,7 +75,7 @@ new class extends Component {
])
->whereIn('portal', $this->portalValues())
->where('status', PressReleaseStatus::Published)
->where('language', 'de')
->where('language', $this->language)
->whereNotNull('published_at')
->where('published_at', '<=', now());
}
@ -150,9 +163,9 @@ new class extends Component {
</div>
@elseif (! $top)
<div class="flex justify-center mt-7">
<a href="{{ route('kategorien') }}"
<a href="{{ route('web.home') }}"
class="inline-flex items-center gap-2 px-[18px] py-2.5 text-[13px] font-semibold text-ink bg-transparent border border-bg-rule-strong rounded-[2px] cursor-pointer hover:bg-ink hover:text-bg transition-colors">
Alle Rubriken entdecken →
Zur Startseite →
</a>
</div>
@endif