193 lines
13 KiB
PHP
Executable File
193 lines
13 KiB
PHP
Executable File
<x-filament-panels::page>
|
|
<div class="space-y-6">
|
|
@if(! $this->stabileAttivo)
|
|
<div class="rounded-xl border border-amber-300 bg-amber-50 p-4 text-sm text-amber-800">
|
|
Nessuno stabile attivo disponibile. Seleziona prima uno stabile per aprire l'hub assemblee.
|
|
</div>
|
|
@else
|
|
<!-- Header & Stats -->
|
|
<div class="rounded-xl border bg-white p-5 shadow-sm">
|
|
<div class="flex flex-wrap items-center justify-between gap-4">
|
|
<div>
|
|
<div class="text-xl font-bold text-slate-900">{{ $this->stabileAttivo->denominazione ?: 'Stabile attivo' }}</div>
|
|
<div class="mt-1 text-xs text-slate-500">
|
|
HUB Assemblee Condominiali: gestisci l'Ordine del Giorno, invia convocazioni con token WhatsApp, effettua check-in e ricevi voti in tempo reale.
|
|
</div>
|
|
</div>
|
|
<div class="flex items-center space-x-3">
|
|
<button wire:click="creaNuovaAssemblea" class="inline-flex items-center px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white rounded-lg text-xs font-bold shadow-md transition-all active:scale-95">
|
|
<i class="fas fa-plus mr-1.5"></i> Nuova Assemblea
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Stats Row -->
|
|
<div class="grid gap-4 md:grid-cols-4">
|
|
<div class="rounded-xl border bg-white p-4 shadow-xs">
|
|
<div class="text-xs font-semibold uppercase tracking-wider text-slate-400">Assemblee totali</div>
|
|
<div class="mt-2 text-3xl font-bold text-slate-800">{{ (int) ($this->stats['totale'] ?? 0) }}</div>
|
|
</div>
|
|
<div class="rounded-xl border bg-white p-4 shadow-xs">
|
|
<div class="text-xs font-semibold uppercase tracking-wider text-slate-400">Convocate</div>
|
|
<div class="mt-2 text-3xl font-bold text-amber-600">{{ (int) ($this->stats['convocate'] ?? 0) }}</div>
|
|
</div>
|
|
<div class="rounded-xl border bg-white p-4 shadow-xs">
|
|
<div class="text-xs font-semibold uppercase tracking-wider text-slate-400">In calendario</div>
|
|
<div class="mt-2 text-3xl font-bold text-blue-600">{{ (int) ($this->stats['in_calendario'] ?? 0) }}</div>
|
|
</div>
|
|
<div class="rounded-xl border bg-white p-4 shadow-xs">
|
|
<div class="text-xs font-semibold uppercase tracking-wider text-slate-400">Con verbale</div>
|
|
<div class="mt-2 text-3xl font-bold text-emerald-600">{{ (int) ($this->stats['con_verbale'] ?? 0) }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tab buttons -->
|
|
<div class="flex gap-2">
|
|
<button
|
|
type="button"
|
|
wire:click="$set('tab','elenco')"
|
|
class="inline-flex items-center rounded-lg border px-4 py-2 text-sm font-semibold transition-all
|
|
{{ ($tab ?? 'elenco') === 'elenco' ? 'border-primary-300 bg-primary-50 text-primary-700 shadow-sm' : 'border-gray-200 bg-white text-gray-700 hover:bg-gray-50' }}"
|
|
>
|
|
<i class="fas fa-list-ul mr-2"></i> Assemblee Stabile
|
|
</button>
|
|
<button
|
|
type="button"
|
|
wire:click="$set('tab','sospesi')"
|
|
class="inline-flex items-center rounded-lg border px-4 py-2 text-sm font-semibold transition-all
|
|
{{ ($tab ?? 'elenco') === 'sospesi' ? 'border-primary-300 bg-primary-50 text-primary-700 shadow-sm' : 'border-gray-200 bg-white text-gray-700 hover:bg-gray-50' }}"
|
|
>
|
|
<i class="fas fa-pause mr-2 text-amber-500"></i> Punti OdG Sospesi
|
|
@php
|
|
$sospesiCount = count($this->sospesiRows);
|
|
@endphp
|
|
@if($sospesiCount > 0)
|
|
<span class="ml-2 rounded-full bg-amber-100 px-2 py-0.5 text-xs font-bold text-amber-800">{{ $sospesiCount }}</span>
|
|
@endif
|
|
</button>
|
|
</div>
|
|
|
|
@if(($tab ?? 'elenco') === 'elenco')
|
|
<!-- Elenco cronologico in tabella full-width -->
|
|
<div class="rounded-xl border bg-white shadow-sm overflow-hidden">
|
|
<div class="px-6 py-4 border-b">
|
|
<h3 class="text-sm font-bold text-slate-800 uppercase tracking-wider flex items-center"><i class="fas fa-history mr-2 text-blue-500"></i>Cronologia assemblee dello stabile</h3>
|
|
</div>
|
|
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full text-left border-collapse text-xs">
|
|
<thead>
|
|
<tr class="bg-slate-100 text-slate-700 font-bold uppercase border-b text-[10px] tracking-wider">
|
|
<th class="p-4">Assemblea / Tipo</th>
|
|
<th class="p-4">Data 1ª Convocazione</th>
|
|
<th class="p-4">Data 2ª Convocazione</th>
|
|
<th class="p-4">Luogo</th>
|
|
<th class="p-4 text-center">Stato</th>
|
|
<th class="p-4 text-center">OdG</th>
|
|
<th class="p-4 text-center">Convocati</th>
|
|
<th class="p-4 text-center">Presenti</th>
|
|
<th class="p-4 text-center">Azioni</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y">
|
|
@forelse($this->assembleeRows as $assemblea)
|
|
<tr class="hover:bg-slate-50/50">
|
|
<td class="p-4 font-bold text-slate-900 capitalize">
|
|
Assemblea {{ $assemblea->tipo ?: 'Ordinaria' }}
|
|
</td>
|
|
<td class="p-4 text-slate-600">
|
|
{{ $assemblea->data_prima_convocazione ? $assemblea->data_prima_convocazione->format('d/m/Y H:i') : 'n/d' }}
|
|
</td>
|
|
<td class="p-4 text-slate-600 font-semibold">
|
|
{{ $assemblea->data_seconda_convocazione ? $assemblea->data_seconda_convocazione->format('d/m/Y H:i') : 'n/d' }}
|
|
</td>
|
|
<td class="p-4 text-slate-500">
|
|
{{ \Illuminate\Support\Str::limit($assemblea->luogo ?: 'Presso uffici', 40) }}
|
|
</td>
|
|
<td class="p-4 text-center">
|
|
<span class="text-[9px] font-extrabold uppercase px-2 py-0.5 rounded {{ $assemblea->stato === 'convocata' ? 'bg-amber-100 text-amber-700 border border-amber-200' : ($assemblea->stato === 'svolta' ? 'bg-emerald-100 text-emerald-700 border border-emerald-200' : 'bg-slate-100 text-slate-700 border border-slate-200') }}">
|
|
{{ $assemblea->stato ?: 'Bozza' }}
|
|
</span>
|
|
</td>
|
|
<td class="p-4 text-center font-bold text-slate-800">{{ (int)$assemblea->ordine_giorno_count }}</td>
|
|
<td class="p-4 text-center font-bold text-slate-800">{{ (int)$assemblea->convocazioni_count }}</td>
|
|
<td class="p-4 text-center font-bold text-slate-800">{{ (int)$assemblea->presenze_count }}</td>
|
|
<td class="p-4 text-center flex items-center justify-center space-x-2">
|
|
<a href="{{ \App\Filament\Pages\Condomini\GestioneAssemblea::getUrl(['record' => $assemblea->id]) }}" class="px-2.5 py-1.5 bg-blue-50 text-blue-700 border border-blue-200 hover:bg-blue-100 rounded-lg text-xxs font-bold transition flex items-center">
|
|
<i class="fas fa-cog mr-1"></i> Gestisci
|
|
</a>
|
|
<button onclick="confirm('Vuoi eliminare questa assemblea?') && @this.eliminaAssemblea({{ $assemblea->id }})" class="px-2.5 py-1.5 bg-red-50 text-red-700 border border-red-200 hover:bg-red-100 rounded-lg text-xxs font-bold transition">
|
|
<i class="fas fa-trash-alt"></i>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="9" class="p-8 text-center text-slate-400 italic">
|
|
Nessuna assemblea registrata per questo stabile. Clicca su "Nuova Assemblea" per crearne una.
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
@elseif(($tab ?? 'elenco') === 'sospesi')
|
|
<!-- Punti Sospesi List -->
|
|
<div class="rounded-xl border bg-white shadow-sm overflow-hidden">
|
|
<div class="px-6 py-4 border-b bg-amber-50/50">
|
|
<h3 class="text-sm font-bold text-slate-800 uppercase tracking-wider flex items-center">
|
|
<i class="fas fa-pause mr-2 text-amber-500"></i>
|
|
Punti Ordine del Giorno Sospesi o non deliberati
|
|
</h3>
|
|
</div>
|
|
|
|
<div class="p-6 space-y-4">
|
|
@if(empty($this->sospesiRows) || count($this->sospesiRows) === 0)
|
|
<div class="rounded-xl border border-dashed p-10 text-center text-slate-500 text-xs">
|
|
Nessun punto all'Ordine del Giorno sospeso o rimandato rilevato per lo stabile attivo.
|
|
</div>
|
|
@else
|
|
<div class="grid gap-4 md:grid-cols-2">
|
|
@foreach($this->sospesiRows as $sPunto)
|
|
<div class="border rounded-xl p-4 bg-white hover:bg-slate-50/50 flex flex-col justify-between">
|
|
<div>
|
|
<div class="flex items-center justify-between gap-3">
|
|
<span class="inline-flex items-center px-2 py-0.5 rounded text-[10px] font-bold bg-amber-100 text-amber-800 border border-amber-200">
|
|
{{ str_replace('_', ' ', $sPunto->esito_votazione ?: 'sospeso') }}
|
|
</span>
|
|
<span class="text-slate-400 text-xxs font-mono">ID: #{{ $sPunto->id }}</span>
|
|
</div>
|
|
<h4 class="text-sm font-bold text-slate-900 mt-2">{{ $sPunto->titolo }}</h4>
|
|
<p class="text-xs text-slate-500 mt-1">{{ $sPunto->descrizione }}</p>
|
|
|
|
<div class="mt-4 flex flex-wrap gap-2 text-[10px] text-slate-500">
|
|
@if($sPunto->articolo_legge)
|
|
<span><i class="fas fa-gavel mr-1"></i>{{ $sPunto->articolo_legge }}</span>
|
|
@endif
|
|
@if($sPunto->maggioranza_richiesta)
|
|
<span><i class="fas fa-balance-scale mr-1"></i>{{ $sPunto->maggioranza_richiesta }}</span>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@endif
|
|
@endif
|
|
</div>
|
|
|
|
<script>
|
|
document.addEventListener('notify', (e) => {
|
|
if (typeof Filament !== 'undefined' && Filament.notify) {
|
|
Filament.notify(e.detail.status, e.detail.message);
|
|
} else {
|
|
alert(e.detail.message);
|
|
}
|
|
});
|
|
</script>
|
|
</x-filament-panels::page> |