From 2799b1843f7835b82d6f74d292e998d41852841b Mon Sep 17 00:00:00 2001 From: NH Gooi Date: Sun, 23 Jun 2024 23:18:38 +0200 Subject: [PATCH] Podcasts en lees meer... toegevoegd aan nieuwsartikelen --- public/js/main.js | 7 - resources/views/newsitem.blade.php | 28 +-- resources/views/partial/nh_story.blade.php | 181 +++++++++++------- .../views/widgets/podcastplayer.blade.php | 89 ++++----- 4 files changed, 154 insertions(+), 151 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index 6ea6ddb3..e69de29b 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -1,7 +0,0 @@ -$(function() { - $('.podcast-player').each(function() { - var id = $(this).data('id'); - var auth = $(this).data('auth'); - $(this).load('/luister/fragment/inline/' + id + '?auth=' + auth); - }); -}); diff --git a/resources/views/newsitem.blade.php b/resources/views/newsitem.blade.php index 5ec55082..6b2b81a2 100644 --- a/resources/views/newsitem.blade.php +++ b/resources/views/newsitem.blade.php @@ -47,30 +47,6 @@ - @if($news->podcast) - @include('widgets/mediaplayer') -
-
- -
- -
- @endif -
@if($news->images) @@ -119,6 +95,10 @@
@endif + @if($news->podcast) + @include('widgets/podcastplayer', ['podcast' => $news->podcast]) + @endif + @if($news->source && $news->source->show)

Bron: {{$news->source->title}}

diff --git a/resources/views/partial/nh_story.blade.php b/resources/views/partial/nh_story.blade.php index d325b421..b3ceab43 100644 --- a/resources/views/partial/nh_story.blade.php +++ b/resources/views/partial/nh_story.blade.php @@ -1,51 +1,51 @@ @foreach($content as $block) - @if($block->type == "headerRichA") - @php($block->image->url = isset($block->image->crops) - ? $block->image->crops->{'16:9'}->{'1600'} - : $block->image->crop) - - {{$block->image->title}} - -
- {{$block->image->title}} - @if($block->image->author) - {{$block->image->author}} - @endif -
- @elseif($block->type == "text") -
{!!$block->text!!}
- @if (preg_match('!/gemist/fragment/([0-9]*)/!', $block->text, $match)) -
- @endif - @elseif($block->type == "intro") -

{!!strip_tags($block->text)!!}

- @elseif($block->type == "info") - @if(strpos($block->text, "Meer nieuws uit 't Gooi?") === false) -
{!!($block->text)!!}
- @endif - @elseif($block->type == "quote") -
- {!!$block->text!!} -
{{$block->name}}
-
- @elseif($block->type == "image") - type == "headerRichA") +@php($block->image->url = isset($block->image->crops) +? $block->image->crops->{'16:9'}->{'1600'} +: $block->image->crop) + + {{$block->image->title}} + +
+ {{$block->image->title}} + @if($block->image->author) + {{$block->image->author}} + @endif +
+@elseif($block->type == "text") +
{!!$block->text!!}
+@elseif($block->type == "intro") +

{!!strip_tags($block->text)!!}

+@elseif($block->type == "info") +@if(strpos($block->text, "Meer nieuws uit 't Gooi?") === false) +
{!!($block->text)!!}
+@endif +@elseif($block->type == "quote") +
+ {!!$block->text!!} +
{{$block->name}}
+
+@elseif($block->type == "image") +image->imageWide)) - $image = $block->image->imageWide; + $image = $block->image->imageWide; else if(isset($block->image->crop)) - $image = $block->image->crop; + $image = $block->image->crop; else if(isset($block->image->crops) && isset($block->image->crops->{'16:9'})) foreach($block->image->crops->{'16:9'} as $image) break; else if(isset($block->image->imageHigh)) $image = $block->image->imageHigh; else $image = null; ?> - @if($image) - - {{$block->image->title}} - -
- image->title}} © {{$block->image->author}}"> + {{$block->image->title}} + +
+ image->caption) && $block->image->caption) { $sentence[] = '' . $block->image->caption . ''; @@ -57,52 +57,87 @@ } $sentence = join('|', $sentence); ?> - {!!$sentence!!} -
- @endif - @elseif($block->type == "video" || $block->type == "headerVideo") - @include('widgets/mediaplayer') - +@endif +@elseif($block->type == "video" || $block->type == "headerVideo") +@include('widgets/mediaplayer') +video->images[0]->imageMedia) && $block->video->images[0]->imageMedia) { $attr = ' poster="' . $block->video->images[0]->imageMedia . '"'; } ?> - -
- {{$block->video->author}} -
- @elseif($block->type == "carousel") - +@elseif($block->type == "oembed") +
{!!$block->html!!}
+@elseif($block->type == "podcast" && $block->id == $news->podcast?->id) +@include('widgets/podcastplayer', ['podcast' => $news->podcast]) +podcast = null; // Avoid adding the player again ?> +@elseif($block->type == 'article' && count($block->articles)) +
+

{{ $block->title }}

+
+
    + @foreach($block->articles as $article) + published = new \DateTime($article->published) ?> +
  • +
    + @if($article->image) +
    + + {{ $article->image_title }} + +
    + @endif +
    +

    {!! $article->title !!}

    + +
    +
    +
  • + @endforeach +
+
+
+@endif +@endforeach \ No newline at end of file diff --git a/resources/views/widgets/podcastplayer.blade.php b/resources/views/widgets/podcastplayer.blade.php index 1b31b201..00d1b3ce 100644 --- a/resources/views/widgets/podcastplayer.blade.php +++ b/resources/views/widgets/podcastplayer.blade.php @@ -1,61 +1,56 @@
-@if($podcast == null) + @if($podcast == null) De podcast kan helaas (op dit moment) niet weergegeven worden. -@else + @else @include('widgets/mediaplayer') @if ($podcast) - url . "?auth=" . $podcast->auth); $popoutUrl = route('luister.podcast') . $podcast->url . '?auth=' . $podcast->auth; ?> -
-

{{$podcast->title}}

-
- +
+

{{$podcast->title}}

+
+ - - - -
- @if($podcast->image) -
- -
- {{$podcast->image->title}} -
-
- @endif -
{!!$podcast->content!!}
-
-
- -
-
+ + +
+ @if($podcast->image) +
+ +
+ {{$podcast->image->title}}
+ @endif +
{!!$podcast->content!!}
+
- @endif -@endif +
+ @endif + @endif +
\ No newline at end of file