presseportale/resources/views/components/content-score-panel.blade.php
Kevin Adametz 6f96e4a4cc PM-Detailseite: Inhaltspruefung (Gruen/Gelb/Rot) + Qualitaets-Score sichtbar
- Neue Kachel "Inhaltspruefung" in Status & Verlauf (Badge je Ergebnis,
  "Ausstehend" ohne Pruefung); bei Gelb neutraler Hinweis, dass die
  Boost-Platzierung gruen gepruefte Meldungen voraussetzt
- Content-Score-Panel des Editors in gemeinsame Komponente
  x-content-score-panel extrahiert und auf der Detailseite wiederverwendet
  (Score/100, Stufe, Abstand zur naechsten Schwelle)
- PressReleaseClassification::badgeClass() (ok/warn/err)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 14:59:33 +00:00

42 lines
1.9 KiB
PHP
Raw 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.

{{-- Content-Score-Panel (Qualitäts-Feedback): Score 0–100 + Stufe samt
Abstand zur nächsten Schwelle. Gemeinsam genutzt von PM-Editor und
PM-Detailseite (13.07.); `note` trägt den kontextspezifischen Fußtext. --}}
@props(['score', 'tier' => null, 'note' => null])
@php
$tierEnum = $tier instanceof \App\Enums\PressReleaseContentTier
? $tier
: ($tier ? \App\Enums\PressReleaseContentTier::from($tier) : null);
$tiers = config('scoring.content_score.tiers');
$nextThreshold = $score < (int) $tiers['gepruft']
? (int) $tiers['gepruft']
: ($score < (int) $tiers['hochwertig'] ? (int) $tiers['hochwertig'] : null);
@endphp
<article class="panel">
<div class="panel-head">
<span class="section-eyebrow">{{ __('Qualität') }}</span>
@if ($tierEnum)
<span class="badge {{ $tierEnum === \App\Enums\PressReleaseContentTier::Hochwertig ? 'ok' : ($tierEnum === \App\Enums\PressReleaseContentTier::Geprueft ? 'hub' : 'muted') }}">{{ $tierEnum->label() }}</span>
@endif
</div>
<div class="p-4">
<div class="text-[26px] font-bold leading-none text-[color:var(--color-ink)]">
{{ $score }}<span class="text-[14px] font-medium text-[color:var(--color-ink-3)]">/100</span>
</div>
@if ($nextThreshold)
<p class="text-[12px] text-[color:var(--color-ink-2)] mt-2 m-0">
{{ __('Noch :points Punkte bis zur nächsten Stufe.', ['points' => $nextThreshold - $score]) }}
</p>
@else
<p class="text-[12px] text-[color:var(--color-ink-2)] mt-2 m-0">
{{ __('Höchste Stufe erreicht.') }}
</p>
@endif
@if ($note)
<p class="text-[11px] text-[color:var(--color-ink-3)] mt-2 leading-[1.45] m-0">
{{ $note }}
</p>
@endif
</div>
</article>