63 lines
3.2 KiB
PHP
63 lines
3.2 KiB
PHP
{{-- Carte page “on se dévoile” : Point central = Laval + rayon = 100 km --}}
|
||
{{-- Carte page “site ” : Point central = le site + rayon = 50 km --}}
|
||
@php
|
||
$data = [
|
||
'wrapperClasses' => 'rounded-3 embed-map w-100 my-3',
|
||
'siteModelList' => $siteModelList,
|
||
'controlSliderId' => 'swiper-sites-map',
|
||
];
|
||
if (!empty($viewBox)) {
|
||
$data['coordinates'] = [
|
||
'lat' => $viewBox->lat,
|
||
'lng' => $viewBox->lng,
|
||
];
|
||
}
|
||
if (!empty($initialZoom)) {
|
||
$data['initialZoom'] = $initialZoom;
|
||
}
|
||
$colors = ['quint', 'secondary', 'sixt', 'quad'];
|
||
@endphp
|
||
<div class="leaflet-map-vue w-100 z-1" data-json='@json($data)'></div>
|
||
<div class="swiper w-100 z-2 swiper-sites-map position-absolute bottom-0 mb-4 px-2 pt-2" id="swiper-sites-map">
|
||
<div class="swiper-wrapper">
|
||
@foreach ($siteModelList as $index => $siteModel)
|
||
<div class="swiper-slide position-relative" @if (request()->route()->getName() === 'fo.sites.show' && $siteModel->slug === request()->route('site')->slug) data-indexToSlide="{{ $loop->index }}" @endif>
|
||
<div
|
||
class="d-flex map-site-widget justify-content-center align-items-stretch text-bg-white rounded-4 border-primary border-1 flex-row overflow-hidden border p-2">
|
||
<div class="d-flex align-items-center justify-content-center">
|
||
<img class="rounded-3 img-site" src="{{ asset(resize($siteModel->picture_1, 'cartoPicture')) }}"
|
||
title="{{ $siteModel->picture_1_title }}" alt="{{ $siteModel->picture_1_alt }}">
|
||
</div>
|
||
<div class="flex-grow-1 d-flex flex-column ps-3">
|
||
<div class="h4 text-uppercase fw-bold text-primary site-title">
|
||
{{ Str::limit($siteModel->name, 25, '...') }}
|
||
</div>
|
||
<div class="ck-content text-primary py-1">
|
||
{{ Str::limit(strip_tags($siteModel->description), 65, '...') }}
|
||
</div>
|
||
<div class="flex-grow-1 d-flex justify-content-between align-items-end mt-2 flex-row pb-2">
|
||
<span class="text-primary d-inline-block">
|
||
<i class="fa-solid fa-users me-2"></i>
|
||
<span>{{ $siteModel->employees }}</span>
|
||
</span>
|
||
<a class="text-bg-{{ $colors[$index % count($colors)] }} carto-link p-3"
|
||
href="{{ route('fo.sites.show', $siteModel) }}" alt="{{ __('Voir la page du site') }}">
|
||
<i class="fa fa-plus"></i>
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
@endforeach
|
||
@push('styles')
|
||
<style nonce="{{ $nonce }}">
|
||
.carto-link {
|
||
position: relative;
|
||
bottom: -1.1rem;
|
||
border-radius: 1rem 0 0 0;
|
||
right: -.5rem;
|
||
}
|
||
</style>
|
||
@endpush
|
||
</div>
|
||
</div>
|