Files
nhgooi.nl/resources/views/partial/podcastitems.blade.php
2024-09-07 10:50:40 +02:00

60 lines
2.3 KiB
PHP

<?php
$li = array_merge([
'class' => '',
'style' => ''
], $li ?? []);
$content = array_merge([
'class' => '',
'style' => '',
], $content ?? []);
$ul = array_merge([
'class' => ''
], $ul ?? []);
$body = array_merge([
'show' => false,
'class' => ''
], $body ?? []);
$actionButton = array_merge([
'class' => ''
], $actionButton ?? []);
?>
<ul id="{{$id ?? ''}}" class="{{$ul['class']}}">
@foreach($podcasts as $podcast)
<?php $url = ($isPodcast ? '/podcast/aflevering' : '/gemist/fragment') . $podcast->url; ?>
<li style="{{$li['style']}}" class="post {{$li['class']}}">
<div style="{{$content['style']}}" class="post_content {{$content['class']}}">
<h2 class="post_title">
<a href="{{$url}}" title="{{$podcast->title}}">{!!$podcast->titleWithoutProgram()!!}</a>
</h2>
<div class="sub_title">
@if ($podcast->program)
<a class="program_name" href="{{ route('programma') . $podcast->program->url }}"
title="{{$podcast->program->name}}">{{$podcast->program->name}}</a>
@endif
<?php $time = Formatter::relativeDate($podcast->created) . (isset($showTime) && $showTime ? ' om ' . $podcast->published->format('H:i') : ''); ?>
<span class="post_date"
title="{{$time}}">
<i class="fa-regular fa-clock"></i> {{$time}}
</span>
</div>
@if(isset($showImage) && $showImage && $podcast->image)
<a href="{{$url}}" title="{{$podcast->title}}" class="fixed-height">
<img src='{{$imgBase . $podcast->image->url}}' alt='{{$podcast->image->title}}'>
</a>
@endif
@if($body['show'])
<div class="post_body {{$body['class']}}">
{!!$podcast->content!!}
</div>
@endif
@if(isset($showAction) && $showAction)
<div class="action_button {{$actionButton['class']}}">
<a class="btn" href="{{$url}}">Luister fragment</a>
</div>
@endif
</div>
</li>
@endforeach
</ul>