Podcasts en fragment gemist gescheiden

This commit is contained in:
NH Gooi
2024-07-02 17:23:50 +02:00
parent 50d6a97fce
commit e7bae27951
8 changed files with 53 additions and 37 deletions

View File

@@ -29,7 +29,7 @@ class PodcastController extends Controller
$podcasts[] = new \Model\Podcast($podcast);
}
return view($request->ajax() ? 'partial.podcastitems' : 'podcastseries', array_merge($viewData, ['podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken']));
return view($request->ajax() ? 'partial.podcastitems' : 'podcastseries', array_merge($viewData, ['podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken', 'isPodcast' => true]));
}
public function podcast(Request $request, $id)
@@ -37,6 +37,15 @@ class PodcastController extends Controller
parent::registerView($request, 'podcast', $id);
$apiResult = $this->API('podcast/details/' . (int)$id);
$podcast = new \Model\Podcast($apiResult);
return view('podcastitem', ['podcast' => $podcast, 'metadata' => $podcast->metadata]);
$podcasts = [];
if($podcast->program) {
$apiResult = $this->API('podcast/programma/' . (int)$podcast->program->id . '?pagina=1&aantal=5');
$podcasts = [];
foreach($apiResult->podcasts as $p)
{
$podcasts[] = new \Model\Podcast($p);
}
}
return view('podcastitem', ['podcast' => $podcast, 'metadata' => $podcast->metadata, 'podcasts' => $podcasts, 'isPodcast' => true]);
}
}

View File

@@ -56,7 +56,7 @@ class RadioController extends Controller
public function podcast(Request $request, $id, $title = '')
{
if($this->checkAPI('podcast/details/' . (int)$id) != "200"){
return view('podcastitem', array_merge($this->getSidebareData(), ['title' => $title, 'podcast' => null, 'metadata' => null, 'related' => [], 'searchURL' => 'gemist/zoeken']));
return view('podcastitem', array_merge($this->getSidebareData(), ['title' => $title, 'podcast' => null, 'metadata' => null, 'related' => [], 'searchURL' => 'gemist/zoeken', 'isPodcast' => false]));
}
parent::registerView($request, 'podcast', $id);
@@ -71,7 +71,7 @@ class RadioController extends Controller
$podcasts[] = new \Model\Podcast($_podcast);
}
return view($request->ajax() ? 'partial/podcastitems' : 'podcastitem', ['title' => $title, 'podcast' => $podcast, 'metadata' => $podcast->metadata, 'podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken']);
return view($request->ajax() ? 'partial/podcastitems' : 'podcastitem', ['title' => $title, 'podcast' => $podcast, 'metadata' => $podcast->metadata, 'podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken', 'isPodcast' => false]);
}
public function podcasts(Request $request, $programma = null)
@@ -107,7 +107,7 @@ class RadioController extends Controller
}
}
return view($request->ajax() ? 'partial/programitems' : 'programlist', ['programs' => array_reverse($programs)]);
return view($request->ajax() ? 'partial/programitems' : 'programlist', ['programs' => array_reverse($programs), 'isPodcast' => false]);
}
private function getPodcastList(Request $request, $action, $viewData = [])
@@ -120,7 +120,7 @@ class RadioController extends Controller
$podcasts[] = new \Model\Podcast($podcast);
}
return view($request->ajax() ? 'partial/podcastitems' : 'podcastlist', array_merge($viewData, ['id' => 'items-podcasts', 'podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken']));
return view($request->ajax() ? 'partial/podcastitems' : 'podcastlist', array_merge($viewData, ['id' => 'items-podcasts', 'podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken', 'isPodcast' => false]));
}
}

View File

@@ -1,7 +1,7 @@
<div>
@foreach($podcasts as $podcast)
<?php
$url = route('gemist.fragment') . $podcast->url;
$url = ($isPodcast ? '/podcast/aflevering' : '/gemist/fragment') . $podcast->url;
$popoutUrl = route('luister.podcast') . $podcast->url . '?auth=' . $podcast->auth;
?>
<div class="box full-width featured">
@@ -15,7 +15,7 @@
<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 }}"
<a class="program_name" href="/{{ ($isPodcast ? 'podcast' : 'programma') . $podcast->program->url }}"
title="{{$podcast->program->name}}">{{$podcast->program->name}}</a>
@endif
<span class="post_date" title="{{Formatter::relativeDate($podcast->created)}}">

