++ fix: aggiornamento dipendenze e correzione bug

This commit is contained in:
2026-04-12 18:07:59 +00:00
parent 9f9a3666c1
commit 5e98423e7a
13 changed files with 311 additions and 25 deletions

View File

@@ -8,7 +8,7 @@
<p class="text-sm text-gray-500 mt-1">Questa funzione consente un'assegnazione arbitraria, indipendente dalle tre schede della Home.</p>
</div>
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-4 sm:p-6 max-w-2xl">
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-4 sm:p-6 max-w-3xl">
<form wire:submit="save" class="space-y-4">
<div>
@if(!$preselectedTerritorioId)
@@ -74,4 +74,54 @@
</div>
</form>
</div>
{{-- Elenco territori attualmente assegnati con link --}}
@if($assegnazioniAperte->count())
<div class="bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden mt-10">
<div class="px-5 py-4 border-b flex items-center gap-3" style="background:linear-gradient(135deg,#eef2ff,#e0e7ff);border-color:#c7d2fe">
<div class="h-8 w-8 rounded-lg flex items-center justify-center" style="background:#6366f1">
<svg class="h-4 w-4 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"/></svg>
</div>
<div>
<h3 class="text-sm font-semibold" style="color:#3730a3">Territori Assegnati ({{ $assegnazioniAperte->count() }})</h3>
<p class="text-xs" style="color:#4f46e5">Per ogni territorio è visibile il link da condividere</p>
</div>
</div>
<div class="divide-y divide-gray-100">
@foreach($assegnazioniAperte as $a)
@php($pdfUrl = $a->temporaryPdfViewerUrl())
<div class="px-5 py-4 hover:bg-indigo-50/30 transition-colors">
<div class="flex items-center justify-between gap-4">
<div class="flex items-center gap-4">
<a href="{{ route('territori.show', $a->territorio_id) }}" class="text-indigo-600 hover:underline font-semibold text-sm">N° {{ $a->territorio?->numero }}</a>
<span class="text-xs text-gray-400">{{ $a->territorio?->zona?->nome }}</span>
</div>
<div class="flex items-center gap-5 text-sm">
<span class="text-gray-700">{{ $a->proclamatore?->nome_completo ?? 'N/A' }}</span>
<span class="text-gray-400">{{ $a->assigned_at->format('d/m/Y') }}</span>
<span class="text-xs font-medium {{ $a->giorni > 120 ? 'text-red-600' : ($a->giorni > 90 ? 'text-amber-600' : 'text-gray-500') }}">{{ $a->giorni }}g</span>
</div>
</div>
@if($pdfUrl)
<div x-data="{ copied: false }" class="mt-2 flex items-center gap-2">
<code class="flex-1 min-w-0 text-xs bg-gray-50 border border-gray-200 rounded-md px-3 py-2 text-gray-600 break-all select-all cursor-text" x-on:click="window.getSelection().selectAllChildren($el)">{{ $pdfUrl }}</code>
<button type="button"
x-on:click="
const text = $el.closest('div').querySelector('code').textContent;
navigator.clipboard.writeText(text).then(() => { copied = true; setTimeout(() => copied = false, 2000) });
"
class="flex-none btn-action btn-action-indigo" title="Copia link" style="padding:6px 10px">
<svg x-show="!copied" 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="M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"/></svg>
<svg x-show="copied" x-cloak class="h-4 w-4 text-green-600" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/></svg>
</button>
<span x-show="copied" x-cloak class="flex-none text-xs text-green-600 font-medium">Copiato!</span>
</div>
@else
<p class="mt-2 text-xs text-gray-300">Nessun PDF disponibile</p>
@endif
</div>
@endforeach
</div>
</div>
@endif
</div>

View File

@@ -90,6 +90,11 @@
<h3 class="text-sm font-semibold" style="color:#166534">Da Assegnare</h3>
<p class="text-xs" style="color:#15803d">Prima i prioritari, poi i territori con più tempo in reparto</p>
</div>
@hasanyrole('amministratore|assistente')
<button wire:click="downloadPdfDaAssegnare" title="Scarica PDF" class="ml-auto btn-action btn-action-green" style="padding:6px 10px">
<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 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg>
</button>
@endhasanyrole
</div>
<ul class="divide-y divide-gray-100">
@forelse($territoriDaAssegnare as $t)
@@ -121,7 +126,7 @@
</ul>
@if($territoriDaAssegnare->count() >= $homeLimit)
<div class="px-5 py-3 border-t text-center" style="background:#fafafa">
<a href="{{ route('territori.index') }}?filtroStato=in_reparto" class="text-xs font-medium" style="color:#4f46e5">Vedi tutti </a>
<a href="{{ route('territori.index') }}?filterStato=in_reparto" class="text-xs font-medium" style="color:#4f46e5">Vedi tutti </a>
</div>
@endif
</div>
@@ -136,6 +141,11 @@
<h3 class="text-sm font-semibold" style="color:#991b1b">Da Rientrare</h3>
<p class="text-xs" style="color:#b91c1c">Territori assegnati da più tempo</p>
</div>
@hasanyrole('amministratore|assistente')
<button wire:click="downloadPdfDaRientrare" title="Scarica PDF" class="ml-auto btn-action btn-action-red" style="padding:6px 10px">
<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 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg>
</button>
@endhasanyrole
</div>
<ul class="divide-y divide-gray-100">
@forelse($daRientrare as $t)
@@ -163,7 +173,7 @@
</ul>
@if($daRientrare->count() >= $homeLimit)
<div class="px-5 py-3 border-t text-center" style="background:#fafafa">
<a href="{{ route('territori.index') }}?filtroStato=da_rientrare" class="text-xs font-medium" style="color:#4f46e5">Vedi tutti </a>
<a href="{{ route('territori.index') }}?filterStato=da_rientrare" class="text-xs font-medium" style="color:#4f46e5">Vedi tutti </a>
</div>
@endif
</div>

View File

@@ -45,7 +45,9 @@
<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-semibold text-gray-600 uppercase cursor-pointer">Territorio</th>
<th wire:click="sortBy('territorio_numero')" class="px-3 py-3 text-left text-xs font-semibold text-gray-600 uppercase cursor-pointer">
Territorio @if($sortField==='territorio_numero') <span style="color:#6366f1">{{ $sortDirection==='asc'?'▲':'▼' }}</span> @endif
</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
@@ -99,22 +101,6 @@
@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="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="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
@if($temporaryPdfUrl)
<a href="{{ $temporaryPdfUrl }}"
target="_blank"

View File

@@ -28,6 +28,13 @@
@error('congregazione_nome') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror
</div>
<div>
<label for="public_base_url" class="block text-sm font-medium text-gray-700">URL Pubblico (dominio)</label>
<p class="text-xs text-gray-500 mb-1">L'indirizzo con cui l'app è raggiungibile dall'esterno (es. https://territori.miacongregazione.it). Se vuoto, verrà usato l'URL corrente del server.</p>
<input wire:model="public_base_url" type="url" id="public_base_url" placeholder="https://esempio.com" class="mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 text-sm">
@error('public_base_url') <p class="text-red-500 text-xs mt-1">{{ $message }}</p> @enderror
</div>
<div>
<label for="giorni_giacenza_da_assegnare" class="block text-sm font-medium text-gray-700">Soglia Da Assegnare (giorni)</label>
<p class="text-xs text-gray-500 mb-1">Dopo quanti giorni dal rientro un territorio compare nella lista "da assegnare".</p>