@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: @if($gruppo->diocesi->count() > 0) @foreach($gruppo->diocesi as $diocesi) {{ $diocesi->nome }} @endforeach @else - @endif
Anno Fondazione: {{ $gruppo->anno_fondazione ?? '-' }}
@if($gruppo->gruppoContatti->count() > 0) @endif
Responsabili: @php $responsabili = $gruppo->getResponsabili() @endphp @if($responsabili->count() > 0) @foreach($responsabili as $resp) {{ $resp->nome_completo }}
@endforeach @else - @endif
Email: {{ $gruppo->email_primaria ?? '-' }}
Telefono: {{ $gruppo->telefono_primario ?? '-' }}
Altri Contatti: @foreach($gruppo->gruppoContatti as $contatto) @if(!$contatto->is_primary || ($contatto->tipo !== 'email' && $contatto->tipo !== 'telefono' && $contatto->tipo !== 'cellulare'))
@if($contatto->etichetta){{ $contatto->etichetta }}:@endif {{ $contatto->valore }}
@endif @endforeach
@php $incontroEvento = $gruppo->eventi->where('is_incontro_gruppo', true)->first(); @endphp

Statistiche

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

Membri

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

Sottogruppi

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) Mappa @endif
@if($incontroEvento)

Giorno di Incontro

@if($incontroEvento->ora_inizio) @endif
Evento: {{ $incontroEvento->nome_evento }}
Quando: @if($incontroEvento->tipo_recorrenza === 'settimanale') {{ $incontroEvento->giorno_settimana_label }} Sett. @elseif($incontroEvento->tipo_recorrenza === 'mensile') {{ $incontroEvento->occorrenza_mensile_label }} Mens. @elseif($incontroEvento->tipo_recorrenza === 'annuale') {{ $incontroEvento->mese_annuale_label }} Ann. @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)
Resp.: @foreach($incontroEvento->responsabili as $resp)
{{ $resp->cognome }} {{ $resp->nome }} @if($resp->telefono_primario)
{{ $resp->telefono_primario }} @endif
@endforeach @endif
@endif

Avatar

@if($gruppo->avatar_url) {{ $gruppo->nome }}
@else
@endif
@csrf
@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 }} @if($child->diocesi->count() > 0)@foreach($child->diocesi as $dio){{ $dio->nome }}@endforeach @else -@endif {{ $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