++ fix: aggiornamento dipendenze e correzione bug

This commit is contained in:
2026-04-12 17:38:43 +00:00
parent c585979340
commit 9f9a3666c1
21 changed files with 513 additions and 225 deletions

View File

@@ -2,9 +2,8 @@
<div class="mb-6 flex items-center justify-between">
<h1 class="text-2xl font-bold text-gray-900">Registro Assegnazioni</h1>
@can('settings.manage')
<button wire:click="openCreate"
style="background:#4f46e5;color:#fff;border:none;border-radius:8px;padding:8px 18px;font-size:14px;cursor:pointer;display:inline-flex;align-items:center;gap:6px;">
<svg xmlns="http://www.w3.org/2000/svg" style="width:16px;height:16px;" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4v16m8-8H4"/></svg>
<button wire:click="openCreate" class="btn-action btn-action-indigo" style="padding:8px 18px;font-size:14px;border-radius:8px">
<svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
Nuova voce
</button>
@endcan
@@ -43,20 +42,20 @@
{{-- Table --}}
<div class="bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden">
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200 text-sm">
<thead class="bg-gray-50">
<table class="min-w-full divide-y divide-gray-200 text-sm table-striped">
<thead style="background:linear-gradient(180deg,#f9fafb,#f3f4f6)">
<tr>
<th wire:click="sortBy('territorio_id')" class="px-3 py-3 text-left text-xs font-medium text-gray-500 uppercase cursor-pointer">Territorio</th>
<th class="px-3 py-3 text-left text-xs font-medium text-gray-500 uppercase">Proclamatore</th>
<th wire:click="sortBy('assigned_at')" class="px-3 py-3 text-left text-xs font-medium text-gray-500 uppercase cursor-pointer">
Assegnato @if($sortField==='assigned_at') {{ $sortDirection==='asc'?'':'' }} @endif
<th wire:click="sortBy('territorio_id')" class="px-3 py-3 text-left text-xs font-semibold text-gray-600 uppercase cursor-pointer">Territorio</th>
<th class="px-3 py-3 text-left text-xs font-semibold text-gray-600 uppercase">Proclamatore</th>
<th wire:click="sortBy('assigned_at')" class="px-3 py-3 text-left text-xs font-semibold text-gray-600 uppercase cursor-pointer">
Assegnato @if($sortField==='assigned_at') <span style="color:#6366f1">{{ $sortDirection==='asc'?'':'' }}</span> @endif
</th>
<th wire:click="sortBy('returned_at')" class="px-3 py-3 text-left text-xs font-medium text-gray-500 uppercase cursor-pointer">
Rientrato @if($sortField==='returned_at') {{ $sortDirection==='asc'?'':'' }} @endif
<th wire:click="sortBy('returned_at')" class="px-3 py-3 text-left text-xs font-semibold text-gray-600 uppercase cursor-pointer">
Rientrato @if($sortField==='returned_at') <span style="color:#6366f1">{{ $sortDirection==='asc'?'':'' }}</span> @endif
</th>
<th class="px-3 py-3 text-left text-xs font-medium text-gray-500 uppercase">Giorni</th>
<th class="px-3 py-3 text-left text-xs font-medium text-gray-500 uppercase">Anno</th>
<th class="px-3 py-3 text-left text-xs font-medium text-gray-500 uppercase">Campagna</th>
<th class="px-3 py-3 text-left text-xs font-semibold text-gray-600 uppercase">Giorni</th>
<th class="px-3 py-3 text-left text-xs font-semibold text-gray-600 uppercase">Anno</th>
<th class="px-3 py-3 text-left text-xs font-semibold text-gray-600 uppercase">Campagna</th>
@can('settings.manage')
<th class="px-3 py-3 text-left text-xs font-medium text-gray-500 uppercase">Azioni</th>
@endcan
@@ -64,7 +63,7 @@
</thead>
<tbody class="divide-y divide-gray-100">
@forelse($assegnazioni as $a)
<tr class="hover:bg-gray-50">
<tr class="hover:bg-indigo-50/30 transition-colors">
@php($temporaryPdfUrl = !$a->returned_at ? $a->temporaryPdfViewerUrl() : null)
<td class="px-3 py-2">
<div class="flex items-center gap-2">
@@ -99,19 +98,20 @@
</td>
@can('settings.manage')
<td class="px-3 py-2 whitespace-nowrap">
<div class="flex items-center gap-1">
@can('territori.assign')
@if($a->territorio?->attivo && !$a->territorio?->assegnazioneCorrente)
<a href="{{ route('assegnazioni.assegna', ['territorioId' => $a->territorio_id]) }}"
class="inline-block text-xs font-medium text-emerald-600 hover:text-emerald-800 mr-3">
Assegna
class="btn-action btn-action-green" title="Assegna">
<svg class="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
</a>
@endif
@endcan
@can('territori.return')
@if(!$a->returned_at)
<a href="{{ route('assegnazioni.rientra', ['assegnazione' => $a->id]) }}"
class="inline-block text-xs font-medium text-red-600 hover:text-red-800 mr-3">
Rientra
class="btn-action btn-action-red" title="Rientra">
<svg class="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"/></svg>
</a>
@endif
@endcan
@@ -119,18 +119,19 @@
<a href="{{ $temporaryPdfUrl }}"
target="_blank"
rel="noopener noreferrer"
class="inline-block text-xs font-medium text-indigo-600 hover:text-indigo-800 mr-3">
PDF
class="btn-action btn-action-indigo" title="PDF">
<svg class="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"/></svg>
</a>
@endif
<button wire:click="openEdit({{ $a->id }})"
style="background:#e0e7ff;color:#4338ca;border:none;border-radius:6px;padding:4px 10px;font-size:12px;cursor:pointer;margin-right:4px;">
Modifica
class="btn-action btn-action-gray" title="Modifica">
<svg class="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/></svg>
</button>
<button wire:click="askDelete({{ $a->id }})"
style="background:#fee2e2;color:#b91c1c;border:none;border-radius:6px;padding:4px 10px;font-size:12px;cursor:pointer;">
Elimina
class="btn-action btn-action-red" title="Elimina">
<svg class="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/></svg>
</button>
</div>
</td>
@endcan
</tr>