Plein de trucs fonctionnent maintenant

This commit is contained in:
Némunaire 2013-11-08 15:47:55 +01:00
commit e3384eaa6b
22 changed files with 321 additions and 352 deletions

View file

@ -1,55 +1,73 @@
{extends file="layout-nav.tpl"}
{extends file="teams/theme.tpl"}
{block name=head}
<link href="/css/common.css" rel="stylesheet">
{/block}
{block name=content}
<div>
{if $solved < 1}
<h1>Exercice {$Exercice->number} - {$solved} équipe a résolu cet exercice</h1>
{else}
<h1>Exercice {$Exercice->number} - {$solved} équipes ont résolu cet exercice</h1>
{/if}
<ul>
<li>Difficulté : {$Exercice->level}</li>
<li>Gain : {$Exercice->points}</li>
{if isset($files)}
<li>Telechargement : </li>
{foreach from=$files item=file}
<div>
<a href="/{$file['path']}">{$file['name']}</a>
{$file['sha1']}
</div>
{/foreach}
{/if}
<li>Description : {$Exercice->statement}</li>
<!-- action a revoir -->
<form method="post" action="{$Exercice->id}/submission">
<p>
Soumettre la solution
<input type="text" name="solution" />
<input type="submit" value="Valider" />
</p>
</form>
</ul>
<ol>
{foreach from=$top10 item=team key=pos}
<li>{$team->get_name()} <small>({$team->get_pts()})</small></li>
{/foreach}
</ol>
<div id="my_team">
{$my_team->get_rank(10)}/{Team::get_nbTeams()}
{block name=exercices}
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Exercice {$cur_exercice->number} <small>{$solved} équipe{if $solved > 1}s{/if} a résolu cet exercice</small></h3>
</div>
<div class="panel-body">
<ul>
<li><strong>Difficulté :</strong> {$cur_exercice->level}</li>
<li><strong>Gain :</strong> {$cur_exercice->points}</li>
<li><strong>Description :</strong> {$cur_exercice->statement}</li>
</ul>
</div>
</div>
<div id="theme_list">
{foreach from=$themes item=theme key=k}
<strong>{$theme->get_name()}</strong><br>
{$my_team->get_nbResExercisesByTheme($theme->get_id())}/{$theme->get_nbExercices()}<br>
{/foreach}
{if $cur_exercice->files}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Téléchargements</h3>
</div>
<table class="table">
<thead>
<tr>
<th></th>
<th>Nom</th>
<th>SHA1</th>
<th>Taille</th>
</tr>
</thead>
<tbody>
{foreach from=$cur_exercice->files item=file}
{if file_exists($file['path'])}
<tr>
<td>
<a href="/{$file['path']}">
<span class="glyphicon glyphicon-download"></span>
</a>
</td>
<td>{$file['name']}</td>
<td>{$file['sha1']}</td>
<td>{filesize($file['path'])}</td>
</tr>
{/if}
{/foreach}
</tbody>
</table>
</div>
{/if}
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">Soumettre une solution</h3>
</div>
<div class="panel-body">
{if $cur_exercice->has_solved($my_team)}
Déjà résolu à {$cur_exercice->has_solved($my_team)|date_format:"%H:%M:%S"} :)
{else}
<form role="form" method="post" action="/{$SALT_USER}/{$my_team->get_id()}/{$cur_theme->get_id()}-{$cur_theme->get_name()}/{$cur_exercice->id}/submission">
<div class="form-group">
<label for="solution">Soumettre la solution :</label>
<input type="text" class="form-control" id="solution" name="solution">
</div>
<button type="submit" class="btn btn-success">Soumettre</button>
</form>
{/if}
</div>
</div>
{/block}