PM-Uebersicht: Rubrik unter Portal, Boost-moeglich-Hinweis, gruener Haken

- Rubrik (lokalisiert) direkt unter den Portal-Pills; Kategorie wird in
  accessiblePageFor() eager geladen (kein N+1)
- Status-Spalte: laeuft kein Boost, wirbt eine veroeffentlichte gruene PM
  mit "Boost moeglich ->" (Link zur PM-Seite mit den Add-ons)
- Gruen geprueft: kleiner gruener Haken neben dem Titel (Tooltip
  "Inhaltspruefung: Gruen")

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-07-13 13:23:07 +00:00
parent 0cddf5fbdc
commit 4f2be1e0a8
3 changed files with 61 additions and 7 deletions

View file

@ -575,7 +575,8 @@ class PressRelease extends Model
$models = static::query()->withoutGlobalScopes()
->whereKey($pageIds)
->with('company:id,name')
// Kategorie fürs Listen-Rendering (localizedCategoryName, 13.07.).
->with(['company:id,name', 'category.translations'])
// Für das Einreichungs-Modal je Zeile: ohne eigenes Bild entfällt
// die Bildrechte-Bestätigung.
->withCount('images')

View file

@ -442,6 +442,9 @@ new #[Layout('components.layouts.app'), Title('Meine Pressemitteilungen')] class
@foreach ($pressReleases as $pr)
@php
$status = $pr->status->value;
// Grün geprüft = boostbar (Gate im BoostService); der Haken
// zeigt das Prüfergebnis auch abseits des Boost-Hinweises.
$isGreen = $pr->classification === \App\Enums\PressReleaseClassification::Green;
$rowClass = match ($status) {
'review' => 'is-row-warn',
'rejected' => 'is-row-err',
@ -492,14 +495,30 @@ new #[Layout('components.layouts.app'), Title('Meine Pressemitteilungen')] class
{{ __('Boost bis :date', ['date' => $boostEndsAt->format('d.m.Y')]) }}
</span>
</div>
@elseif ($status === 'published' && $isGreen)
{{-- Boostbar (veröffentlicht + grün): Hinweis auf das Add-on (13.07.). --}}
<div class="mt-1">
<a href="{{ route('me.press-releases.show', $pr->id) }}" wire:navigate
class="inline-action" title="{{ __('Grün geprüft — ein Boost ist buchbar (Add-ons auf der PM-Seite)') }}">
{{ __('Boost möglich →') }}
</a>
</div>
@endif
</flux:table.cell>
<flux:table.cell>
<a href="{{ route('me.press-releases.show', $pr->id) }}" wire:navigate
class="block font-semibold text-[13.5px] leading-[1.35] text-[color:var(--color-ink)] hover:text-[color:var(--color-hub)] hover:underline underline-offset-[3px] decoration-[color:var(--color-hub)]/40 hover:decoration-[color:var(--color-hub)]">
{{ $pr->title }}
</a>
<div class="flex items-start gap-1.5">
<a href="{{ route('me.press-releases.show', $pr->id) }}" wire:navigate
class="block font-semibold text-[13.5px] leading-[1.35] text-[color:var(--color-ink)] hover:text-[color:var(--color-hub)] hover:underline underline-offset-[3px] decoration-[color:var(--color-hub)]/40 hover:decoration-[color:var(--color-hub)]">
{{ $pr->title }}
</a>
@if ($isGreen)
{{-- Grüner Haken = Inhaltsprüfung mit Ergebnis Grün (13.07.). --}}
<span class="shrink-0 mt-0.5 text-[color:var(--color-ok)]" title="{{ __('Inhaltsprüfung: Grün') }}">
<flux:icon.check-circle variant="micro" class="size-3.5" />
</span>
@endif
</div>
<div class="text-[11.5px] text-[color:var(--color-ink-3)] mt-0.5 leading-[1.4]">
PM-{{ $pr->id }}
</div>
@ -514,6 +533,12 @@ new #[Layout('components.layouts.app'), Title('Meine Pressemitteilungen')] class
<span class="portal-pill bp"><span class="pdot"></span>businessportal24</span>
@endif
</div>
@if ($categoryName = $pr->localizedCategoryName())
{{-- Rubrik direkt unter den Portal-Pills (13.07.). --}}
<div class="text-[11px] text-[color:var(--color-ink-3)] mt-1 leading-[1.4]">
{{ $categoryName }}
</div>
@endif
</flux:table.cell>
<flux:table.cell>

View file

@ -298,15 +298,43 @@ test('the press release list shows a hint with end date for an active boost', fu
$this->actingAs($customer);
// Ohne laufenden Boost wirbt die grüne, veröffentlichte PM für das Add-on.
LivewireVolt::test('customer.press-releases.index')
->assertDontSee('Boost bis');
->assertDontSee('Boost bis')
->assertSee('Boost möglich');
Boost::factory()->for($pr)->create([
'ends_at' => now()->addDays(7)->setTime(9, 0),
]);
LivewireVolt::test('customer.press-releases.index')
->assertSee('Boost bis '.now()->addDays(7)->format('d.m.Y'));
->assertSee('Boost bis '.now()->addDays(7)->format('d.m.Y'))
->assertDontSee('Boost möglich');
});
test('the list shows the category under the portal and a green check for green releases', function () {
/** @var TestCase $this */
['customer' => $customer, 'pr' => $pr] = publishedGreenPrForOwner();
$pr->category->translations()->create(['locale' => 'de', 'name' => 'Energie & Klima', 'slug' => 'energie-klima']);
$this->actingAs($customer);
LivewireVolt::test('customer.press-releases.index')
->assertSee('Energie & Klima')
->assertSee('Inhaltsprüfung: Grün');
});
test('a non-green release shows neither the green check nor the boost hint', function () {
/** @var TestCase $this */
['customer' => $customer, 'pr' => $pr] = publishedGreenPrForOwner();
$pr->update(['classification' => PressReleaseClassification::Yellow->value]);
$this->actingAs($customer);
LivewireVolt::test('customer.press-releases.index')
->assertDontSee('Inhaltsprüfung: Grün')
->assertDontSee('Boost möglich');
});
test('an expired boost shows no hint in the press release list', function () {