Files
nhgooi.nl/resources/views/partial/programitems.blade.php
2025-07-15 15:45:09 +02:00

68 lines
2.7 KiB
PHP
Executable File

<?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($programs as $program)
<?php $url = route('programma') . $program->program->url; ?>
<?php $endStartDiff = $program->end->diff($program->start);
$duration = 24 * $endStartDiff->d + $endStartDiff->h; ?>
<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="{{$program->program->name}}">{!!$program->program->name!!}</a>
</h2>
@if($program->current)
<ul class="post_tags">
<li><a href="{{route('luister.live')}}" class="onair player" title="Nu live!">Nu live!</a></li>
</ul>
@else
<div class="sub_title">
<?php $time = Formatter::relativeDate($program->start) . (isset($showTime) && $showTime ? ' om ' . $program->start->format('H:i') : ''); ?>
<span class="post_date" title="{{$time}}">
<i class="fa-regular fa-clock"></i> {{$time}}
</span>
</div>
@endif
@if(isset($showAction) && $showAction)
<div class="row action_button" style="margin-top: 20px;">
@if(!$program->current)
<div class="col">
<a href="{{route('luister.programma') . '/' . $program->start->format('Y/m/d/H') . '/' . $duration}}"
class="player btn" style="padding: 10px 0;width: 100%;">Luister terug</a>
</div>
@endif
<div class="col">
<a href="{{route('programma') . $program->program->url}}" class="btn"
style="padding: 10px 0;width: 100%;">Meer informatie</a>
</div>
</div>
@endif
@if($body['show'])
<p class="post_body {{$body['class']}}">
{!!strip_tags($program->program->description)!!}
</p>
@endif
</div>
</li>
@endforeach
</ul>