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,34 +0,0 @@
{extends file="layout.tpl"}
{block name=body}
<!-- TODO: message dans lang-->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/{$SALT_USER}/">FIC</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="/{$SALT_USER}/themes">Thèmes</a></li>
<li><a href="/{$SALT_USER}/scores">Scores</a></li>
<li><a href="/{$SALT_USER}/me">Ma team</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
{if $ERRmessage}
<div class="alert alert-{$ERRcolor}">
<button class="close" data-dismiss="alert">&times;</button>
<i class="icon-warning-sign"></i> {$ERRmessage}
</div>
{/if}
<div class="container">
{block name=content}{/block}
</div>
{/block}

View file

@ -5,130 +5,5 @@
{/block}
{block name=content}
<div class="clock">
<div id="Date"></div>
<ul>
<li id="hours">00</li>
<li id="point">:</li>
<li id="min">00</li>
<li id="point">:</li>
<li id="sec">00</li>
</ul>
</div>
<div class="row">
<div class="col-md-2">
<h3>TOP #10</h3>
<table class="table">
<tr>
<td>1</td>
<td>a</td>
</td>
<tr>
<td>2</td>
<td>b</td>
</td>
<tr>
<td>3</td>
<td>c</td>
</td>
<tr>
<td>4</td>
<td>d</td>
</td>
<tr>
<td>5</td>
<td>e</td>
</td>
<tr>
<td>6</td>
<td>f</td>
</td>
<tr>
<td>7</td>
<td>g</td>
</td>
<tr>
<td>8</td>
<td>h</td>
</td>
<tr>
<td>9</td>
<td>i</td>
</td>
<tr>
<td>10</td>
<td>j</td>
</td>
</table>
</div>
<!-- example -->
<div class="col-md-10">
<div class="jumbotron">
<h1>Example</h1>
<p><div id="test">This is a example</div></p>
<p>This is a example</p>
<p>This is a example</p>
<p>This is a example</p>
<p>This is a example</p>
<p>This is a example</p>
</div>
</div>
</div>
<div id="carousel-team" class="carousel slide">
<div class="carousel-inner">
<div class="item active">
<div class="well">
<center><h1>Team Alpha</h1></center>
</div>
</div>
<div class="item">
<div class="well">
<center><h1>Team Beta</h1></center>
</div>
</div>
<div class="item">
<div class="well">
<center><h1>Team Gamma</h1></center>
</div>
</div>
<div class="item">
<div class="well">
<center><h1>Team Delta</h1></center>
</div>
<!--div class="carousel-caption">
<p>#</p>
<p><a href="#">#</a></p>
</div-->
</div>
</div><!-- .carousel-inner -->
<!-- next and previous controls here
href values must reference the id for this carousel -->
<!--a class="carousel-control left" href="#carousel-team" data-slide="prev">&lsaquo;</a>
<a class="carousel-control right" href="#carousel-team" data-slide="next">&rsaquo;</a-->
</div><!-- .carousel -->
{/block}
{block name=end}
<script type="text/javascript">
$(document).ready(function() {
var time = {$END};
$('#carousel-team').carousel({
interval: 2000 });
setInterval( function() {
var heure = Math.floor(time / 3600);
var min = Math.floor((time / 60) % 60);
var sec = Math.floor(time % 60);
$("#hours").html(( heure < 10 ? "0" : "" ) + heure);
$("#min").html(( min < 10 ? "0" : "" ) + min);
$("#sec").html(( sec < 10 ? "0" : "" ) + sec);
time--;
}, 1000);
});
</script>
{include file="summary.tpl"}
{/block}

View file

@ -0,0 +1,41 @@
<table class="table">
<thead>
<tr>
<th></th>
{for $i=1 to $nbExoMax}
<th>Exercice {$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=$my_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}
<th>{$sum}</th>
</tr>
{$total=$total+$sum}
{/foreach}
</tbody>
<tfoot>
<tr>
<th colspan="{$nbExoMax+1}" style="text-align: right">Total :</th>
<th>{$total}</th>
</tr>
</tfoot>
</table>

View file

@ -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}

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}

View file

@ -1,4 +1,4 @@
{extends file="layout-nav.tpl"}
{extends file="teams/layout.tpl"}
{block name=head}
<link href="/css/common.css" rel="stylesheet">

View 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">&times;</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}

View 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}

View file

@ -1,4 +1,4 @@
{extends file="layout-nav.tpl"}
{extends file="teams/layout.tpl"}
{block name=head}
<link href="/css/common.css" rel="stylesheet">

View file

@ -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}

View file

@ -1,4 +1,4 @@
{extends file="layout-nav.tpl"}
{extends file="teams/layout.tpl"}
{block name=head}
<link href="/css/common.css" rel="stylesheet">

View 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}