ldc-groupe/resources/views/components/front/posts/news.blade.php
2026-03-11 09:54:40 +01:00

44 lines
2.3 KiB
PHP

@php
$locale = config('app.locale');
$isButtonStyle = Route::is("front.dynamic-pages.espace-presse.$locale");
$borders = [
'desktop' => ['left' => false, 'right' => false, 'top' => false, 'bottom' => true],
'mobile' => ['left' => false, 'right' => false, 'top' => false, 'bottom' => true],
];
@endphp
@if (!empty($newsList))
@foreach ($newsList as $news)
<div class="posts-list__item list-item" style="opacity: 1; transition: 250ms;">
<div class="list-item__image image-border-wrap image-borders">
<img src="{{ asset($news['picture']) }}" class="attachment-post-thumbnail size-post-thumbnail wp-post-image"
alt="{{ isset($news['picture_alt']) ? $news['picture_alt'] : '' }}" decoding="async" loading="lazy"
srcset="{{ asset($news['picture']) }}">
<x-front.borders :borders="!empty($borders) ? $borders : []" />
</div>
<div class="list-item__description description">
@if (isset($news->tag_labels))
<div class="list-item__tags tags">
<div class="single-news__tag tag {{ $news->first_tag_data['category_classes'] ?? '' }}">
{{ $news->tag_labels }}
</div>
</div>
@endif
<div class="list-item__title posts-list__item-title subtitle">{{ $news['title'] }}</div>
<div class="list-item__date date {{ $news->first_category_data['date_classes'] ?? 'date_no-tags' }}">
{{ $news->publishedAtFormatted() }}
</div>
<div class="list-item__text ellipsis description"></div>
@if ($isButtonStyle)
<x-front.cta title="{{ ucfirst(__('front.news.read_article')) }}" class="list-item__readmore"
url="{{ route("front.news.show", $news) }}" buttonIcon="btn__icon_arrow-right" />
@else
<a class="list-item__readmore" href="{{ route("front.news.show", $news) }}" title="{{ ucfirst(__('front.news.read_article')) }}">
{{ ucfirst(__('front.news.read_article')) }}
</a>
@endif
</div>
</div>
@endforeach
@endif