ldc-groupe/resources/views/components/front/text-block.blade.php

116 lines
6.8 KiB
PHP

@php
global $chirkashi;
$borders = [];
@endphp
@if (empty($textBlock['hide_block']))
<div @class([
'textblock fw fw-container',
'textblock_bg' => !empty($textBlock['bg']) && $textBlock['bg'] == 1,
$custom_class ?? '',
$addclass ?? '',
])>
<div class="textblock__wrapper wrapper">
@if (!empty($textBlock['title']) || !empty($textBlock['subtitle']['text']))
<x-front.sections.title :title="isset($textBlock['title']) ? $textBlock['title'] : ''" :subtitle="isset($textBlock['subtitle']['text']) ? $textBlock['subtitle']['text'] : ''" />
@endif
@if (!empty($textBlock['description']) || !empty($textBlock['description']['text']))
<div class="textblock__container">
<div class="textblock__info textblock__block">
<div class="textblock__info-description description">
<p>
{!! $textBlock['description']['text'] !!}
</p>
</div>
@if (!empty($textBlock['description']['button']) || empty($textBlock['description']['button']['url']))
<x-front.cta title="{{ $textBlock['description']['button']['title'] }}"
url="{{ $textBlock['description']['button']['url'] }}"
target="{{ $textBlock['description']['button']['target'] }}"
class="textblock__info-btn btn"
buttonIcon="{{ $textBlock['description']['button']['button_icon'] }}"
:download="$textBlock['description']['button']['button_icon'] == 'btn__icon_dl'" />
@endif
</div>
</div>
@endif
@if (!empty($textBlock['list']))
@foreach ($textBlock['list'] as $l)
<div @class([
'textblock__container',
'textblock__container_swap' => $l['swap_position'] == 1,
'textblock__container_row' => $l['in_row'] == 1,
'textblock__container_floated' => $l['floated'] == 1,
'textblock__container_ac' => $l['align_center'] == 1,
'textblock__container_side' =>
$l['swap_position'] != 1 &&
$l['in_row'] != 1
])>
@if (!empty($l['image']) || !empty($l['video']))
<div class="textblock__image textblock__block image-content-size">
@if (!empty($l['video']))
<x-front.sections.video :video="[
'type_video' => $l['video']['type_video'],
'video' => $l['video']['video'],
]" />
@endif
@if (!empty($l['image']))
@foreach ($l['image'] as $i)
<div class="image-border-wrap ">
@php
$borders['desktop'] = $l['borders_desktop'];
$borders['mobile'] = $l['borders_mobile'];
@endphp
<x-front.borders :borders="$borders" />
<img src="{{ asset($i['url']) }}"
alt="{{ !empty($l['title']) ? $l['title'] : (!empty($textBlock['title']) ? $textBlock['title'] : '') }}" />
</div>
@endforeach
@endif
@if (!empty($l['image_description']))
<div class="textblock__image-description description">{{ $l['image_description'] }}
</div>
@endif
@if (
!empty($l['button']['url']) &&
($l['button']['title'] == 'Nous Rejoindre' ||
(!empty($custom_class) ? $custom_class : null) == 'notre-politique'))
<x-front.cta title="{{ $l['button']['title'] }}" url="{{ $l['button']['url'] }}"
target="{{ $l['button']['target'] }}" class="textblock__info-btn btn"
buttonIcon="{{ $l['button_icon'] }}" :download="$l['button_icon'] == 'btn__icon_dl'" />
@endif
</div>
@endif
<div class="textblock__info textblock__block">
@if (!empty($l['title']))
<h3 class="textblock__info-title subtitle">{{ $l['title'] }}</h3>
@endif
@if (!empty($l['text']))
<div @class([
'textblock__info-description description',
'quote__text' => $l['quote'] == 1,
])>
@if ($l['quote'] == 1)
{{ strip_tags($l['text']) }}
@else
{!! $l['text'] !!}
@endif
</div>
@endif
@if (!empty($l['quote_author']) && $l['quote'] == 1)
<div class="textblock__info-author quote__author">{{ $l['quote_author'] }}</div>
@endif
@if (
!empty($l['button']['url']) &&
$l['button']['title'] != 'Nous Rejoindre' &&
(!empty($custom_class) ? $custom_class : null) != 'notre-politique')
<x-front.cta title="{{ $l['button']['title'] }}" url="{{ $l['button']['url'] }}"
target="{{ $l['button']['target'] }}" class="textblock__info-btn btn"
buttonIcon="{{ $l['button_icon'] }}" :download="$l['button_icon'] == 'btn__icon_dl'" />
@endif
</div>
</div>
@endforeach
@endif
</div>
</div>
@endif