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>
110 lines
3.9 KiB
PHP
110 lines
3.9 KiB
PHP
<?php
|
|
|
|
use App\Models\AdminPreset;
|
|
use Illuminate\Validation\Rule;
|
|
use Livewire\Attributes\Layout;
|
|
use Livewire\Attributes\Locked;
|
|
use Livewire\Attributes\Title;
|
|
use Livewire\Volt\Component;
|
|
|
|
new #[Layout('components.layouts.app'), Title('Voreinstellung bearbeiten')] class extends Component
|
|
{
|
|
#[Locked]
|
|
public int $id;
|
|
|
|
public string $key = '';
|
|
|
|
public string $area = '';
|
|
|
|
public string $type = 'text';
|
|
|
|
public string $label = '';
|
|
|
|
public string $value = '';
|
|
|
|
public string $payload = '';
|
|
|
|
public bool $isActive = true;
|
|
|
|
public function mount(int $id): void
|
|
{
|
|
$this->id = $id;
|
|
|
|
$preset = AdminPreset::query()->findOrFail($id);
|
|
|
|
$this->key = $preset->key;
|
|
$this->area = $preset->area;
|
|
$this->type = $preset->type;
|
|
$this->label = $preset->label;
|
|
$this->value = $preset->value ?? '';
|
|
$this->payload = $preset->payload ? json_encode($preset->payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) : '';
|
|
$this->isActive = $preset->is_active;
|
|
}
|
|
|
|
public function save(): void
|
|
{
|
|
$validated = $this->validate([
|
|
'key' => ['required', 'string', 'max:255', 'regex:/^[a-z0-9_.-]+$/', Rule::unique('admin_presets', 'key')->ignore($this->id)],
|
|
'area' => ['required', 'string', 'max:100'],
|
|
'type' => ['required', Rule::in(['text', 'number', 'boolean', 'json'])],
|
|
'label' => ['required', 'string', 'max:255'],
|
|
'value' => ['nullable', 'string'],
|
|
'payload' => ['nullable', 'json'],
|
|
'isActive' => ['boolean'],
|
|
]);
|
|
|
|
AdminPreset::query()
|
|
->findOrFail($this->id)
|
|
->update([
|
|
'key' => $validated['key'],
|
|
'area' => $validated['area'],
|
|
'type' => $validated['type'],
|
|
'label' => $validated['label'],
|
|
'value' => $validated['value'] ?: null,
|
|
'payload' => filled($validated['payload']) ? json_decode($validated['payload'], true) : null,
|
|
'is_active' => $validated['isActive'],
|
|
]);
|
|
|
|
session()->flash('success', __('Voreinstellung wurde gespeichert.'));
|
|
|
|
$this->redirect(route('admin.presets.index'), navigate: true);
|
|
}
|
|
}; ?>
|
|
|
|
<form wire:submit="save" 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 · Voreinstellungen') }}</span>
|
|
<span class="badge hub">ID #{{ $id }}</span>
|
|
</div>
|
|
<h1 class="text-[30px] font-bold tracking-[-0.6px] leading-[1.15] m-0 text-[color:var(--color-ink)]">
|
|
{{ __('Voreinstellung bearbeiten') }}
|
|
</h1>
|
|
<p class="text-[13px] leading-[1.55] mt-2 m-0 max-w-[640px] text-[color:var(--color-ink-2)]">
|
|
{{ __('Texte, Zahlen oder JSON-Werte zentral fuer Admin-Funktionen pflegen.') }}
|
|
</p>
|
|
</div>
|
|
|
|
<div class="flex items-center gap-2 flex-shrink-0">
|
|
<flux:button variant="filled" icon="arrow-left" href="{{ route('admin.presets.index') }}" wire:navigate>
|
|
{{ __('Zurück') }}
|
|
</flux:button>
|
|
</div>
|
|
</header>
|
|
|
|
@include('livewire.admin.presets.partials.form-fields')
|
|
|
|
<article class="panel">
|
|
<div class="p-5 flex justify-end gap-3">
|
|
<flux:button variant="filled" href="{{ route('admin.presets.index') }}" wire:navigate>
|
|
{{ __('Abbrechen') }}
|
|
</flux:button>
|
|
<flux:button type="submit" variant="primary">
|
|
{{ __('Änderungen speichern') }}
|
|
</flux:button>
|
|
</div>
|
|
</article>
|
|
</form>
|