Use team 0 to display solutions

This commit is contained in:
nemunaire 2014-12-29 01:34:18 +01:00
parent da1e9da495
commit 739d5b5722
5 changed files with 54 additions and 5 deletions

View file

@ -46,6 +46,17 @@
text-shadow: 0 0 5px #00c6ff;
}
.samptest {
display: block !important;
overflow-x: scroll;
text-overflow: ellipsis;
}
samp {
display: block;
overflow-x: scroll;
text-overflow: ellipsis;
}
.point {
position: relative;
-moz-animation: clockanim 1s ease infinite;

View file

@ -126,7 +126,7 @@ class Team
}
function get_id() {
return $this->id;
return intval($this->id);
}
function get_slogan() {

View file

@ -49,10 +49,27 @@
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">Soumettre une solution</h3>
<h3 class="panel-title">{if $my_team->id}Soumettre une solution{else}Solutions{/if}</h3>
</div>
<div class="panel-body">
{if $cur_exercice->has_solved($my_team)}
{if empty($my_team->id)}
Vérifiez votre solution parmi les algorithmes suivants :
<table class="table" style="font-size: 14px; padding: 10px; margin-bottom: 10px;">
<thead>
<tr>
<th>Algorithme</th>
<th>Hash</th>
</thead>
<tbody>
{foreach from=$cur_exercice->keys item=key}
<tr>
<td>{$key.format}</td>
<td><div class="samptest"><samp>{$key.value}</samp></div></td>
</tr>
{/foreach}
</tbody>
</table>
{else if $cur_exercice->has_solved($my_team)}
<strong>R&eacute;solu &agrave; {$cur_exercice->has_solved($my_team)|date_format:"%H:%M:%S"} :)</strong>
{else}
{if $cur_exercice->last_try($my_team)}

View file

@ -15,7 +15,24 @@
{/block}
{block name=body}
{if $my_team->id}
{include file="clock.tpl"}
{else}
<div class="clock">
<div id="ficlogo">
<a href="{$SALT_PUBLIC}/">
<img src="{$SALT_CDN}/img/challenge.jpg" alt="Forum International de la Cybersécurité">
</a>
</div>
<div id="epitalogo">
<a href="http://www.epita.fr/">
<img src="{$SALT_CDN}/img/epita.png" alt="Epita">
</a>
</div>
<div id="Date"></div>
<ul><li>Challenge forensic</li></ul>
</div>
{/if}
<div class="container" style="margin-top: 25px">
{if $ERRmessage}
@ -27,6 +44,7 @@
<div class="row">
<div class="col-md-2">
{if $my_team->id}
<aside class="panel panel-default">
<div class="panel-body">
<p>
@ -39,11 +57,12 @@
</p>
</div>
</aside>
{/if}
<div class="list-group">
{foreach from=$themes item=t key=k}
<a class="list-group-item" href="{link notag=1 href_prefix="/{$SALT_USER}/{$my_team->get_id()}/" href="{$t->get_id()}-{$t->get_name_url()}/"}">
<span class="badge">{$my_team->get_nb_res_exercises_by_theme($t->get_id())}/{$t->get_nb_exercices()}</span>
<span class="badge">{if $my_team->id}{$my_team->get_nb_res_exercises_by_theme($t->get_id())}/{/if}{$t->get_nb_exercices()}</span>
{$t->get_name()}
</a>
{/foreach}

View file

@ -5,7 +5,9 @@
<h3 style="font-variant: small-caps">{$cur_theme->get_name()}</h3>
<p>
{foreach from=$cur_theme->get_exercices_ordered() item=exercice}
{if $exercice->has_solved($my_team)}
{if empty($my_team->id)}
{link class="btn btn-primary" role="button" href_prefix="/{$SALT_USER}/{$my_team->get_id()}/" href="{$cur_theme->get_id()}-{$cur_theme->get_name_url()}/{$exercice->get_id()}/" label="{$exercice->get_title(true)}"}
{elseif $exercice->has_solved($my_team)}
{link class="btn btn-success" role="button" href_prefix="/{$SALT_USER}/{$my_team->get_id()}/" href="{$cur_theme->get_id()}-{$cur_theme->get_name_url()}/{$exercice->get_id()}/" label="{$exercice->get_title(true)}"}
{elseif $exercice->is_unlocked($my_team)}
{link class="btn btn-primary" role="button" href_prefix="/{$SALT_USER}/{$my_team->get_id()}/" href="{$cur_theme->get_id()}-{$cur_theme->get_name_url()}/{$exercice->get_id()}/" label="{$exercice->get_title(true)}"}