79 lines
5.1 KiB
PHP
79 lines
5.1 KiB
PHP
<x-filament-panels::page>
|
|
<div class="space-y-6">
|
|
<div class="rounded-xl border bg-white p-4">
|
|
<div class="flex items-center justify-between gap-2">
|
|
<div>
|
|
<h2 class="text-base font-semibold">Gestione Post-it chiamate</h2>
|
|
<p class="text-sm text-gray-500">Vista dedicata allo storico e alle conversioni in ticket.</p>
|
|
</div>
|
|
<a href="{{ $this->getPostItInserimentoUrl() }}" class="inline-flex items-center rounded-md bg-indigo-700 px-3 py-1.5 text-xs font-medium text-white hover:bg-indigo-600">Vai a Inserimento Post-it</a>
|
|
</div>
|
|
</div>
|
|
|
|
@if(! $this->isPostItTableReady())
|
|
<div class="rounded-xl border border-amber-300 bg-amber-50 p-4 text-sm text-amber-800">
|
|
Tabella chiamate non pronta. Esegui le migrazioni per usare la gestione Post-it.
|
|
</div>
|
|
@else
|
|
<div class="rounded-xl border bg-white p-4">
|
|
<h2 class="mb-3 text-base font-semibold">Storico chiamate recenti</h2>
|
|
|
|
<div class="space-y-3">
|
|
@forelse($this->recenti as $riga)
|
|
<div class="rounded-lg border p-3">
|
|
<div class="flex flex-wrap items-center justify-between gap-2">
|
|
<div>
|
|
<div class="font-medium">{{ $riga->oggetto ?: 'Senza oggetto' }}</div>
|
|
<div class="text-sm text-gray-600">
|
|
{{ $riga->nome_chiamante ?: 'Chiamante non identificato' }}
|
|
@if($riga->telefono)
|
|
- {{ $riga->telefono }}
|
|
@endif
|
|
@if($riga->stabile)
|
|
- {{ $riga->stabile->denominazione ?: ('Stabile #' . $riga->stabile->id) }}
|
|
@endif
|
|
</div>
|
|
</div>
|
|
<div class="text-xs text-gray-500">{{ optional($riga->chiamata_il)->format('d/m/Y H:i') }}</div>
|
|
</div>
|
|
|
|
<div class="mt-2 text-sm text-gray-700 whitespace-pre-wrap">{{ $riga->nota }}</div>
|
|
|
|
<div class="mt-3 flex flex-wrap gap-2">
|
|
<span class="rounded-md bg-gray-100 px-2 py-1 text-xs">{{ $riga->priorita }}</span>
|
|
<span class="rounded-md bg-blue-100 px-2 py-1 text-xs text-blue-800">{{ $riga->stato }}</span>
|
|
<span class="rounded-md bg-amber-100 px-2 py-1 text-xs text-amber-800">{{ str_replace('_', ' ', (string) $riga->direzione) }}</span>
|
|
@if($riga->esito)
|
|
<span class="rounded-md bg-emerald-100 px-2 py-1 text-xs text-emerald-800">{{ $riga->esito }}</span>
|
|
@endif
|
|
|
|
@if(!$riga->ticket_id && $riga->stato !== 'chiusa')
|
|
<x-filament::button size="sm" color="primary" wire:click="convertiInTicket({{ $riga->id }})">Converti in ticket</x-filament::button>
|
|
@endif
|
|
|
|
@if($riga->stato !== 'chiusa')
|
|
<x-filament::button size="sm" color="gray" wire:click="chiudiPostIt({{ $riga->id }})">Chiudi</x-filament::button>
|
|
@endif
|
|
|
|
@php($ticketClosed = $riga->ticket && in_array((string) $riga->ticket->stato, ['Chiuso', 'Risolto'], true))
|
|
@if($riga->stato === 'chiusa' || $ticketClosed)
|
|
<div class="flex flex-wrap items-center gap-2 rounded-md border bg-slate-50 px-2 py-1">
|
|
<input type="text" wire:model.defer="riaperturaNote.{{ (int) $riga->id }}" class="w-56 rounded-md border-gray-300 text-xs" placeholder="Nota riapertura (opzionale)" />
|
|
<x-filament::button size="sm" color="warning" wire:click="riapriPostIt({{ (int) $riga->id }})">Riapri post-it/ticket</x-filament::button>
|
|
</div>
|
|
@endif
|
|
|
|
@if($riga->ticket_id)
|
|
<a href="{{ \App\Filament\Pages\Supporto\TicketGestione::getUrl(panel: 'admin-filament') }}#ticket-{{ (int) $riga->ticket_id }}" class="inline-flex items-center rounded-md border px-3 py-1 text-xs">Apri Ticket (#{{ $riga->ticket_id }})</a>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@empty
|
|
<div class="rounded-lg border border-dashed p-4 text-sm text-gray-500">Nessuna chiamata registrata.</div>
|
|
@endforelse
|
|
</div>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</x-filament-panels::page>
|