From 6d91e1d3ca56ff203b09f55ccb710b5cb4df1e38 Mon Sep 17 00:00:00 2001 From: NH Gooi Date: Thu, 12 Sep 2024 14:06:28 +0200 Subject: [PATCH] Uitgelicht podcast [#00028] --- app/Http/Controllers/HomeController.php | 12 ++++-------- public/css/style.css | 6 ++++-- resources/views/home.blade.php | 20 ++++++++++++++++++-- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index f54d5ff0..668adff1 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -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']); } } diff --git a/public/css/style.css b/public/css/style.css index 1e7a9005..c4e245a6 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -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 { diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index ab06f92f..0065330f 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -170,12 +170,28 @@ @if ($podcast) url; ?> -

Uitgelicht

+

Uitgelicht fragment