View File

@@ -20,7 +20,7 @@ $actionButton = array_merge([
?>
<ul id="{{$id ?? ''}}" class="{{$ul['class']}}">
@foreach($podcasts as $podcast)
<?php $url = route('gemist.fragment') . $podcast->url; ?>
<?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">

View File

@@ -4,9 +4,11 @@
@section('title')
@if($podcast)
Fragment gemist
{{ $podcast->title }}
@elseif($isPodcast)
NH Gooi Podcast
@else
Fragment {{$title}} niet gevonden
Fragment gemist
@endif
@endsection
@@ -18,14 +20,18 @@
<ul class="bread_crumb">
<li><a title="Home" href="/">Home</a></li>
<li class="separator"><i class="fa-solid fa-chevron-right"></i></li>
<li><a title="Fragment gemist" href="{{route('gemist')}}">Fragment gemist</a></li>
@if($isPodcast)
<li>NH Gooi podcast</li>
@else
<li><a title="Home" href="/gemist/fragment">Fragment gemist</a></li>
@endif
<li class="separator"><i class="fa-solid fa-chevron-right"></i></li>
@if($podcast && $podcast->program)
<li><a title="{{$podcast->program->name}}"
href="{{route('gemist.programma') . $podcast->program->url}}">{{$podcast->program->name}}</a></li>
<li class="separator"><i class="fa-solid fa-chevron-right"></i></li>
@endif
<li>Fragment</li>
<li>{{ $podcast->title }}</li>
</ul>
@endsection
@@ -91,7 +97,6 @@
<div class="row news_post">
<div class="col-12 col-md content_container">
<div class="box full-width post single small_image md_margin_top">
<h1 class="page_title">{{$podcast->title}}</h1>
<div class="post_body">
<ul class="post_details clearfix">
<li class="detail date">
@@ -100,7 +105,7 @@
</li>
@if($podcast->program)
<li class="detail author">
<a href="{{ route('programma') . $podcast->program->url }}">{{ $podcast->program->name }}</a>
<a href="/{{ ($isPodcast ? 'podcast' : 'programma') . $podcast->program->url }}">{{ $podcast->program->name }}</a>
</li>
@endif
</ul>
@@ -150,15 +155,15 @@
<div data-tabs>
<div class="tabs">
<h4 data-tab-content-id="tab_more_fragmenten"
class="box_header small flex-grow-1 active"><span>Meer fragmenten</span>
class="box_header small flex-grow-1 active"><span>Meer {{$isPodcast ? 'afleveringen' : 'fragmenten'}}</span>
</h4>
</div>
<div id="tab_more_fragmenten" class="box tab_content podcast_items active">
@include('partial/podcastitems', ['id' => 'items-podcasts', 'showTime' => false, 'showImage' => false, 'podcasts' => $podcasts])
@include('partial/podcastitems', ['id' => 'items-podcasts', 'showTime' => false, 'showImage' => false, 'podcasts' => $podcasts, 'isPodcast' => $isPodcast])
<a class="btn auto_width" id="meer-nieuws-more-podcast" href="#"
data-loadmorenews='{"container":["#items-podcasts"]}'>
<span class="fas fa-spinner fa-spin" id="loading"></span>
Meer fragmenten
Meer {{$isPodcast ? 'afleveringen' : 'fragmenten'}}
</a>
</div>
</div>

View File

@@ -79,7 +79,8 @@
'class' => 'd-flex flex-column justify-content-end flex-grow-1'
],
'showAction' => true,
'podcasts' => array_slice($podcasts, 0, 8)])
'podcasts' => array_slice($podcasts, 0, 8),
'isPodcast' => $isPodcast])
</div>
@else
@@ -98,7 +99,7 @@
</h4>
</div>
<div id="tab_more_fragmenten" class="box tab_content podcast_items active">
@include('partial/podcastitems', ['id' => 'items-podcasts', 'showTime' => false, 'showImage' => false, 'podcasts' => array_slice($podcasts, 8)])
@include('partial/podcastitems', ['id' => 'items-podcasts', 'showTime' => false, 'showImage' => false, 'podcasts' => array_slice($podcasts, 8), 'isPodcast' => $isPodcast])
<a class="btn auto_width" id="meer-nieuws-more-podcast" href="#"
data-loadmorenews='{"container":["#items-podcasts"]}'>
<span class="fas fa-spinner fa-spin" id="loading"></span>

