diff options
author | MaZderMind | 2018-05-12 11:26:14 +0200 |
---|---|---|
committer | MaZderMind | 2018-05-12 11:26:14 +0200 |
commit | 59f7c88ac3c8454eb0812dcb044e2854d9241001 (patch) | |
tree | 8688ac2112062252ed77961ed9289065c929041d /view/overview.php | |
parent | 2cf00ac475500f007bce90cf81d8d582208650c9 (diff) | |
parent | 622b1f030c5c931704b7e997918dad2dcfd48551 (diff) |
Merge branch 'feature/talkinfo-in-json'
Diffstat (limited to '')
-rw-r--r-- | view/overview.php | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/view/overview.php b/view/overview.php index adc8d5f..fb9d15d 100644 --- a/view/overview.php +++ b/view/overview.php @@ -2,19 +2,14 @@ $schedule = $conference->getSchedule(); -$talksPerRoom = $schedule->getSchedule(); -$now = time() + $schedule->getSimulationOffset(); - -$upcomingTalksPerRoom = array_map(function($talks) use($now) { - return [ - 'current' => array_filter_last($talks, function($talk) use ($now) { - return $talk['start'] < $now && $talk['end'] > $now; - }), - 'next' => array_filter_first($talks, function($talk) use ($now) { - return !isset($talk['special']) && $talk['start'] > $now; - }), +$now = $schedule->getScheduleDisplayTime(); +$upcomingTalksPerRoom = []; +foreach ($conference->getRooms() as $room) { + $upcomingTalksPerRoom[$room->getSlug()] = [ + 'current' => $room->getCurrentTalk($now), + 'next' => $room->getNextTalk($now), ]; -}, $talksPerRoom); +}; echo $tpl->render(array( 'page' => 'overview', |