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

@@ -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