View File

@@ -1,7 +1,11 @@
@extends('layouts/full')
@section('title')
Fragment gemist
@if(isset($program))
{{ $program->name }}
@else
NH Gooi Podcast
@endif
@endsection
@section('page_class')
@@ -12,14 +16,12 @@
<ul class="bread_crumb ">
<li><a title="Home" href="/">Home</a></li>
<li class="separator"><i class="fa-solid fa-chevron-right"></i></li>
<li><a title="Fragment gemist" href="{{route('gemist')}}">Fragment gemist</a></li>
<li class="separator"><i class="fa-solid fa-chevron-right"></i></li>
<li>NH Gooi podcast</li>
@if(isset($program))
<li><a title="{{$program->name}}"
href="{{route('gemist.programma') . $program->url}}">{{$program->name}}</a></li>
<li class="separator"><i class="fa-solid fa-chevron-right"></i></li>
<li><a title="{{$program->name}}"
href="/podcast{{$program->url}}">{{$program->name}}</a></li>
@endif
<li>Fragmenten</li>
</ul>
@endsection
@@ -28,8 +30,7 @@
<div class="row news_post">
<div class="col-12 col-md content_container md_padding_top_80">
@if(isset($program))
<div class="box full-width post single">
<h1 class="page_title">{{$program->name}}</h1>
<div class="no-box full-width post single">
<div class="post_body">
<div class="content_box clearfix section_margin_top">
<div class="post_content page_margin_top_section ">
@@ -43,12 +44,12 @@
<div class="page_layout clearfix">
<div class="grid" id="items">
@include('partial/podcastdirectitems', ['podcasts' => array_slice($podcasts, 0, 2)])
@include('partial/podcastdirectitems', ['podcasts' => array_slice($podcasts, 0, 2), 'isPodcast' => $isPodcast])
</div><!--/.row-->
</div>
@else
<div class="box full-width">
<p class="page_body">Er zijn geen fragmenten beschikbaar.</p>
<p class="page_body">Er zijn geen items beschikbaar.</p>
</div>
@endif
</div>
@@ -62,7 +63,7 @@
</h4>
</div>
<div id="tab_more_fragmenten" class="box tab_content podcast_items active">
@include('partial/podcastitems', ['id' => 'items-podcasts', 'showTime' => false, 'showImage' => false, 'podcasts' => array_slice($podcasts, 2)])
@include('partial/podcastitems', ['id' => 'items-podcasts', 'showTime' => false, 'showImage' => false, 'podcasts' => array_slice($podcasts, 2), 'isPodcast' => $isPodcast])
<a class="btn auto_width" id="meer-nieuws-more-podcast" href="#"
data-loadmorenews='{"container":["#items-podcasts"]}'>
<span class="fas fa-spinner fa-spin" id="loading"></span>

View File

@@ -67,7 +67,7 @@ Route::get('/gemist/fragment/{id}/{title}', 'RadioController@podcast')->where(['
Route::get('/gemist/programma', 'RadioController@terugluisteren')->name('gemist.programma');
Route::get('/gemist/programma/{programma}/{title}', 'RadioController@podcasts')->where(['programma' => '\d+']);
Route::get('/podcast/{programma}/{title}', 'PodcastController@podcasts')->where(['programma' => '\d+']);
Route::get('/podcast/{programma}/{title}', 'PodcastController@podcasts')->where(['programma' => '\d+'])->name('podcast.overzicht');
Route::get('/podcast/fragment/{id}/{title}', 'RadioController@podcast')->where(['id' => '\d+', 'title' => '.*']);
Route::get('/podcast/aflevering/{id}/{title}', 'PodcastController@podcast')->where(['id' => '\d+']);
Route::get('/podcast/zoeken/{query}', 'RadioController@searchpodcast')->name('gemist.zoeken');