Add a loby when the challenge isn't started

This commit is contained in:
nemunaire 2014-01-20 10:32:34 +01:00
parent 19f744a11c
commit 9feade7286
3 changed files with 67 additions and 1 deletions

View File

@ -130,6 +130,17 @@ else if ($n && $p[0] == SALT_USER)
require("public/home.php");
$page = "teams/list";
}
else if (empty($VAR["start_challenge"]) || $VAR["start_challenge"] < time())
{
$TEAM = new Team($p[1]);
$template->assign("my_team", $TEAM);
$template->assign("themes", Theme::get_themes());
require("team/me.php");
$page = "teams/lobby";
}
else
{
$TEAM = new Team($p[1]);

View File

@ -9,7 +9,7 @@ if (count($p) > 2)
switch($p[2])
{
case "start":
file_put_contents($VAR["misc_dir"]."/challenge_started", time());
file_put_contents($VAR["misc_dir"]."/challenge_started", time() + 42);
break;
case "init":

View File

@ -0,0 +1,55 @@
{extends file="layout.tpl"}
{block name=head}
<link href="/css/home.css" rel="stylesheet">
<link href="/css/score.css" rel="stylesheet">
<meta http-equiv="refresh" content="30">
{block name=head2}{/block}
{/block}
{block name=end}
<script src="/js/countdown.js"></script>
<script type="text/javascript">
update_end();
</script>
{/block}
{block name=content}
{include file="clock.tpl"}
<div class="container" style="margin-top: 25px">
<div class="alert alert-success">
<strong>Bienvenue sur le serveur du challenge !</strong>
Vous &ecirc;tes connect&eacute; en tant qu'&eacute;quipe <em>{$my_team->get_name()}</em>.
Le challenge n'est pas encore commenc&eacute;.<br>
Profitez-en pour v&eacute;rifier l'exactitude des informations ci-dessous.
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Information sur l'&eacute;quipe</h3>
</div>
<div class="panel-body">
{if not empty($members)}
<table class="table table-striped table-hover">
<thead><tr>
<th>Prénom</th>
<th>Nom</th>
<th>Pseudonyme</th>
<th>Entreprise</th>
</tr></thead>
<tbody>
{foreach from=$members item=member}
</tr>
<td>{$member->firstname}</td>
<td>{$member->lastname}</td>
<td>{$member->nickname}</td>
<td>{$member->company}</td>
</tr>
{/foreach}
</tbody>
</table>
{/if}
</div>
</div>
</div>
{/block}