- Proclamatore::booted: reso non attivo, spostato nel cestino o anonimizzato, il sorvegliante scioglie il gruppo (territori non dati in reparto, membri liberi, utenza disattivata); il motivo va nel registro. L'elenco chiede conferma, la modifica avvisa sotto "Attivo". Un membro nel cestino esce dal gruppo. - Scheda del proclamatore: gruppo guidato con membri, pacchetto, da dare, assegnazioni dal gruppo, utenza e ultimo accesso; oppure gruppo di cui e' membro; gruppi sciolti guidati in passato. - Profilo del sorvegliante: il suo gruppo con gli stessi numeri. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
159 lines
9.2 KiB
PHP
159 lines
9.2 KiB
PHP
<div>
|
|
<div class="mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
|
<div>
|
|
<a href="{{ $ritorno ?? route('proclamatori.index') }}" class="inline-flex items-center gap-1 text-sm text-gray-500 hover:text-indigo-600 transition-colors mb-1">
|
|
<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="M15 19l-7-7 7-7"/></svg>
|
|
{{ $ritorno ? 'Torna indietro' : 'Torna alla lista' }}
|
|
</a>
|
|
<h1 class="text-2xl font-bold text-gray-900">{{ $proclamatore->nome_completo }}</h1>
|
|
</div>
|
|
@can('settings.manage')
|
|
<x-btn data-ritorno variante="secondary" :href="route('proclamatori.edit', $proclamatore)">
|
|
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><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>
|
|
Modifica
|
|
</x-btn>
|
|
@endcan
|
|
</div>
|
|
|
|
{{-- Stats --}}
|
|
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4 mb-6">
|
|
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-4 card-hover card-accent-green">
|
|
<p class="text-xs font-medium text-gray-500 uppercase">Stato</p>
|
|
@if($proclamatore->attivo)
|
|
<span class="inline-flex mt-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">Attivo</span>
|
|
@else
|
|
<span class="inline-flex mt-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-600">Inattivo</span>
|
|
@endif
|
|
</div>
|
|
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-4 card-hover card-accent-indigo">
|
|
<p class="text-xs font-medium text-gray-500 uppercase">Territori Attualmente</p>
|
|
<p class="mt-1 text-2xl font-bold" style="color:#6366f1">{{ $stats['attualmente_assegnati'] }}</p>
|
|
</div>
|
|
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-4 card-hover card-accent-blue">
|
|
<p class="text-xs font-medium text-gray-500 uppercase">Media Giorni Trattenuta</p>
|
|
<p class="mt-1 text-2xl font-bold text-gray-900">{{ $stats['media_giorni'] }} gg</p>
|
|
<p class="text-xs text-gray-500">su {{ $stats['totale_assegnazioni'] }} assegnazioni totali</p>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Gruppo di servizio --}}
|
|
@if($gruppoSorvegliato || $gruppoMembro || $gruppiPassati->isNotEmpty())
|
|
<section class="bg-white rounded-xl shadow-sm border border-gray-200 p-6 mb-6" aria-labelledby="titolo-gruppo">
|
|
<h3 id="titolo-gruppo" class="text-lg font-semibold text-gray-900 mb-3">Gruppo di servizio</h3>
|
|
|
|
@if($gruppoSorvegliato)
|
|
<p class="text-sm text-gray-700">
|
|
<span class="inline-flex px-2.5 py-0.5 rounded-full text-xs font-medium bg-purple-100 text-purple-800">Sorvegliante</span>
|
|
del gruppo
|
|
@can('settings.manage')
|
|
<a data-ritorno href="{{ route('gruppi.show', $gruppoSorvegliato) }}" class="font-semibold text-indigo-600 hover:underline">{{ $gruppoSorvegliato->nome }}</a>
|
|
@else
|
|
<strong>{{ $gruppoSorvegliato->nome }}</strong>
|
|
@endcan
|
|
dal {{ $gruppoSorvegliato->created_at->format('d/m/Y') }}
|
|
</p>
|
|
|
|
<dl class="mt-4 grid grid-cols-2 sm:grid-cols-4 gap-3">
|
|
<div class="rounded-lg bg-gray-50 px-3 py-2">
|
|
<dt class="text-xs text-gray-500">Membri</dt>
|
|
<dd class="text-xl font-bold text-gray-900">{{ $riepilogoGruppo['membri'] }}</dd>
|
|
</div>
|
|
<div class="rounded-lg bg-gray-50 px-3 py-2">
|
|
<dt class="text-xs text-gray-500">Nel pacchetto</dt>
|
|
<dd class="text-xl font-bold text-gray-900">{{ $riepilogoGruppo['pacchetto'] }}</dd>
|
|
</div>
|
|
<div class="rounded-lg bg-gray-50 px-3 py-2">
|
|
<dt class="text-xs text-gray-500">Da dare</dt>
|
|
<dd class="text-xl font-bold text-gray-900">{{ $riepilogoGruppo['da_dare'] }}</dd>
|
|
</div>
|
|
<div class="rounded-lg bg-gray-50 px-3 py-2">
|
|
<dt class="text-xs text-gray-500">Assegnazioni dal gruppo</dt>
|
|
<dd class="text-xl font-bold text-gray-900">{{ $riepilogoGruppo['assegnazioni'] }}</dd>
|
|
</div>
|
|
</dl>
|
|
|
|
@if($utenza)
|
|
<p class="mt-4 border-t border-gray-100 pt-3 text-sm text-gray-600">
|
|
Utenza
|
|
@can('settings.manage') <code>{{ $utenza->email }}</code> @endcan
|
|
· {{ $utenza->password_change_required ? 'password temporanea, ancora da cambiare' : 'password personale impostata' }}
|
|
· {{ $ultimoAccesso ? 'ultimo accesso il ' . \Illuminate\Support\Carbon::parse($ultimoAccesso)->format('d/m/Y H:i') : 'non è ancora entrato' }}
|
|
</p>
|
|
@endif
|
|
@elseif($gruppoMembro)
|
|
<p class="text-sm text-gray-700">
|
|
Membro del gruppo
|
|
@can('settings.manage')
|
|
<a data-ritorno href="{{ route('gruppi.show', $gruppoMembro) }}" class="font-semibold text-indigo-600 hover:underline">{{ $gruppoMembro->nome }}</a>,
|
|
@else
|
|
<strong>{{ $gruppoMembro->nome }}</strong>,
|
|
@endcan
|
|
sorvegliante {{ $gruppoMembro->sorvegliante?->nome_completo ?? '—' }}.
|
|
</p>
|
|
@endif
|
|
|
|
@if($gruppiPassati->isNotEmpty())
|
|
<p class="{{ $gruppoSorvegliato || $gruppoMembro ? 'mt-3' : '' }} text-xs text-gray-500">
|
|
In passato sorvegliante di:
|
|
@foreach($gruppiPassati as $g)
|
|
{{ $g->nome }} (sciolto il {{ $g->sciolto_at->format('d/m/Y') }}){{ $loop->last ? '.' : ',' }}
|
|
@endforeach
|
|
</p>
|
|
@endif
|
|
</section>
|
|
@endif
|
|
|
|
{{-- Assignment history --}}
|
|
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-6">
|
|
<h3 class="text-lg font-semibold text-gray-900 mb-4">Storico Assegnazioni</h3>
|
|
|
|
@forelse($assegnazioniPerAnno as $annoLabel => $assegnazioni)
|
|
<div class="mb-6">
|
|
<h4 class="text-sm font-semibold text-indigo-600 mb-2">Anno Teocratico {{ $annoLabel }}</h4>
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-gray-200 text-sm table-cards">
|
|
<thead class="bg-gray-50">
|
|
<tr>
|
|
<th class="px-3 py-2 text-left text-xs font-medium text-gray-500">Territorio</th>
|
|
<th class="px-3 py-2 text-left text-xs font-medium text-gray-500">Assegnato</th>
|
|
<th class="px-3 py-2 text-left text-xs font-medium text-gray-500">Rientrato</th>
|
|
<th class="px-3 py-2 text-left text-xs font-medium text-gray-500">Giorni</th>
|
|
<th class="px-3 py-2 text-left text-xs font-medium text-gray-500">Campagna</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100">
|
|
@foreach($assegnazioni as $assegnazione)
|
|
<tr>
|
|
<td data-label="Territorio" class="px-3 py-2">
|
|
<a data-ritorno href="{{ route('territori.show', $assegnazione->territorio_id) }}" class="text-indigo-600 hover:underline">
|
|
{{ $assegnazione->territorio?->numero ?? 'N/A' }}
|
|
</a>
|
|
</td>
|
|
<td data-label="Assegnato" class="px-3 py-2">{{ $assegnazione->assigned_at->format('d/m/Y') }}</td>
|
|
<td data-label="Rientrato" class="px-3 py-2">
|
|
@if($assegnazione->returned_at)
|
|
{{ $assegnazione->returned_at->format('d/m/Y') }}
|
|
@else
|
|
<span class="text-amber-600 font-medium">In corso</span>
|
|
@endif
|
|
</td>
|
|
<td data-label="Giorni" class="px-3 py-2">{{ $assegnazione->giorni }}</td>
|
|
<td data-label="Campagna" class="px-3 py-2">
|
|
@if($assegnazione->counted_in_campaign)
|
|
<span class="text-green-600">{{ $assegnazione->campagna?->descrizione }}</span>
|
|
@else
|
|
<span class="text-gray-400">-</span>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
@empty
|
|
<p class="text-gray-500 text-sm">Nessuna assegnazione registrata.</p>
|
|
@endforelse
|
|
</div>
|
|
</div>
|