@extends('layouts.adminlte') @section('title', 'Ricerca per Tag') @section('page_title', 'Ricerca per Tag') @section('content')

@isset($selectedTags) Risultati per: @foreach($selectedTags as $t) {{ $t->name }} @endforeach @if(count($tagSlugs) > 1) (intersezione — tutti i tag richiesti) @endif @else Seleziona uno o più tag @endisset

@if(!isset($selectedTags) || $selectedTags->isEmpty())

Clicca sui tag per selezionarli (Ctrl+click per più tag).

@foreach($allTags as $t) @endforeach @if($allTags->isEmpty())

Nessun tag disponibile. Crea i tag nelle Impostazioni.

@endif
@if($allTags->isNotEmpty())
@endif
@else
@php $indexRoutes = [ 'individui' => 'individui.index', 'gruppi' => 'gruppi.index', 'eventi' => 'eventi.index', 'documenti' => 'documenti.index', 'mailingLists' => 'mailing-liste.index', ]; $tagParams = collect($tagSlugs)->map(fn($s) => "tag[]={$s}")->implode('&'); @endphp @foreach([ ['key' => 'individui', 'color' => 'info', 'icon' => 'fa-user', 'label' => 'Individui'], ['key' => 'gruppi', 'color' => 'success', 'icon' => 'fa-users', 'label' => 'Gruppi'], ['key' => 'eventi', 'color' => 'warning', 'icon' => 'fa-calendar-alt', 'label' => 'Eventi'], ['key' => 'documenti', 'color' => 'secondary', 'icon' => 'fa-file', 'label' => 'Documenti'], ['key' => 'mailingLists', 'color' => 'purple', 'icon' => 'fa-list', 'label' => 'Mailing List'], ] as $box)
{{ $box['label'] }} {{ $totals[$box['key']] }} @if($totals[$box['key']] > 0 && isset($indexRoutes[$box['key']])) Vedi tutti » @endif
@endforeach
@php $sections = [ 'individui' => ['color' => 'info', 'icon' => 'fa-user', 'title' => 'Individui', 'cols' => ['Cognome', 'Nome', 'Email'], 'fields' => ['cognome', 'nome', 'email_primaria']], 'gruppi' => ['color' => 'success', 'icon' => 'fa-users', 'title' => 'Gruppi', 'cols' => ['Nome', 'Descrizione'], 'fields' => ['nome', 'descrizione_limit']], 'eventi' => ['color' => 'warning', 'icon' => 'fa-calendar-alt', 'title' => 'Eventi', 'cols' => ['Evento', 'Data', 'Ora'], 'fields' => ['nome_evento', 'data', 'ora']], 'documenti' => ['color' => 'secondary', 'icon' => 'fa-file', 'title' => 'Documenti', 'cols' => ['Nome File', 'Tipo'], 'fields' => ['nome_file', 'tipo']], 'mailingLists' => ['color' => 'purple', 'icon' => 'fa-list', 'title' => 'Mailing List', 'cols' => ['Nome', 'Contatti', 'Stato'], 'fields' => ['nome', 'contatti_count', 'stato']], ]; @endphp @foreach($sections as $key => $section) @if($totals[$key] > 0)
{{ $section['title'] }} ({{ $totals[$key] }})
@foreach($section['cols'] as $col)@endforeach @foreach($results[$key] as $item) @if($key === 'individui') @elseif($key === 'gruppi') @elseif($key === 'eventi') @elseif($key === 'documenti') @elseif($key === 'mailingLists') @endif @endforeach
{{ $col }}
{{ $item->cognome }} {{ $item->nome }} {{ $item->email_primaria ?? '-' }} {{ $item->nome }} {{ Str::limit($item->descrizione, 80) ?? '-' }} {{ $item->nome_evento }} {{ $item->data_specifica ? $item->data_specifica->format('d/m/Y') : ($item->tipo_recorrenza ?? '-') }} {{ $item->ora_inizio ? $item->ora_inizio->format('H:i') : '-' }} {{ $item->nome_file }} {{ $item->tipo ?? '-' }} {{ $item->nome }} {{ $item->contatti->count() }} @if($item->attiva) Attiva @else Disattiva @endif
@endif @endforeach @if(array_sum($totals) === 0)
Nessun elemento trovato con tutti i tag selezionati.
@endif @endisset
@endsection