diff options
author | MaZderMind | 2015-12-30 23:08:19 +0100 |
---|---|---|
committer | MaZderMind | 2015-12-30 23:08:19 +0100 |
commit | 90fa5e229c8e25b0371cfd916f3463f9ea50d881 (patch) | |
tree | fe97792e31a04825bd8d443e26ea77baac2bb537 | |
parent | 2b934d63f318db93d5acbd9c6782c130a0f42f54 (diff) |
show last conference & relive on startpage
Diffstat (limited to '')
-rw-r--r-- | assets/css/_closed.less | 6 | ||||
-rw-r--r-- | model/Conferences.php | 17 | ||||
-rw-r--r-- | template/allclosed.phtml | 29 | ||||
-rw-r--r-- | view/allclosed.php | 1 |
4 files changed, 50 insertions, 3 deletions
diff --git a/assets/css/_closed.less b/assets/css/_closed.less index ff55b75..e66f080 100644 --- a/assets/css/_closed.less +++ b/assets/css/_closed.less @@ -8,6 +8,12 @@ body.not-started { text-align: center; } + .well { + text-align: center; + padding: 25px 5px; + margin-top: 25px; + } + .countdown { display: block; text-align: center; diff --git a/model/Conferences.php b/model/Conferences.php index 9396a48..ab7fe0e 100644 --- a/model/Conferences.php +++ b/model/Conferences.php @@ -33,6 +33,20 @@ class Conferences extends ModelBase return count(Conferences::getActiveConferences()); } + public static function getConferencesSorted() { + $sorted = Conferences::getConferences(); + + usort($sorted, function($a, $b) { + return @$b['CONFIG']['CONFERENCE']['STARTS_AT'] - @$a['CONFIG']['CONFERENCE']['STARTS_AT']; + }); + + return $sorted; + } + + public static function getLastConference() { + return Conferences::getConferencesSorted()[0]; + } + public static function exists($mandator) { return array_key_exists($mandator, Conferences::getConferences()); } @@ -50,6 +64,9 @@ class Conferences extends ModelBase 'title' => $conf->getTitle(), 'description' => $conf->getDescription(), + 'relive' => forceslash($mandator).$conf->getReliveUrl(), + 'releases' => $conf->getReleasesUrl(), + 'CONFIG' => $GLOBALS['CONFIG'], ]; unset($GLOBALS['CONFIG']); diff --git a/template/allclosed.phtml b/template/allclosed.phtml index f999ddc..4d4ff38 100644 --- a/template/allclosed.phtml +++ b/template/allclosed.phtml @@ -1,9 +1,32 @@ <div class="container about"> <? include("$assemblies/countdown.phtml") ?> - <p> - You can watch most of our Recordings at <a href="<?=h($conference->getReleasesUrl())?>"><?=h($conference->getReleasesUrl())?></a>. - </p> + <? if($last): ?> + + <div class="well"> + <? // FIXME when $last would be a Conference object, this code could be shared with clodes.phtml ?> + <h1><?=h($last['title'])?> is over!</h1> + + <? if($last['releases']): ?> + Recordings will be released at <a href="<?=h($last['releases'])?>"><?=h($last['releases'])?></a>. + <? endif ?> + + <? if($last['relive']): ?> + <? if($last['releases']): ?> + Until all recordings are released, <a href="<?=h($last['relive'])?>">ReLive</a> remains available. + <? else: ?> + You can still watch stream dumps <a href="<?=h($last['relive'])?>">here</a>. + <? endif ?> + <? endif ?> + </div> + + <? else: ?> + + <p> + You can watch most of our Recordings at <a href="<?=h($conference->getReleasesUrl())?>"><?=h($conference->getReleasesUrl())?></a>. + </p> + + <? endif ?> <br><br><br> diff --git a/view/allclosed.php b/view/allclosed.php index 869cbc1..3e0cb0d 100644 --- a/view/allclosed.php +++ b/view/allclosed.php @@ -9,4 +9,5 @@ echo $tpl->render(array( 'next' => @$events[0], 'events' => $events, + 'last' => Conferences::getLastConference(), )); |