This commit is contained in:
2026-07-21 23:39:19 +02:00
commit b33b217bdb
217 changed files with 32076 additions and 0 deletions

View File

@@ -0,0 +1,102 @@
<div style="flex:1;display:flex;flex-direction:column">
<x-topbar />
<div class="page-pad" style="flex:1;padding:28px;display:flex;flex-direction:column;gap:20px;max-width:920px;width:100%;margin:0 auto;box-sizing:border-box">
<div style="display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap">
<h2 style="margin:0">Zgłoszenie w imieniu klienta</h2>
<a href="{{ route('operator.queue') }}" wire:navigate class="btn btn-ghost">&larr; Wróć do listy</a>
</div>
<div class="card" style="padding:16px 20px">
<div class="field" style="margin:0">
<label>Klient</label>
<select class="input" wire:model="customerId">
<option value="">Wybierz klienta</option>
@foreach ($this->clients as $cl)
<option value="{{ $cl->id }}">{{ $cl->name }} ({{ $cl->email }})</option>
@endforeach
</select>
@error('customerId') <span style="color:var(--color-danger);font-size:12px">{{ $message }}</span> @enderror
</div>
</div>
<div style="display:flex;align-items:flex-start;justify-content:center;padding:4px 8px">
@foreach (['Dział', 'Kategoria', 'Szczegóły'] as $i => $label)
@php $n = $i + 1; @endphp
<div style="display:flex;align-items:center;flex:none">
<div class="wizard-step" style="display:flex;flex-direction:column;align-items:center;gap:6px">
<div style="width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:13px;flex:none;border:1.5px solid {{ $n <= $step ? 'var(--color-accent)' : 'var(--color-divider)' }};background:{{ $n < $step ? 'var(--color-accent-700)' : 'transparent' }};color:{{ $n < $step ? 'var(--color-accent-100)' : ($n === $step ? 'var(--color-accent)' : 'color-mix(in srgb, var(--color-text) 50%, transparent)') }}">{{ $n }}</div>
<div style="font-size:11px;text-align:center">{{ $label }}</div>
</div>
@if (! $loop->last)
<div class="wizard-connector" style="height:1px;margin:15px 8px 0;background:{{ $n < $step ? 'var(--color-accent)' : 'var(--color-divider)' }}"></div>
@endif
</div>
@endforeach
</div>
@if ($step === 1)
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px">
@foreach ($this->categories as $category)
<div class="card elev-sm" style="padding:20px;gap:10px;cursor:pointer" wire:click="selectCategory({{ $category->id }})">
<div style="width:40px;height:40px;border-radius:50%;background:var(--color-accent-700);color:var(--color-accent-100);display:flex;align-items:center;justify-content:center;font-size:16px">{{ mb_strtoupper(mb_substr($category->name, 0, 1)) }}</div>
<span class="card-title">{{ $category->name }}</span>
<p class="card-body">{{ $category->description }}</p>
<span class="card-meta">{{ $category->subcategories->count() }} podkategorie</span>
</div>
@endforeach
</div>
@elseif ($step === 2)
<div style="display:flex;flex-direction:column;gap:10px">
<button type="button" class="btn btn-ghost" style="align-self:flex-start;padding:0" wire:click="backToCategory">&larr; Zmień kategorię</button>
@foreach ($this->selectedCategory?->subcategories ?? [] as $sub)
<div class="card elev-sm" style="padding:16px;flex-direction:row;align-items:center;justify-content:space-between;gap:12px;cursor:pointer" wire:click="selectSubcategory({{ $sub->id }})">
<div>
<div style="font-weight:500">{{ $sub->name }}</div>
<div class="card-meta">{{ $sub->description }}</div>
</div>
<span class="text-muted" style="font-size:18px">&rarr;</span>
</div>
@endforeach
</div>
@elseif ($step === 3)
<form wire:submit="submit" class="card elev-md" style="padding:24px;gap:16px">
<div style="display:flex;justify-content:space-between;align-items:center">
<span class="tag tag-outline">{{ $this->selectedCategory?->name }} / {{ $this->selectedSubcategory?->name }}</span>
<button type="button" class="btn btn-ghost" style="padding:0" wire:click="backToSubcategory">Zmień</button>
</div>
<div class="field">
<label>Temat</label>
<input class="input" wire:model="subject">
@error('subject') <span style="color:var(--color-danger);font-size:12px">{{ $message }}</span> @enderror
</div>
<div class="field">
<label>Treść</label>
<textarea class="input" wire:model="body"></textarea>
@error('body') <span style="color:var(--color-danger);font-size:12px">{{ $message }}</span> @enderror
</div>
@foreach ($this->selectedSubcategory?->customFields ?? [] as $field)
<x-custom-field-input :field="$field" wire-model="customValues" />
@endforeach
<div class="field">
<label>Załączniki</label>
<div style="border:1px dashed var(--color-divider);border-radius:8px;padding:14px;display:flex;flex-wrap:wrap;align-items:center;gap:10px">
<label class="btn btn-secondary" style="cursor:pointer">Wybierz pliki<input type="file" multiple style="display:none" wire:model="attachments"></label>
@forelse ($attachments as $i => $file)
<span class="text-muted" style="font-size:13px;display:flex;align-items:center;gap:6px">
{{ $file->getClientOriginalName() }}
<span class="material-symbols-outlined" style="font-size:16px;cursor:pointer;opacity:0.7" wire:click="removeAttachment({{ $i }})">close</span>
</span>
@empty
<span class="text-muted" style="font-size:13px">Brak plików</span>
@endforelse
</div>
@error('attachments') <span style="color:var(--color-danger);font-size:12px">{{ $message }}</span> @enderror
</div>
<button class="btn btn-primary btn-block" type="submit">Utwórz zgłoszenie</button>
</form>
@endif
</div>
</div>