Phase 8 (Rest) + Umbauten vom 10./11.06.: - Ein Titelbild pro PM (Cover 1280x580), SVG-Platzhalter-Set + Picker, PressReleaseCoverImage-Resolver - Lizenz-/Rechteformular nach "Lizenztyp Bildupload" (7 Lizenztypen, Personen-/Sachrechte-Status, bedingte Pflichtfelder, Risikohinweise) - Veroeffentlichungs-Box vereinfacht (Embargo aus der Form-UI entfernt), geplante Termine in Europe/Berlin (Speicherung UTC, DISPLAY_TIMEZONE) - Quota-Stub (users.press_release_quota) + monatlicher Reset-Command - Einreichungs-Modal einheitlich in Show/Create/Edit; Ghost-Buttons auf filled; PM-Editor-Layout responsive entkoppelt (.pr-editor-layout) KI-Pruef-Pipeline (Phasen 1-5 des Entwicklungsplans): - API-Haertung: status nicht mehr per API setzbar, eigene Submit-Route durch denselben Funnel (Blacklist, Quota, Status-Log) - Klassifikation Rot/Gelb/Gruen asynchron (Queue classification, OpenAI-Treiber + deterministischer Fallback), ki_audits-Audit-Log - Routing: Rot -> rejected + Mail, Gelb -> Review-Queue, Gruen -> Auto-Publish; Scheduler publiziert nur gruene faellige PMs - Content-Score 0-100 -> Stufe (Standard/Geprueft/Hochwertig) inkl. Editor-Panel und Badges; Re-Klassifikation/-Score bei Aenderung - Admin: KI-Badge + Filter, On-Demand-Pruefung mit Anbieter-Override Suite: 442 passed, 4 skipped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
214 lines
8.8 KiB
PHP
214 lines
8.8 KiB
PHP
<?php
|
|
|
|
use App\Models\AdminPreset;
|
|
use App\Services\Admin\AdminPerformanceCache;
|
|
use Livewire\Attributes\Layout;
|
|
use Livewire\Attributes\Title;
|
|
use Livewire\Volt\Component;
|
|
use Livewire\WithPagination;
|
|
|
|
new #[Layout('components.layouts.app'), Title('Voreinstellungen')] class extends Component
|
|
{
|
|
use WithPagination;
|
|
|
|
public string $search = '';
|
|
|
|
public string $areaFilter = 'all';
|
|
|
|
public string $typeFilter = 'all';
|
|
|
|
public function updatedSearch(): void
|
|
{
|
|
$this->resetPage();
|
|
}
|
|
|
|
public function updatedAreaFilter(): void
|
|
{
|
|
$this->resetPage();
|
|
}
|
|
|
|
public function updatedTypeFilter(): void
|
|
{
|
|
$this->resetPage();
|
|
}
|
|
|
|
public function with(): array
|
|
{
|
|
$presets = AdminPreset::query()
|
|
->when(filled($this->search), function ($query): void {
|
|
$term = $this->search;
|
|
|
|
$query->where(function ($query) use ($term): void {
|
|
$query->where('key', 'like', '%'.$term.'%')
|
|
->orWhere('label', 'like', '%'.$term.'%')
|
|
->orWhere('value', 'like', '%'.$term.'%');
|
|
});
|
|
})
|
|
->when($this->areaFilter !== 'all', fn ($query) => $query->where('area', $this->areaFilter))
|
|
->when($this->typeFilter !== 'all', fn ($query) => $query->where('type', $this->typeFilter))
|
|
->orderBy('area')
|
|
->orderBy('key')
|
|
->paginate(50);
|
|
|
|
return [
|
|
'presets' => $presets,
|
|
'areas' => $this->areas(),
|
|
'types' => $this->types(),
|
|
];
|
|
}
|
|
|
|
private function areas()
|
|
{
|
|
return app(AdminPerformanceCache::class)->remember(AdminPerformanceCache::PresetAreas, AdminPerformanceCache::OptionsTtl, fn () => AdminPreset::query()
|
|
->select('area')
|
|
->distinct()
|
|
->orderBy('area')
|
|
->pluck('area'));
|
|
}
|
|
|
|
private function types()
|
|
{
|
|
return app(AdminPerformanceCache::class)->remember(AdminPerformanceCache::PresetTypes, AdminPerformanceCache::OptionsTtl, fn () => AdminPreset::query()
|
|
->select('type')
|
|
->distinct()
|
|
->orderBy('type')
|
|
->pluck('type'));
|
|
}
|
|
}; ?>
|
|
|
|
<div class="space-y-8">
|
|
{{-- ============== PAGE HEADER ============== --}}
|
|
<header class="grid items-end gap-8" style="grid-template-columns:1fr auto;">
|
|
<div class="min-w-0">
|
|
<div class="flex items-center gap-3 mb-3 flex-nowrap whitespace-nowrap">
|
|
<span class="badge hub dot">{{ __('Admin Backend') }}</span>
|
|
<span class="eyebrow muted">{{ __('Administration · Stammdaten') }}</span>
|
|
</div>
|
|
<h1 class="text-[30px] font-bold tracking-[-0.6px] leading-[1.15] m-0 text-[color:var(--color-ink)]">
|
|
{{ __('Voreinstellungen') }}
|
|
</h1>
|
|
<p class="text-[13px] leading-[1.55] mt-2 m-0 max-w-[640px] text-[color:var(--color-ink-2)]">
|
|
{{ __('Zentrale Admin-Presets fuer Texte, Zahlen und weitere Werte.') }}
|
|
</p>
|
|
</div>
|
|
|
|
<div class="flex items-center gap-2 flex-shrink-0">
|
|
<flux:button icon="plus" variant="primary" href="{{ route('admin.presets.create') }}" wire:navigate>
|
|
{{ __('Neue Voreinstellung') }}
|
|
</flux:button>
|
|
</div>
|
|
</header>
|
|
|
|
@if (session('success'))
|
|
<div class="px-4 py-3 rounded-[5px] border text-[12.5px] flex items-center gap-2
|
|
bg-[color:var(--color-ok-soft)] border-[color:var(--color-ok)]/30 text-[color:var(--color-gain-deep)]">
|
|
<flux:icon.check-circle class="size-[16px] flex-shrink-0" />
|
|
{{ session('success') }}
|
|
</div>
|
|
@endif
|
|
|
|
{{-- ============== FILTER-PANEL ============== --}}
|
|
<article class="panel">
|
|
<div class="panel-head">
|
|
<span class="section-eyebrow">{{ __('Filter & Suche') }}</span>
|
|
</div>
|
|
<div class="p-5 flex flex-col gap-3 sm:flex-row sm:items-center">
|
|
<flux:input
|
|
wire:model.live.debounce.300ms="search"
|
|
placeholder="{{ __('Key, Bezeichnung oder Wert suchen...') }}"
|
|
icon="magnifying-glass"
|
|
class="flex-1"
|
|
/>
|
|
|
|
<flux:select wire:model.live="areaFilter" class="sm:w-48">
|
|
<option value="all">{{ __('Alle Bereiche') }}</option>
|
|
@foreach ($areas as $area)
|
|
<option value="{{ $area }}">{{ $area }}</option>
|
|
@endforeach
|
|
</flux:select>
|
|
|
|
<flux:select wire:model.live="typeFilter" class="sm:w-40">
|
|
<option value="all">{{ __('Alle Typen') }}</option>
|
|
@foreach ($types as $type)
|
|
<option value="{{ $type }}">{{ $type }}</option>
|
|
@endforeach
|
|
</flux:select>
|
|
</div>
|
|
</article>
|
|
|
|
{{-- ============== TABELLE ============== --}}
|
|
<article class="panel overflow-hidden">
|
|
<div class="panel-head">
|
|
<span class="section-eyebrow">{{ __('Alle Voreinstellungen') }}</span>
|
|
<span class="text-[11.5px] text-[color:var(--color-ink-3)]">
|
|
{{ __(':count Einträge', ['count' => $presets->total()]) }}
|
|
</span>
|
|
</div>
|
|
<flux:table>
|
|
<flux:table.columns>
|
|
<flux:table.column>{{ __('Key') }}</flux:table.column>
|
|
<flux:table.column>{{ __('Bereich') }}</flux:table.column>
|
|
<flux:table.column>{{ __('Typ') }}</flux:table.column>
|
|
<flux:table.column>{{ __('Wert') }}</flux:table.column>
|
|
<flux:table.column>{{ __('Status') }}</flux:table.column>
|
|
<flux:table.column>{{ __('Aktionen') }}</flux:table.column>
|
|
</flux:table.columns>
|
|
|
|
<flux:table.rows>
|
|
@forelse ($presets as $preset)
|
|
<flux:table.row wire:key="{{ $preset->id }}">
|
|
<flux:table.cell>
|
|
<div class="max-w-xs">
|
|
<div class="text-[13px] font-semibold text-[color:var(--color-ink)] truncate">{{ $preset->label }}</div>
|
|
<div class="text-[11.5px] text-[color:var(--color-ink-3)] truncate font-mono">{{ $preset->key }}</div>
|
|
</div>
|
|
</flux:table.cell>
|
|
|
|
<flux:table.cell>
|
|
<span class="badge hub">{{ $preset->area }}</span>
|
|
</flux:table.cell>
|
|
|
|
<flux:table.cell>
|
|
<span class="badge hub">{{ $preset->type }}</span>
|
|
</flux:table.cell>
|
|
|
|
<flux:table.cell>
|
|
<div class="line-clamp-2 max-w-sm text-[12.5px] text-[color:var(--color-ink-2)]">
|
|
{{ \Illuminate\Support\Str::limit($preset->value ?? '-', 140) }}
|
|
</div>
|
|
</flux:table.cell>
|
|
|
|
<flux:table.cell>
|
|
@if ($preset->is_active)
|
|
<span class="badge ok dot">{{ __('Aktiv') }}</span>
|
|
@else
|
|
<span class="badge dot">{{ __('Inaktiv') }}</span>
|
|
@endif
|
|
</flux:table.cell>
|
|
|
|
<flux:table.cell>
|
|
<flux:button size="sm" variant="filled" icon="pencil" href="{{ route('admin.presets.edit', $preset->id) }}" wire:navigate />
|
|
</flux:table.cell>
|
|
</flux:table.row>
|
|
@empty
|
|
<flux:table.row>
|
|
<flux:table.cell colspan="6">
|
|
<div class="flex flex-col items-center justify-center px-4 py-10 text-center">
|
|
<div class="w-14 h-14 rounded-[6px] flex items-center justify-center mb-3
|
|
bg-[color:var(--color-hub-soft)] border border-[color:var(--color-hub-soft-2)] text-[color:var(--color-hub)]">
|
|
<flux:icon.cog class="size-6" />
|
|
</div>
|
|
<div class="text-[14px] font-semibold text-[color:var(--color-ink)] mb-1">
|
|
{{ __('Keine Voreinstellungen gefunden.') }}
|
|
</div>
|
|
</div>
|
|
</flux:table.cell>
|
|
</flux:table.row>
|
|
@endforelse
|
|
</flux:table.rows>
|
|
</flux:table>
|
|
<div class="border-t border-[color:var(--color-bg-rule)] p-4">
|
|
{{ $presets->links('components.portal.pagination') }}
|
|
</div>
|
|
</article>
|
|
</div>
|