++ storico assegnazioni: una tabella sola con le colonne in linea, dal piu' recente
Nelle schede di territorio e proclamatore ogni anno teocratico era una tabella a se', con le colonne dimensionate sul proprio contenuto. Ora una tabella con un'intestazione, colonne fisse, l'anno come riga di separazione (tm-riga-gruppo, titolo anche su telefono); ordine esplicito dal piu' recente. Nella scheda del proclamatore Campagna "Si'/No" e badge "via gruppo". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -101,52 +101,56 @@
|
||||
<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
|
||||
{{-- Come nella scheda del territorio: una tabella sola, colonne fisse,
|
||||
l'anno come riga di separazione (tm-riga-gruppo), dal più recente. --}}
|
||||
@if($assegnazioniPerAnno->isEmpty())
|
||||
<p class="text-gray-500 text-sm">Nessuna assegnazione registrata.</p>
|
||||
@endforelse
|
||||
@else
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full table-fixed text-sm table-cards">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th class="w-[36%] px-3 py-2 text-left text-xs font-medium text-gray-500">Territorio</th>
|
||||
<th class="w-[15%] px-3 py-2 text-left text-xs font-medium text-gray-500">Assegnato</th>
|
||||
<th class="w-[15%] px-3 py-2 text-left text-xs font-medium text-gray-500">Rientrato</th>
|
||||
<th class="w-[9%] px-3 py-2 text-right text-xs font-medium text-gray-500">Giorni</th>
|
||||
<th class="w-[25%] px-3 py-2 text-left text-xs font-medium text-gray-500">Campagna</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach($assegnazioniPerAnno as $annoLabel => $assegnazioni)
|
||||
<tbody class="divide-y divide-gray-100">
|
||||
<tr class="tm-riga-gruppo">
|
||||
<th colspan="5" scope="colgroup" class="px-3 pt-5 pb-2 text-left text-sm font-semibold text-indigo-600 bg-white">Anno Teocratico {{ $annoLabel }}</th>
|
||||
</tr>
|
||||
@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">N° {{ $assegnazione->territorio?->numero ?? 'N/A' }}</a>@if($assegnazione->gruppo_nome)<span class="ml-1 inline-flex rounded-full bg-purple-50 px-2 py-0.5 text-xs text-purple-700">via gruppo {{ $assegnazione->gruppo_nome }}</span>@endif
|
||||
</td>
|
||||
<td data-label="Assegnato" class="px-3 py-2 tabular-nums">{{ $assegnazione->assigned_at->format('d/m/Y') }}</td>
|
||||
<td data-label="Rientrato" class="px-3 py-2 tabular-nums">
|
||||
@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 text-right tabular-nums">{{ $assegnazione->giorni }}</td>
|
||||
<td data-label="Campagna" class="px-3 py-2">
|
||||
@if($assegnazione->counted_in_campaign)
|
||||
<span class="text-green-600">Sì — {{ $assegnazione->campagna?->descrizione }}</span>
|
||||
@elseif($assegnazione->counted_in_campaign === false)
|
||||
<span class="text-gray-400">No</span>
|
||||
@else
|
||||
<span class="text-gray-300">-</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user