@extends('layouts.adminlte') @section('title', 'Dettaglio Gruppo') @section('page_title', 'Dettaglio Gruppo') @php $canWriteGruppi = Auth::user()->canManage('gruppi'); $canDeleteGruppi = Auth::user()->canDelete('gruppi'); @endphp @section('breadcrumbs') @endsection @section('content') @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif

{{ $gruppo->nome }}

Path: {{ $gruppo->full_path }}
Gruppo Padre: @if($gruppo->parent) {{ $gruppo->parent->nome }} @else Gruppo radice @endif
Diocesi: {{ $gruppo->diocesi?->nome ?? '-' }}
Responsabili: @php $responsabili = $gruppo->getResponsabili() @endphp @if($responsabili->count() > 0) @foreach($responsabili as $resp) {{ $resp->nome_completo }}
@endforeach @else - @endif

Luogo Incontro

Indirizzo: {{ $gruppo->indirizzo_incontro ?: '-' }}
CAP: {{ $gruppo->cap_incontro ?: '-' }}
Città: {{ $gruppo->città_incontro ?: '-' }} {{ $gruppo->sigla_provincia_incontro ? "({$gruppo->sigla_provincia_incontro})" : '' }}
@if($gruppo->mappa_posizione) Visualizza su mappa @endif

Statistiche

{{ $gruppo->individui->count() }}

Membri

{{ $gruppo->children->count() }}

Sottogruppi

Avatar

@if($gruppo->avatar_url) {{ $gruppo->nome }}
@else
@endif
@csrf
@php $incontroEvento = $gruppo->eventi->where('is_incontro_gruppo', true)->first(); @endphp @if($incontroEvento)

Giorno di Incontro

@if($incontroEvento->ora_inizio) @endif
Evento: {{ $incontroEvento->nome_evento }}
Quando: @if($incontroEvento->tipo_recorrenza === 'settimanale') {{ $incontroEvento->giorno_settimana_label }} Settimanale @elseif($incontroEvento->tipo_recorrenza === 'mensile') {{ $incontroEvento->occorrenza_mensile_label }} @if($incontroEvento->mesi_recorrenza) ({{ $incontroEvento->mesi_recorrenza_label }}) @endif Mensile @elseif($incontroEvento->tipo_recorrenza === 'annuale') {{ $incontroEvento->mese_annuale_label }} @if($incontroEvento->giorno_mese) , giorno {{ $incontroEvento->giorno_mese }} @endif Annuale @elseif($incontroEvento->tipo_recorrenza === 'altro') {{ $incontroEvento->giorno_settimana_label }} Altro @else {{ $incontroEvento->data_specifica?->format('d/m/Y') ?: '-' }} @endif
Ora: ore {{ $incontroEvento->ora_inizio->format('H:i') }}
@if($incontroEvento->responsabili->count() > 0)
Responsabili: @foreach($incontroEvento->responsabili as $resp)
{{ $resp->cognome }} {{ $resp->nome }} @if($resp->telefono_primario)
{{ $resp->telefono_primario }} @endif
@endforeach @endif
@endif @if($gruppo->descrizione)

Descrizione

{!! nl2br(e($gruppo->descrizione)) !!}

@endif

Tag

@forelse($gruppo->tags as $tag) {{ $tag->name }} @empty

Nessun tag assegnato.

@endforelse

Membri ({{ $gruppo->individui->count() }})

@if($gruppo->individui->count() > 0) @foreach($gruppo->individui as $individuo) @endforeach
Codice Nome Completo Email Telefono Ruolo Data Adesione Azioni
{{ $individuo->codice_id }} {{ $individuo->cognome }} {{ $individuo->nome }} {{ $individuo->email_primaria ?? '-' }} {{ $individuo->telefono_primario ?? '-' }} @php $ruoloIds = $individuo->pivot->ruolo_ids ? json_decode($individuo->pivot->ruolo_ids, true) : []; $ruoli = \App\Models\Ruolo::findByIds($ruoloIds); @endphp @if($ruoli->count() > 0) @foreach($ruoli as $ruolo) {{ $ruolo->nome }} @endforeach @else - @endif @if($individuo->pivot->data_adesione) {{ \Carbon\Carbon::parse($individuo->pivot->data_adesione)->format('d/m/Y') }} @else - @endif
@else

Nessun membro

@endif

Documenti ({{ $gruppo->documenti->count() }})

@if($canWriteGruppi) @endif
@if($gruppo->documenti->count() > 0) @foreach($gruppo->documenti as $documento) @endforeach
Nome Tipologia Dimensione Data Upload Azioni
{{ $documento->nome_file }} {{ ucfirst(str_replace('_', ' ', $documento->tipologia)) }} {{ number_format($documento->dimensione / 1024, 1) }} KB {{ $documento->created_at->format('d/m/Y') }} @if($documento->file_path) @endif
@else

Nessun documento

@endif

Sottogruppi ({{ $gruppo->children->count() }})

Aggiungi Sottogruppo
@if($gruppo->children->count() > 0) @foreach($gruppo->children->sortBy('nome') as $child) @endforeach
Nome Diocesi Responsabile Membri Azioni
{{ $child->nome }} {{ $child->diocesi?->nome ?? '-' }} {{ $child->getResponsabili()->isNotEmpty() ? $child->getResponsabili()->first()->nome_completo : '-' }} @if($child->individui()->count() > 0) {{ $child->individui()->count() }} @else - @endif @if($canWriteGruppi) @endif @if($canDeleteGruppi)
@csrf @method('DELETE')
@endif
@else

Nessun sottogruppo

@endif
@if($canWriteGruppi) Modifica @endif @if($canDeleteGruppi)
@csrf @method('DELETE')
@endif Torna all'elenco
@endsection @section('scripts') @endsection