Most pages are now styled.
Small changes to existing pages. Changes to base layout style.
This commit is contained in:
@@ -2,36 +2,34 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use \Model\NewsItem;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
public function show()
|
||||
public function show(Request $request)
|
||||
{
|
||||
$apiResult = $this->API('nieuws/overzicht?aantal=12');
|
||||
$total = 10;
|
||||
$page = (int)$request->get('pagina', 1);
|
||||
$apiResult = $this->API('nieuws/overzicht?pagina=' . (int)max(1, $page) . '&aantal=' . $total);
|
||||
$news = [];
|
||||
foreach($apiResult->news as $newsItem)
|
||||
{
|
||||
$news[] = new \Model\NewsItem($newsItem);
|
||||
}
|
||||
|
||||
$apiResult = $this->API('programma/schema/nustraks');
|
||||
$comingUp = [];
|
||||
foreach($apiResult->schedule as $program)
|
||||
{
|
||||
$comingUp[] = [
|
||||
'start' => self::JsonToDateTime($program->start),
|
||||
'end' => self::JsonToDateTime($program->end),
|
||||
'program' => new \Model\Program($program->program)
|
||||
];
|
||||
foreach ($apiResult->news as $newsItem) {
|
||||
$news[] = new \Model\NewsItem($newsItem);
|
||||
}
|
||||
|
||||
$populair = [];
|
||||
$apiResult = $this->API('nieuws/populair?pagina=' . (int)max(1, $page) . '&aantal=' . $total);
|
||||
foreach ($apiResult as $newsItem) {
|
||||
$populair[] = new \Model\NewsItem($newsItem);
|
||||
}
|
||||
|
||||
$apiResult = $this->API('podcast/overzicht?aantal=20');
|
||||
$podcasts = [];
|
||||
foreach($apiResult->podcasts as $podcast) {
|
||||
$podcasts[] = new \Model\Podcast($podcast);
|
||||
$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', ['news' => $news, 'podcasts' => $podcasts, 'comingUp' => $comingUp]);
|
||||
return view('home', ['populair' => $populair, 'podcasts' => $podcasts, 'podcast' => $podcast, 'title' => 'Home', 'news' => $news, 'searchURL' => 'nieuws/zoeken']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user