@php
$typesAffiches = ['ouvrage', 'oeuvre', 'archi', 'SPS', 'controle'];
$intervenantCount = 0;
$logoIntervenantWidth = 110;
$logoIntervenantHeight = 80;
if ($nbIntervenantsToDisplay > 0) {
$intervenantsToDisplay = $panneau->intervenants
->sortBy('numeroOrdre')
->take(min($nbIntervenantsToDisplay, 9))
->values();
} else {
$intervenantsToDisplay = $panneau->intervenants
->sortBy('numeroOrdre')
->filter(function ($intervenant) use ($typesAffiches) {
return collect($typesAffiches)->contains(function ($type) use ($intervenant) {
return Str::contains(strtolower($intervenant->type), strtolower($type));
});
})
->take(9)
->values();
}
$countIntervenants = $intervenantsToDisplay->count();
$isTwoColumns = $countIntervenants > 5;
$firstIntervenant = $intervenantsToDisplay->first();
$otherIntervenants = $intervenantsToDisplay->slice(1)->values();
if ($isTwoColumns) {
$logoIntervenantWidth = 90;
$logoIntervenantHeight = 65;
$leftColumn = $otherIntervenants->chunk((int) ceil($otherIntervenants->count() / 2))->get(0) ?? collect();
$rightColumn = $otherIntervenants->chunk((int) ceil($otherIntervenants->count() / 2))->get(1) ?? collect();
}
@endphp
{{-- 1er intervenant toujours pleine largeur --}}
@if($firstIntervenant)
@php
$intervenant = $firstIntervenant;
$intervenantCount++;
$showLogo2 = false;
$borderLightFirstIntervenant = "border-light";
// if($isTwoColumns) $borderLightFirstIntervenant = "";
if (
$intervenant->numeroOrdre == 1 &&
Str::contains(strtolower($intervenant->type), 'ouvrage') &&
!empty($intervenant->logo2)
) {
$showLogo2 = true;
}
$logoIntervenantFirst = "";
if ($isTwoColumns) $logoIntervenantFirst = "intervenant-logo-print-first";
@endphp
{{ Str::upper(Str::ascii($intervenant->type)) }}
{{ $intervenant->libelleType }}
{{ preg_replace('/(\d{2})(?=\d)/', '$1 ', $intervenant->numeroTel) }}
@if(!empty($intervenant->logo))
@endif
@if($showLogo2 && !empty($intervenant->logo2))
@endif
@endif
{{-- Si 1 à 5 intervenants : les autres restent en pleine largeur --}}
@if(!$isTwoColumns)
@foreach($otherIntervenants as $intervenant)
@php
$intervenantCount++;
$showLogo2 = false;
if (
$intervenant->numeroOrdre == 1 &&
Str::contains(strtolower($intervenant->type), 'ouvrage') &&
!empty($intervenant->logo2)
) {
$showLogo2 = true;
}
@endphp
{{ Str::upper(Str::ascii($intervenant->type)) }}
{{ $intervenant->libelleType }}
{{ preg_replace('/(\d{2})(?=\d)/', '$1 ', $intervenant->numeroTel) }}
@if(!empty($intervenant->logo))
@endif
@if($showLogo2 && !empty($intervenant->logo2))
@endif
@endforeach
@endif
{{-- Si > 5 intervenants : les autres passent en 2 colonnes --}}
@if($isTwoColumns)
@foreach($leftColumn as $intervenant)
@php
$intervenantCount++;
$showLogo2 = false;
if (
$intervenant->numeroOrdre == 1 &&
Str::contains(strtolower($intervenant->type), 'ouvrage') &&
!empty($intervenant->logo2)
) {
$showLogo2 = true;
}
@endphp
{{ Str::upper(Str::ascii($intervenant->type)) }}
{{ $intervenant->libelleType }}
{{ preg_replace('/(\d{2})(?=\d)/', '$1 ', $intervenant->numeroTel) }}
@if(!empty($intervenant->logo))
@endif
@if($showLogo2 && !empty($intervenant->logo2))
@endif
@endforeach
@foreach($rightColumn as $intervenant)
@php
$intervenantCount++;
$showLogo2 = false;
if (
$intervenant->numeroOrdre == 1 &&
Str::contains(strtolower($intervenant->type), 'ouvrage') &&
!empty($intervenant->logo2)
) {
$showLogo2 = true;
}
@endphp
{{ Str::upper(Str::ascii($intervenant->type)) }}
{{ $intervenant->libelleType }}
{{ preg_replace('/(\d{2})(?=\d)/', '$1 ', $intervenant->numeroTel) }}
@if(!empty($intervenant->logo))
@endif
@if($showLogo2 && !empty($intervenant->logo2))
@endif
@endforeach
@endif
Pour accéder à l'ensemble des informations du chantier : SCANNEZ-MOI !
@if($panneau->qrLink)
{!! \SimpleSoftwareIO\QrCode\Facades\QrCode::size($qrSize)->generate(route('qr.redirect', $panneau->qrLink->slug)) !!}
@endif
@if(($chantierInterdit || $chantierSafety))
@if($chantierInterdit)
) }})
@endif
@if($chantierSafety)
) }})
@endif
@endif