presseportale/resources/views/livewire/customer/company-switcher.blade.php
Kevin Adametz a000238ca8 User Panel: Phase-8-Abschluss, Titelbild/Lizenzen/Zeitzonen und KI-Pruef-Pipeline
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>
2026-06-12 08:30:13 +00:00

96 lines
3.4 KiB
PHP

<?php
use App\Services\Customer\CustomerCompanyContext;
use Livewire\Volt\Component;
new class extends Component
{
public string $activeCompany = 'all';
public function mount(CustomerCompanyContext $context): void
{
$companyId = $context->selectedCompanyId(auth()->user());
$this->activeCompany = $companyId === null ? 'all' : (string) $companyId;
}
public function updatedActiveCompany(CustomerCompanyContext $context): void
{
if ($this->activeCompany === 'all') {
$context->select(auth()->user(), null);
} elseif (is_numeric($this->activeCompany)) {
$context->select(auth()->user(), (int) $this->activeCompany);
}
$this->redirect($this->redirectTarget(), navigate: false);
}
public function with(CustomerCompanyContext $context): array
{
$user = auth()->user();
$selectedCompanyId = $context->selectedCompanyId($user);
$companies = $context->switcherCompaniesFor($user, $selectedCompanyId, 51);
$visibleCompanies = $companies->take(50)->values();
return [
'companies' => $visibleCompanies,
'hasMoreCompanies' => $companies->count() > 50,
'selectedCompany' => $selectedCompanyId === null
? null
: $visibleCompanies->firstWhere('id', $selectedCompanyId),
'context' => $context,
'user' => $user,
];
}
private function redirectTarget(): string
{
return (string) request()->headers->get('referer', route('me.dashboard'));
}
}; ?>
<div class="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-end">
@if ($companies->isNotEmpty())
<span class="badge hub dot hidden sm:inline-flex">{{ __('Aktive Firma') }}</span>
<div class="min-w-0 sm:w-72">
<flux:select wire:model.live="activeCompany" size="sm">
<option value="all">{{ __('Alle Firmen') }}</option>
@foreach ($companies as $company)
<option value="{{ $company->id }}">
{{ $company->name }} · {{ $context->roleLabelFor($company, $user) }}
</option>
@endforeach
@if ($hasMoreCompanies)
<option value="all" disabled>{{ __('Weitere Firmen über „Firmen" öffnen') }}</option>
@endif
</flux:select>
</div>
<div class="hidden max-w-48 truncate text-[11px] uppercase tracking-[0.6px] font-semibold text-[color:var(--color-ink-3)] lg:block">
@if ($selectedCompany)
{{ $selectedCompany->portal?->label() ?? __('Portal unbekannt') }}
@else
{{ __('Aggregierte Sicht') }}
@endif
</div>
@if ($selectedCompany)
<flux:button
size="sm"
variant="filled"
icon="building-office"
href="{{ route('me.press-kits.show', $selectedCompany->id) }}"
wire:navigate
>
{{ __('Firma öffnen') }}
</flux:button>
@else
<flux:button size="sm" variant="filled" icon="building-office" href="{{ route('me.press-kits.index') }}" wire:navigate>
{{ __('Firmen') }}
</flux:button>
@endif
@else
<span class="badge warn dot">{{ __('Keine Firma zugeordnet') }}</span>
@endif
</div>