diff --git a/website/app/Http/Controllers/Controller.php b/website/app/Http/Controllers/Controller.php index efb4f6f8..97d8af6b 100644 --- a/website/app/Http/Controllers/Controller.php +++ b/website/app/Http/Controllers/Controller.php @@ -17,7 +17,7 @@ class Controller extends BaseController protected $API_URL; - private function getDataFromFileAndConvert($file, $path, $class) + private function getDataFromFileAndConvert($file, $path, $class, $maxItems = 0) { $data = json_decode(Storage::disk('local')->get($file)); foreach($path as $subobject) { $data = $data->$subobject; } @@ -25,6 +25,7 @@ class Controller extends BaseController foreach($data as $item_data) { $items[] = new $class($item_data); + if($maxItems && count($items) == $maxItems) { break; } } return $items; @@ -33,6 +34,7 @@ class Controller extends BaseController public function __construct() { View::share('apiUrl', $this->API_URL = env('API_URL', 'http://api.6fm.nl/')); + //View::share('onAir', file_get_contents(url('onair'))); View::composer('widgets.laatstenieuws', function($view) { $view->with('data', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem')); }); @@ -55,6 +57,11 @@ class Controller extends BaseController View::composer('widgets.laatstepodcasts', function($view) { $view->with('data', $this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast')); }); + View::composer('widgets.menu', function($view) { + $view->with('news', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem')) + ->with('popular', $this->getDataFromFileAndConvert('populair_nieuws.json', [], '\Model\NewsItem', 3)) + ->with('podcasts', $this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast')); + }); } protected function registerView(Request $request, $type, $id) diff --git a/website/app/Http/Controllers/RadioController.php b/website/app/Http/Controllers/RadioController.php index e346948b..dc0902fa 100644 --- a/website/app/Http/Controllers/RadioController.php +++ b/website/app/Http/Controllers/RadioController.php @@ -29,7 +29,7 @@ class RadioController extends Controller public function onair() { - return $this->API('programma/schema/onair')->current->name; + return response()->json($this->API('programma/schema/onair?nonstop=1')); } public function program($id) diff --git a/website/public/css/nhgooi.css b/website/public/css/nhgooi.css index ae6782cc..1f5b9504 100644 --- a/website/public/css/nhgooi.css +++ b/website/public/css/nhgooi.css @@ -9,12 +9,66 @@ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a } -@media screen and (max-width:479px) { +@media screen and (max-width:1069px) { .row .column { width: 100%; } + + .header .placeholder .controls li a { + width: 30px; + } + + .header .placeholder .controls li a label { + display: none; + } } +.header .placeholder { + display: block; + position: relative; + margin: 0; + padding-top: 10px; + padding-bottom: 10px; + height: 90px; +} + + .header .placeholder .title, + .header .placeholder .artist { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .header .placeholder .title { + font-weight: bold; + } + + .header .placeholder .controls { + font-size: 75%; + bottom: 0; + position: absolute; + width: 100%; + } + + .header .placeholder .controls li { + display: inline-block; + } + + .header .placeholder .controls li a { + line-height: 120%; + font-size: 80%; + color: #ABABAB; + display: block; + padding: 4px; + margin-left: 5px; + margin-right: 5px; + } + + .header .placeholder .controls li a:hover { + background-color: #E0E0E0; + transition: 500ms; + } + .page_header_left { width: auto; float: none; diff --git a/website/resources/views/layouts/master.blade.php b/website/resources/views/layouts/master.blade.php index 7f217899..b6bdc372 100644 --- a/website/resources/views/layouts/master.blade.php +++ b/website/resources/views/layouts/master.blade.php @@ -269,10 +269,33 @@
+
@@ -541,6 +564,36 @@
+
@stack('scripts')