Added radio page

This commit is contained in:
Jorit Tijsen
2024-03-13 17:44:35 +01:00
parent d445d90069
commit a0baa0230f
40 changed files with 749 additions and 610 deletions

View File

@@ -14,7 +14,7 @@
</a>
</div>
<div class="col-8">
<h2><a href="{{url($item->url)}}"
<h2 class="post_title"><a href="{{url($item->url)}}"
title="{{$item->title}}">{!!$item->title!!}</a></h2>
<?php
$time = Formatter::relativeDate($item->published) . ' om ' . $item->published->format('H:i');

View File

@@ -3,19 +3,19 @@
<?php $url = route('gemist.fragment') . $podcast->url; ?>
<li class="post">
<div class="post_content">
<h2><a href="{{$url}}" title="{{$podcast->title}}">{!!$podcast->titleWithoutProgram()!!}</a></h2>
<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 /** @var boolean $showTime **/ $time = Formatter::relativeDate($podcast->created) . ($showTime ? ' om ' . $podcast->published->format('H:i') : ''); ?>
<?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($showImage && $podcast->image)
@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>

View File

@@ -1,59 +1,29 @@
<div class="schedule">
<div class="timeslots">
<div class="date-header"></div>
@for($h = 0; $h < 24; $h += 1.0)
<div class="time-header">{{$time = gmdate("H:i", $h * 3600)}} uur</div>
@endfor
</div>
@php($date = null)
@php($hour = 0)
@php($now = new \DateTime("now"))
@foreach($schedule as $item)
@php($diff = $item['endtime']->diff($item['starttime']))
@php($duration = $diff->d * 24 + $diff->h + $diff->i / 60)
@php($isCurrent = ($now >= $item['starttime']) && ($now <= $item['endtime']))
@php($class = ($item['program']->priority < 2 ? ' special' : '')
. ($item['program']->nonstop || $item['program']->rerun ? ' non-stop' : '')
. ($isCurrent ? ' current' : ''))
@php($starttime = $item['starttime'])
@while($duration > 0)
@if(($formattedDate = Formatter::fullDate($starttime, 'W d/M')) != $date)
@if($date != null)
</div>
@endif
<div class="date-column">
<div class="date-header">{{$formattedDate}}</div>
@php($date = $formattedDate)
@php($hour = 0)
@endif
@php($durationToday = ($hour + $duration <= 24) ? $duration : (24 - $hour))
<a href="{{route('programma') . $item['program']->url}}" class="program{{$class}}" style="height: {{$durationToday * $pixelsPerHour - 2 * $border - $margin}}px;" title="{{$item['program']->name . ($item['program']->tagline ? "\n" . $item['program']->tagline : "")}}">
<div class="program-title">
@if($isCurrent) <div class="current-marker"><span>On air</span></div> @endif
{{$item['program']->name}}
</div>
<div class="program-content">
<div class="program-times"><span class="fa fa-clock"></span> {{$item['starttime']->format('H:i')}} &ndash; {{$item['endtime']->format('H:i')}}</div>
@if($item['program']->tagline)
<hr/>
<div class="tagline">{{$item['program']->tagline}}</div>
@endif
</div>
</a>
@php($hour += $durationToday)
@php($duration -= $durationToday)
@if($duration > 0)
@php($starttime->add(new \DateInterval('P1D'))->setTime(0, 0, 0))
@endif
@endwhile
@endforeach
</div>
</div>
@php($now = new \DateTime("now"))
@foreach($days as $title => $day)
<div id="tab_radio_items_{{$title}}" class="tab_content{{(!$date && $title == 'today') || ($date && $title == 'custom') ? ' active' : ''}}">
<div class="row">
@if(isset($schedule[$day]) && $schedule[$day])
@foreach($schedule[$day] as $item)
@php($isCurrent = ($now >= $item['starttime']) && ($now <= $item['endtime']))
<div class="col-3">
<a class="box full-width" href="{{route('programma') . $item['program']->url}}"
title="{{$item['program']->name . ($item['program']->tagline ? "\n" . $item['program']->tagline : "")}}">
<div class="program-title">
@if($isCurrent)
<div class="current-marker"><span>On air</span></div>
@endif
{{$item['program']->name}}
</div>
<div class="program-times"><i class="fa-regular fa-clock"></i>
{{$item['starttime']->format('H:i')}} &ndash; {{$item['endtime']->format('H:i')}}
</div>
</a>
</div>
@endforeach
@else
<div class="no-results col-12">Geen resultaten gevonden.</div>
@endif
</div>
</div>
@endforeach