Add progress bar in the me page
Fixed class panel-body name in the me.tpl
This commit is contained in:
parent
b406ae93e3
commit
4f2dbf5470
@ -2,7 +2,22 @@
|
||||
|
||||
if(!defined('ONYX')) exit;
|
||||
|
||||
$themes = Theme::get_themes();
|
||||
if (!empty($themes))
|
||||
{
|
||||
$max_exo = 0;
|
||||
$res_exo = 0;
|
||||
foreach($themes as $th)
|
||||
{
|
||||
$max_exo += $th->get_nb_exercices();
|
||||
//$res_exo += $TEAM->get_nb_res_exercices_by_theme($th->get_id());
|
||||
$res_exo += count($TEAM->get_solved_exercices($th->get_id()));
|
||||
}
|
||||
$percent = $res_exo * 100 / $max_exo;
|
||||
}
|
||||
|
||||
$template->assign("themes", Theme::get_themes());
|
||||
$template->assign("nbExoMax", Exercice::get_nb_exo_max());
|
||||
$template->assign("percent", $percent);
|
||||
|
||||
return "teams/summary";
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Information sur l'équipe</h3>
|
||||
</div>
|
||||
<div class="panle-body">
|
||||
<div class="panel-body">
|
||||
{if not empty($members)}
|
||||
<table class="table">
|
||||
<thead><tr>
|
||||
|
@ -1,5 +1,20 @@
|
||||
{extends file="teams/layout.tpl"}
|
||||
|
||||
{block name=content}
|
||||
{if isset($percent)}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Progression</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="progress progress-striped active">
|
||||
<div class="progress-bar" role="progressbar" aria-valuenow="60"
|
||||
aria-valuemin="0" aria-valuemax="100" style="width: {$percent}%;">
|
||||
<span class="sr-only">{$percent}% Complete</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{include file="summary.tpl"}
|
||||
{/block}
|
||||
|
Loading…
Reference in New Issue
Block a user