82 lines
5.1 KiB
PHP
82 lines
5.1 KiB
PHP
<div>
|
|
<div class="mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
|
<div>
|
|
<a href="{{ route('campagne.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>
|
|
Torna alla lista
|
|
</a>
|
|
<h1 class="text-2xl font-bold text-gray-900">{{ $campagna->descrizione }}</h1>
|
|
</div>
|
|
@can('campagne.manage')
|
|
<a href="{{ route('campagne.edit', $campagna) }}" class="btn-action btn-action-indigo" style="padding:8px 16px;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="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
|
|
</a>
|
|
@endcan
|
|
</div>
|
|
|
|
{{-- Stats --}}
|
|
<div class="grid grid-cols-1 sm:grid-cols-4 gap-4 mb-6">
|
|
<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">Periodo</p>
|
|
<p class="mt-1 text-sm font-medium text-gray-900">{{ $campagna->start_date->format('d/m/Y') }} — {{ $campagna->end_date->format('d/m/Y') }}</p>
|
|
</div>
|
|
<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($campagna->is_attiva)
|
|
<span class="inline-flex mt-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">Attiva</span>
|
|
@elseif($campagna->end_date->isPast())
|
|
<span class="inline-flex mt-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-600">Conclusa</span>
|
|
@else
|
|
<span class="inline-flex mt-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">Futura</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">Conteggiati / Assegnati</p>
|
|
<p class="mt-1 text-2xl font-bold" style="color:#6366f1">{{ $conteggiate->count() }} / {{ $assegnateNelRange }}</p>
|
|
</div>
|
|
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-4">
|
|
<p class="text-xs font-medium text-gray-500 uppercase">Percentuale</p>
|
|
<p class="mt-1 text-2xl font-bold text-gray-900">{{ $campagna->percentuale_percorrenza }}%</p>
|
|
<div class="mt-2 w-full bg-gray-200 rounded-full h-2">
|
|
<div class="bg-indigo-500 h-2 rounded-full" style="width: {{ min($campagna->percentuale_percorrenza, 100) }}%"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Counted assignments --}}
|
|
<div class="bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden">
|
|
<div class="px-4 py-3 bg-gray-50 border-b">
|
|
<h3 class="text-sm font-semibold text-gray-700">Territori Conteggiati</h3>
|
|
</div>
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-gray-200 text-sm">
|
|
<thead class="bg-gray-50">
|
|
<tr>
|
|
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500">Territorio</th>
|
|
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500">Proclamatore</th>
|
|
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500">Assegnato</th>
|
|
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500">Rientrato</th>
|
|
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500">Giorni</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100">
|
|
@forelse($conteggiate as $a)
|
|
<tr>
|
|
<td class="px-4 py-2"><a href="{{ route('territori.show', $a->territorio_id) }}" class="text-indigo-600 hover:underline">N° {{ $a->territorio?->numero }}</a></td>
|
|
<td class="px-4 py-2">{{ $a->proclamatore?->nome_completo ?? 'N/A' }}</td>
|
|
<td class="px-4 py-2">{{ $a->assigned_at->format('d/m/Y') }}</td>
|
|
<td class="px-4 py-2">{{ $a->returned_at?->format('d/m/Y') }}</td>
|
|
<td class="px-4 py-2">{{ $a->giorni }}</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="5" class="px-4 py-6 text-center text-gray-500">Nessun territorio conteggiato in questa campagna.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|