Implement Close-Down Page with Upcoming Event

This commit is contained in:
MaZderMind 2015-04-04 20:11:25 +02:00
parent 69c2ec30e6
commit 0fb8904157
7 changed files with 87 additions and 13 deletions

View file

@ -33,7 +33,7 @@
@import "bootstrap-3.3.2/alerts.less";
//@import "bootstrap-3.3.2/progress-bars.less";
//@import "bootstrap-3.3.2/media.less";
//@import "bootstrap-3.3.2/list-group.less";
@import "bootstrap-3.3.2/list-group.less";
@import "bootstrap-3.3.2/panels.less";
//@import "bootstrap-3.3.2/responsive-embed.less";
@import "bootstrap-3.3.2/wells.less";

View file

@ -10,6 +10,13 @@ if($_SERVER['HTTP_HOST'] != 'localhost')
$GLOBALS['CONFIG']['CONFERENCE'] = array(
/**
* Am Ende der Konferenz wird durch das Umlegen dieses Schalters auf True eine Danke-Und-Kommen-Sie-
* Gut-Nach-Hause-Seite sowie einem Ausblick auf die kommenden Events angezeigt. Während einer
* Konferenz kann dieser Schalter auskommentiert oder auf false gesetzt werden.
*/
'CLOSED' => false,
/**
* Titel der Konferenz (kann Leer- und Sonderzeichen enthalten)
* Dieser im Seiten-Header, im <title>-Tag, in der About-Seite und ggf. ab weiteren Stellen als

View file

@ -16,10 +16,12 @@ require_once('model/RoomTab.php');
require_once('model/RoomSelection.php');
require_once('model/Stream.php');
require_once('model/Relive.php');
require_once('model/Upcoming.php');
$route = @$_GET['route'];
$route = rtrim($route, '/');
$conference = new Conference();
$tpl = new PhpTemplate('template/page.phtml');
$tpl->set(array(
@ -27,7 +29,7 @@ $tpl->set(array(
'route' => $route,
'assemblies' => './template/assemblies/',
'conference' => new Conference(),
'conference' => $conference,
'feedback' => new Feedback(),
'schedule' => new Schedule(),
));
@ -35,36 +37,43 @@ $tpl->set(array(
ob_start();
try {
if($route == '')
if($route == 'feedback/read')
{
require('view/feedback-read.php');
}
else if($conference->isClosed())
{
require('view/closed.php');
}
else if($route == '')
{
require('view/overview.php');
}
else if(preg_match('@^about$@', $route, $m))
else if($route == 'about')
{
require('view/about.php');
}
else if(preg_match('@^schedule.json$@', $route, $m))
else if($route == 'schedule.json')
{
require('view/schedule-json.php');
}
else if(preg_match('@^multiview$@', $route, $m))
else if($route == 'multiview')
{
require('view/multiview.php');
}
else if(preg_match('@^feedback$@', $route, $m))
else if($route == 'feedback')
{
require('view/feedback.php');
}
else if(preg_match('@^feedback/read$@', $route, $m))
{
require('view/feedback-read.php');
}
else if(preg_match('@^relive/([0-9]+)$@', $route, $m))
{
$_GET = array(
@ -73,7 +82,7 @@ try {
require('view/relive-player.php');
}
else if(preg_match('@^relive$@', $route, $m))
else if($route == 'relive')
{
require('view/relive.php');
}

View file

@ -6,6 +6,10 @@ class Conference extends ModelBase
return $this->get('CONFERENCE.TITLE', 'C3Voc Streaming');
}
public function isClosed() {
return $this->get('CONFERENCE.CLOSED');
}
public function hasAuthor() {
return $this->has('CONFERENCE.AUTHOR');
}

19
model/Upcoming.php Normal file
View file

@ -0,0 +1,19 @@
<?php
class Upcoming
{
public function getNextEvent()
{
try {
$events = file_get_contents('https://c3voc.de/eventkalender/events.json?filter=upcoming');
$events = json_decode($events, true);
$names = array_keys($events['voc_events']);
return $events['voc_events'][$names[0]];
}
catch(ErrorException $e)
{
return null;
}
}
}

25
template/closed.phtml Normal file
View file

@ -0,0 +1,25 @@
<div class="container about">
<h1><?=h($conference->getTitle())?> is over!</h1>
<? if($upcoming): ?>
<h2>See you soon at <?=h($upcoming['name'])?></h2>
<? endif ?>
<p>
Lecture recording and streaming at <strong><?=h($conference->getTitle())?></strong> was organized and performed by the <a href="http://c3voc.de">Chaos Computer Club Video Operation Center</a>. The next Event we'll attend will be at
</p>
<br><br><br>
<div class="col-xs-10 col-xs-offset-1 col-md-6 col-md-offset-3">
<div class="panel panel-default">
<div class="panel-heading"><?=h($upcoming['name'])?></div>
<div class="panel-body">
<?=h($upcoming['location'])?><br />
<?=h($upcoming['start_date'])?> <?=h($upcoming['end_date'])?>
</div>
</div>
</div>
</div>

10
view/closed.php Normal file
View file

@ -0,0 +1,10 @@
<?php
$upcoming = new Upcoming();
echo $tpl->render(array(
'page' => 'closed',
'title' => 'See you soon … somewhere else!',
'upcoming' => $upcoming->getNextEvent(),
));