Uitgelicht podcast [#00028]

This commit is contained in:
NH Gooi
2024-09-12 14:06:28 +02:00
parent 5ebf7f20be
commit 6d91e1d3ca
3 changed files with 26 additions and 12 deletions

View File

@@ -22,13 +22,9 @@ class HomeController extends Controller
$populair[] = new \Model\NewsItem($newsItem);
}
$podcasts = [];
$apiResult = $this->API('podcast/overzicht?aantal=3');
$podcast = new \Model\Podcast($apiResult->podcasts[0]);
foreach ($apiResult->podcasts as $_podcast) {
$podcasts[] = new \Model\Podcast($_podcast);
}
return view('home', ['populair' => $populair, 'podcasts' => $podcasts, 'podcast' => $podcast, 'title' => 'Home', 'news' => $news, 'searchURL' => 'nieuws/zoeken']);
$apiResult = $this->API('podcast/overzicht?aantal=15');
$index = array_rand($apiResult->podcasts);
$podcast = new \Model\Podcast($apiResult->podcasts[$index]);
return view('home', ['populair' => $populair, 'podcast' => $podcast, 'title' => 'Home', 'news' => $news, 'searchURL' => 'nieuws/zoeken']);
}
}

View File

@@ -1231,7 +1231,8 @@ div.pp_default .pp_close:hover {
.post_container .post_body h3 {
font-size: 15px;
}
.post_container .post_body .sentence {
.post_container .post_body .sentence,
.box.featured .sentence {
font-size: 12px;
font-style: italic;
line-height: 1.3;
@@ -1240,7 +1241,8 @@ div.pp_default .pp_close:hover {
display: block;
width: 100%;
}
.post_container .post_body .sentence span {
.post_container .post_body .sentence span,
.box.featured .sentence span {
padding: 0 5px;
}
.post_container .post_body blockquote {

View File

@@ -170,12 +170,28 @@
@if ($podcast)
<?php $url = route('gemist.fragment') . $podcast->url; ?>
<h4 class="box_header"><span>Uitgelicht</span></h4>
<h4 class="box_header"><span>Uitgelicht fragment</span></h4>
<div class="box featured">
<div class="row">
<div class="col-12 col-md-6">
<a href="{{$url}}" title="{{$podcast->title}}">
<img src="{{$podcast->image && $podcast->image->url ? $imgBase . $podcast->image->url : '/images/noimage.png'}}"/>
<img src="{{($hasImage = $podcast->image && $podcast->image->url) ? $imgBase . $podcast->image->url : '/images/noimage.png'}}"/>
<div class="sentence">
<?php
$sentence = [];
if ($hasImage) {
$sentence[] = '<span class="text">' . $podcast->image->title . '</span>';
} elseif (isset($podcast->image->title) && $podcast->image->title) {
$sentence[] = '<span class="text">' . $podcast->image->title . '</span>';
}
if (isset($podcast->image->author) && $podcast->image->author) {
$sentence[] = '<span class="author">' . $podcast->image->author . '</span>';
}
$sentence = join('<span class="separator">|</span>', $sentence);
?>
{!!$sentence!!}
</div>
</a>
</div>
<div class="col-12 col-md-6">