ldc-legaulois/resources/views/fo/partials/block/reduction-card.blade.php
2026-07-03 09:59:48 +02:00

51 lines
2.7 KiB
PHP

@php
use App\Enums\Block\BlockContentTypeEnum;
$pos = \App\Enums\Block\BlockPositionEnum::from($position)->toBootstrap();
$hasCta = in_array($blockType, [BlockContentTypeEnum::Cta->value, BlockContentTypeEnum::Both->value]);
$hasActu = in_array($blockType, [BlockContentTypeEnum::Actu->value, BlockContentTypeEnum::Both->value]);
@endphp
<div class="row justify-content-{{ $pos }}">
@if ($hasActu && $news)
<div class="col-12 {{ $hasCta ? 'col-md-4' : 'col-md-6' }} order-1">
<div class="news-small-card bottom-left-shadow border-0 bg-transparent">
<a class="text-decoration-none" href="{{ route('fo.news.show', $news->slug) }}"
title="{{ __('Accéder à l\'article : :name', ['name' => $news->title]) }}">
<div class="line-border-small bg-white p-3">
<div class="row align-items-center">
<div class="col-4">
<div class="ratio ratio-1x1">
<img class="object-fit-cover"
src="{{ asset($news->picture) }}"
title="{{ $news->picture_title }}"
alt="{{ $news->picture_alt }}">
</div>
</div>
<div class="col-8">
<div class="d-flex align-items-center mb-2">
<div class="news-tag text-uppercase f-bourton-base fs-5 me-3 px-2 py-1"
style="background-color: {{ $news->newsCategory->color }}; color: #fff">
{!! clean($news->newsCategory->title) !!}
</div>
<p class="f-bakerie-rough mb-0">
{{ \Carbon\Carbon::parse($news->updated_at)->format('d/m/Y') }}
</p>
</div>
<p class="text-uppercase f-bourton-base m-0">
{{ $news->title }}
</p>
</div>
</div>
</div>
</a>
</div>
</div>
@endif
@if ($hasCta && $ctaUrl && $ctaLabel)
<div class="col-12 col-md-auto order-2 order-md-1 d-flex justify-content-center justify-content-md-start align-items-center mt-3 mt-md-0">
<a href="{{ $ctaUrl }}" class="btn btn-secondary f-bourton-base w-fit">{{ $ctaLabel }}</a>
</div>
@endif
</div>