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:
parent
0cddf5fbdc
commit
4f2be1e0a8
3 changed files with 61 additions and 7 deletions
|
|
@ -575,7 +575,8 @@ class PressRelease extends Model
|
||||||
|
|
||||||
$models = static::query()->withoutGlobalScopes()
|
$models = static::query()->withoutGlobalScopes()
|
||||||
->whereKey($pageIds)
|
->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
|
// Für das Einreichungs-Modal je Zeile: ohne eigenes Bild entfällt
|
||||||
// die Bildrechte-Bestätigung.
|
// die Bildrechte-Bestätigung.
|
||||||
->withCount('images')
|
->withCount('images')
|
||||||
|
|
|
||||||
|
|
@ -442,6 +442,9 @@ new #[Layout('components.layouts.app'), Title('Meine Pressemitteilungen')] class
|
||||||
@foreach ($pressReleases as $pr)
|
@foreach ($pressReleases as $pr)
|
||||||
@php
|
@php
|
||||||
$status = $pr->status->value;
|
$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) {
|
$rowClass = match ($status) {
|
||||||
'review' => 'is-row-warn',
|
'review' => 'is-row-warn',
|
||||||
'rejected' => 'is-row-err',
|
'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')]) }}
|
{{ __('Boost bis :date', ['date' => $boostEndsAt->format('d.m.Y')]) }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</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
|
@endif
|
||||||
</flux:table.cell>
|
</flux:table.cell>
|
||||||
|
|
||||||
<flux:table.cell>
|
<flux:table.cell>
|
||||||
<a href="{{ route('me.press-releases.show', $pr->id) }}" wire:navigate
|
<div class="flex items-start gap-1.5">
|
||||||
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)]">
|
<a href="{{ route('me.press-releases.show', $pr->id) }}" wire:navigate
|
||||||
{{ $pr->title }}
|
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)]">
|
||||||
</a>
|
{{ $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]">
|
<div class="text-[11.5px] text-[color:var(--color-ink-3)] mt-0.5 leading-[1.4]">
|
||||||
PM-{{ $pr->id }}
|
PM-{{ $pr->id }}
|
||||||
</div>
|
</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>
|
<span class="portal-pill bp"><span class="pdot"></span>businessportal24</span>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
<flux:table.cell>
|
<flux:table.cell>
|
||||||
|
|
|
||||||
|
|
@ -298,15 +298,43 @@ test('the press release list shows a hint with end date for an active boost', fu
|
||||||
|
|
||||||
$this->actingAs($customer);
|
$this->actingAs($customer);
|
||||||
|
|
||||||
|
// Ohne laufenden Boost wirbt die grüne, veröffentlichte PM für das Add-on.
|
||||||
LivewireVolt::test('customer.press-releases.index')
|
LivewireVolt::test('customer.press-releases.index')
|
||||||
->assertDontSee('Boost bis');
|
->assertDontSee('Boost bis')
|
||||||
|
->assertSee('Boost möglich');
|
||||||
|
|
||||||
Boost::factory()->for($pr)->create([
|
Boost::factory()->for($pr)->create([
|
||||||
'ends_at' => now()->addDays(7)->setTime(9, 0),
|
'ends_at' => now()->addDays(7)->setTime(9, 0),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
LivewireVolt::test('customer.press-releases.index')
|
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 () {
|
test('an expired boost shows no hint in the press release list', function () {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue