User-Panel-Restarbeiten: PM-Guard, Profil-Rework, USt-ID-Prüfung, Buchungspflicht-Adresse

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-06-12 14:36:18 +00:00
parent 036a53499f
commit afcca34f91
25 changed files with 905 additions and 140 deletions

View file

@ -65,10 +65,22 @@ new #[Layout('components.layouts.app'), Title('Neue Pressemitteilung')] class ex
public string $placeholderVariant = '';
public bool $hasCompanies = true;
public function mount(): void
{
$user = auth()->user();
$context = app(CustomerCompanyContext::class);
// Ohne Firma kein PM-Formular: statt eines leeren Editors, in dem
// weder Firma wählbar noch Speichern möglich ist, erscheint eine
// Meldung mit dem direkten Weg zur Firmen-Anlage.
$this->hasCompanies = $context->companyCountFor($user) > 0;
if (! $this->hasCompanies) {
return;
}
$firstCompany = $context->selectedCompany($user) ?? $context->latestCompaniesFor($user, 1)->first();
if ($firstCompany) {
@ -711,6 +723,33 @@ new #[Layout('components.layouts.app'), Title('Neue Pressemitteilung')] class ex
</div>
</header>
@if (! $hasCompanies)
{{-- ============== KEINE FIRMA: MELDUNG STATT FORMULAR ============== --}}
<article class="panel">
<div class="p-8 flex flex-col items-center text-center gap-4">
<div class="w-14 h-14 rounded-[6px] flex items-center justify-center
bg-[color:var(--color-hub-soft)] border border-[color:var(--color-hub-soft-2)] text-[color:var(--color-hub)]">
<flux:icon.building-office class="size-6" />
</div>
<div class="space-y-1 max-w-[520px]">
<h2 class="text-[16px] font-semibold text-[color:var(--color-ink)] m-0">
{{ __('Ohne Firma kann keine Pressemitteilung angelegt werden.') }}
</h2>
<p class="text-[13px] leading-[1.55] text-[color:var(--color-ink-2)] m-0">
{{ __('Jede Pressemitteilung erscheint im Namen einer Firma. Bitte legen Sie zuerst eine Firma an — danach können Sie hier direkt loslegen.') }}
</p>
</div>
<div class="flex flex-wrap items-center justify-center gap-2 pt-1">
<flux:button variant="primary" icon="plus" href="{{ route('me.press-kits.create') }}" wire:navigate>
{{ __('Firma anlegen') }}
</flux:button>
<flux:button variant="filled" href="{{ route('me.press-releases.index') }}" wire:navigate>
{{ __('Zur PM-Übersicht') }}
</flux:button>
</div>
</div>
</article>
@else
{{-- ============== 2-COLUMN GRID ============== --}}
<div class="grid gap-6 pr-editor-layout">
@ -952,7 +991,7 @@ new #[Layout('components.layouts.app'), Title('Neue Pressemitteilung')] class ex
{{ __('Boilerplate aus Firma') }}
</span>
</span>
<flux:checkbox
<flux:switch
wire:model.live="useBoilerplateOverride"
:label="__('Für diese PM überschreiben')"
/>
@ -1334,4 +1373,5 @@ new #[Layout('components.layouts.app'), Title('Neue Pressemitteilung')] class ex
:confirm-label="__('Zur Prüfung senden')"
:quota-total="$quotaTotal"
:quota-remaining="$quotaRemaining" />
@endif
</div>

View file

@ -901,7 +901,7 @@ new #[Layout('components.layouts.app'), Title('Pressemitteilung bearbeiten')] cl
{{ __('Boilerplate aus Firma') }}
</span>
</span>
<flux:checkbox
<flux:switch
wire:model.live="useBoilerplateOverride"
:label="__('Für diese PM überschreiben')"
/>