Lobby at challenge end

This commit is contained in:
Némunaire 2015-01-18 11:50:55 +01:00 committed by Nemunaire
parent 3f15b7187e
commit 2a9cac24f7
5 changed files with 75 additions and 21 deletions

1
TODO
View File

@ -4,7 +4,6 @@
** TODO trop de thèmes dans l'interface d'admin => menu
** TODO avoir la page avec le résumé
* PHP
** TODO On peut encore soumettre après la fin...
** TODO les mauvaises pages sont generees (pas debug et non liens prod)
** TODO sur le frontend, en mode productoin, il va chercher les pages de debug
** TODO numéro des exercices

View File

@ -150,6 +150,17 @@ else if ($n && $p[0] == SALT_USER)
$page = "teams/lobby";
}
else if (time() > $VAR["end_challenge"])
{
$TEAM = new Team($p[1]);
$template->assign("my_team", $TEAM);
$template->assign("themes", Theme::get_themes());
$template->assign("rank", Team::get_top());
require("team/summary.php");
$page = "teams/end";
}
else
{
$TEAM = new Team($p[1]);

View File

@ -0,0 +1,20 @@
<table class="table table-striped table-hover">
<thead>
<tr>
<th>#</th>
<th>Team</th>
<th>Slogan</th>
<th>Points</th>
</tr>
</thead>
<tbody>
{foreach from=$rank item=t key=k}
<tr{if $t->id == $my_team->id} class="active" style="font-weight: bold"{/if}>
<th>{$t->get_rank()}</th>
<td>{$t->get_name()}</td>
<td>{$t->slogan}</td>
<td>{$t->get_pts()}</td>
</tr>
{/foreach}
</tbody>
</table>

View File

@ -0,0 +1,43 @@
{extends file="layout.tpl"}
{block name=head}
<link href="{$SALT_CDN}/css/main.css" type="text/css" rel="stylesheet">
{block name=head2}{/block}
{/block}
{block name=end}
<script src="{$SALT_CDN}/js/countdown.js"></script>
<script type="text/javascript">
{if isset($END)}
var end_challenge = new Date({$END * 1000});
{/if}
update_end();
</script>
{/block}
{block name=content}
{include file="clock.tpl"}
<div class="container" style="margin-top: 25px">
<div class="alert alert-success">
<strong>Le challenge est termin&eacute; !</strong> Vous avez résolu {$my_team->get_solved_exercices()|count} exercices, pour un total de {$my_team->get_pts()} points. Vous êtes <strong>{$my_team->get_rank()}e</strong>, bravo !
</div>
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Progression</h3>
</div>
<div class="panel-body">
{include file="summary.tpl"}
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Classement final</h3>
</div>
<div class="panel-body">
{include file="rank.tpl"}
</div>
</div>
</div>
{/block}

View File

@ -1,24 +1,5 @@
{extends file="teams/layout.tpl"}
{block name=content}
<table class="table table-striped table-hover">
<thead>
<tr>
<th>#</th>
<th>Team</th>
<th>Slogan</th>
<th>Points</th>
</tr>
</thead>
<tbody>
{foreach from=$rank item=t key=k}
<tr{if $t->id == $my_team->id} class="active" style="font-weight: bold"{/if}>
<th>{$t->get_rank()}</th>
<td>{$t->get_name()}</td>
<td>{$t->slogan}</td>
<td>{$t->get_pts()}</td>
</tr>
{/foreach}
</tbody>
</table>
{include file="rank.tpl"}
{/block}