Plein de trucs fonctionnent maintenant
This commit is contained in:
parent
8758598104
commit
e3384eaa6b
22 changed files with 321 additions and 352 deletions
|
|
@ -1,12 +0,0 @@
|
|||
{extends file="layout-nav.tpl"}
|
||||
|
||||
{block name=head}
|
||||
<link href="/css/common.css" rel="stylesheet">
|
||||
{/block}
|
||||
|
||||
{block name=content}
|
||||
<h1>
|
||||
<!-- Add java script refresh ?-->
|
||||
COMFIMATION PLEASE WAIT...
|
||||
</h1>
|
||||
{/block}
|
||||
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{extends file="layout-nav.tpl"}
|
||||
{extends file="teams/layout.tpl"}
|
||||
|
||||
{block name=head}
|
||||
<link href="/css/common.css" rel="stylesheet">
|
||||
|
|
|
|||
63
onyx/tpl/bootstrap/teams/layout.tpl
Normal file
63
onyx/tpl/bootstrap/teams/layout.tpl
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
{extends file="layout.tpl"}
|
||||
|
||||
{block name=body}
|
||||
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/{$SALT_USER}/{$my_team->get_id()}">FIC</a>
|
||||
</div>
|
||||
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="active"><a href="/{$SALT_USER}/{$my_team->get_id()}/themes">Thèmes</a></li>
|
||||
<li><a href="/{$SALT_USER}/{$my_team->get_id()}/scores">Scores</a></li>
|
||||
<li><a href="/{$SALT_USER}/{$my_team->get_id()}/me">Ma team</a></li>
|
||||
</ul>
|
||||
|
||||
<p class="navbar-right navbar-text">01:23:42</p>
|
||||
</div><!-- /.navbar-collapse -->
|
||||
</nav>
|
||||
|
||||
<div class="container" style="margin-top: 25px">
|
||||
|
||||
{if $ERRmessage}
|
||||
<div class="alert alert-{$ERRcolor}">
|
||||
<button class="close" data-dismiss="alert">×</button>
|
||||
<i class="icon-warning-sign"></i> {$ERRmessage}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<aside>
|
||||
<p>
|
||||
<span style="font-weight: bolder;">{$my_team->get_name()}<a class="badge pull-right" href="/{$SALT_USER}/{$my_team->get_id()}/me">Modifier</a></span>
|
||||
<em>{$my_team->get_slogan()}</em>
|
||||
</p>
|
||||
<p>
|
||||
{$my_team->get_pts()} points<a class="badge pull-right" href="/{$SALT_USER}/{$my_team->get_id()}/summary">Synthèse</a><br>
|
||||
{$my_team->get_rank()}<sup>e</sup> sur {Team::get_nbTeams()}
|
||||
</p>
|
||||
</aside>
|
||||
|
||||
<div class="list-group">
|
||||
{foreach from=$themes item=t key=k}
|
||||
<a class="list-group-item" href="/{$SALT_USER}/{$my_team->get_id()}/{$t->get_id()}-{$t->get_name()}">
|
||||
<span class="badge">{$my_team->get_nbResExercisesByTheme($t->get_id())}/{$t->get_nbExercices()}</span>
|
||||
{$t->get_name()}
|
||||
</a>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-10">
|
||||
{block name=content}{/block}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
9
onyx/tpl/bootstrap/teams/list.tpl
Normal file
9
onyx/tpl/bootstrap/teams/list.tpl
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{extends file="layout.tpl"}
|
||||
{block name=body}
|
||||
<h3>Choisissez la team que vous voulez représenter :</h3>
|
||||
{foreach from=$teams item=i}
|
||||
<ul>
|
||||
<li><a href="/{$SALT_USER}/{$i->id}/">{$i->team_name}</a></li>
|
||||
</ul>
|
||||
{/foreach}
|
||||
{/block}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{extends file="layout-nav.tpl"}
|
||||
{extends file="teams/layout.tpl"}
|
||||
|
||||
{block name=head}
|
||||
<link href="/css/common.css" rel="stylesheet">
|
||||
|
|
|
|||
|
|
@ -1,54 +1,9 @@
|
|||
{extends file="layout-nav.tpl"}
|
||||
{extends file="teams/layout.tpl"}
|
||||
|
||||
{block name=head}
|
||||
<link href="/css/common.css" rel="stylesheet">
|
||||
{/block}
|
||||
|
||||
{block name=content}
|
||||
<h1>
|
||||
THIS IS SUMMARY
|
||||
</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
{for $i=1 to $nbExoMax}
|
||||
<th>exo{$i}</th>
|
||||
{/for}
|
||||
<th>Points</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{$total=0}
|
||||
{foreach from=$themes item=theme}
|
||||
<tr>
|
||||
<th>{$theme->get_name()}</th>
|
||||
{$sum=0}
|
||||
{$themeID=$theme->get_id()}
|
||||
{$solvedExercices=$team->get_solvedExercices($themeID)} {*TODO: This line give a Warning*}
|
||||
{foreach from=$theme->get_exercicesOrdered() item=exo}
|
||||
{$pts=0}
|
||||
{for $i=0 to $nbExoMax}
|
||||
{if !empty($solvedExercices.$i)}
|
||||
{if $solvedExercices.$i->get_id() == $exo->get_id()}
|
||||
{$pts=$solvedExercices.$i->points}{$sum=$sum + $pts}
|
||||
{/if}
|
||||
{/if}
|
||||
{/for}
|
||||
<td>{$pts}</td>
|
||||
{/foreach}
|
||||
<td>{$sum}</td>
|
||||
</tr>
|
||||
{$total=$total+$sum}
|
||||
{/foreach}
|
||||
<tr>
|
||||
{for $i=1 to $nbExoMax}
|
||||
<td></td>
|
||||
{/for}
|
||||
<td>Total :</td>
|
||||
<td>{$total}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{include file="summary.tpl"}
|
||||
{/block}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{extends file="layout-nav.tpl"}
|
||||
{extends file="teams/layout.tpl"}
|
||||
|
||||
{block name=head}
|
||||
<link href="/css/common.css" rel="stylesheet">
|
||||
|
|
|
|||
14
onyx/tpl/bootstrap/teams/theme.tpl
Normal file
14
onyx/tpl/bootstrap/teams/theme.tpl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{extends file="teams/layout.tpl"}
|
||||
|
||||
{block name=content}
|
||||
<div class="jumbotron">
|
||||
<h3 style="font-variant: small-caps">{$cur_theme->get_name()}</h3>
|
||||
<p>
|
||||
{foreach from=$cur_theme->get_exercicesOrdered() item=exercice}
|
||||
<a class="btn btn-{if $exercice->has_solved($my_team)}success{elseif $exercice->is_unlocked($my_team)}primary{else}danger{/if}" role="button" href="/{$SALT_USER}/{$my_team->get_id()}/{$cur_theme->get_id()}-{$cur_theme->get_name()}/{$exercice->get_id()}">{$exercice->get_name()}</a>
|
||||
{/foreach}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{block name=exercices}{/block}
|
||||
{/block}
|
||||
Reference in a new issue