Add-on-Panel zeigt freie Boost-Plaetze je Stufe
slotAvailability() liefert zusaetzlich free/limit (knappste Ausgabe, ohne den eigenen gehaltenen Slot); solange buchbar, steht unter den Kauf-Buttons "Noch X von Y Plaetzen frei." — bei laufendem Boost weiterhin nur der Verlaengerungs-Hinweis. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
842d6a2bd0
commit
0cddf5fbdc
5 changed files with 65 additions and 12 deletions
|
|
@ -323,7 +323,7 @@ new #[Layout('components.layouts.app'), Title('Pressemitteilung')] class extends
|
|||
* fürs Add-on-Panel: Preise, laufende Platzierung, Slot-Verfügbarkeit
|
||||
* („Derzeit ausgebucht — frei ab …", Entscheidung 13.07.).
|
||||
*
|
||||
* @return array<string, array{label: string, description: string, options: array<int, int>, isBoosted: bool, activeUntil: \Illuminate\Support\Carbon|null, available: bool, freeAt: \Illuminate\Support\Carbon|null}>
|
||||
* @return array<string, array{label: string, description: string, options: array<int, int>, isBoosted: bool, activeUntil: \Illuminate\Support\Carbon|null, available: bool, free: int, limit: int, freeAt: \Illuminate\Support\Carbon|null}>
|
||||
*/
|
||||
private function boostAddOns(PressRelease $pr, BoostService $boostService): array
|
||||
{
|
||||
|
|
@ -335,7 +335,7 @@ new #[Layout('components.layouts.app'), Title('Pressemitteilung')] class extends
|
|||
// Slot-Abfrage nur, wenn die PM überhaupt boostbar ist.
|
||||
$availability = $canBoost
|
||||
? $boostService->slotAvailability($pr, $placement)
|
||||
: ['available' => false, 'freeAt' => null];
|
||||
: ['available' => false, 'free' => 0, 'limit' => $boostService->slotLimit($placement), 'freeAt' => null];
|
||||
|
||||
$addOns[$placement->value] = [
|
||||
'label' => $placement->label(),
|
||||
|
|
@ -346,6 +346,8 @@ new #[Layout('components.layouts.app'), Title('Pressemitteilung')] class extends
|
|||
'isBoosted' => $boostService->isBoosted($pr, $placement),
|
||||
'activeUntil' => $boostService->activeUntil($pr, $placement),
|
||||
'available' => $availability['available'],
|
||||
'free' => $availability['free'],
|
||||
'limit' => $availability['limit'],
|
||||
'freeAt' => $availability['freeAt'],
|
||||
];
|
||||
}
|
||||
|
|
@ -735,6 +737,11 @@ new #[Layout('components.layouts.app'), Title('Pressemitteilung')] class extends
|
|||
</div>
|
||||
@if ($addOn['isBoosted'])
|
||||
<p class="text-[11.5px] text-[color:var(--color-ink-3)] m-0">{{ __('Ein weiterer Kauf verlängert die Laufzeit.') }}</p>
|
||||
@else
|
||||
{{-- Slot-Transparenz (13.07.): knappe Plätze sichtbar machen. --}}
|
||||
<p class="text-[11.5px] text-[color:var(--color-ink-3)] m-0">
|
||||
{{ __('Noch :free von :limit Plätzen frei.', ['free' => $addOn['free'], 'limit' => $addOn['limit']]) }}
|
||||
</p>
|
||||
@endif
|
||||
@elseif ($canBoost)
|
||||
{{-- Slot-Inventar erschöpft: ehrlich ausweisen statt verkaufen (13.07.). --}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue