Add progress stats
This commit is contained in:
parent
6863891ba2
commit
257a9977ea
@ -54,6 +54,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
||||
$rootScope.time.end = false;
|
||||
$rootScope.time.expired = false;
|
||||
}
|
||||
$rootScope.time.duration = time.du;
|
||||
$rootScope.time.remaining = remain;
|
||||
$rootScope.time.hours = Math.floor(remain / 3600);
|
||||
$rootScope.time.minutes = Math.floor((remain % 3600) / 60);
|
||||
@ -116,8 +117,14 @@ angular.module("FICApp")
|
||||
});
|
||||
$http.get("/themes.json").success(function(themes) {
|
||||
$scope.themes = themes;
|
||||
$scope.max_gain = 0;
|
||||
angular.forEach(themes, function(theme, key) {
|
||||
this[key].exercice_count = Object.keys(theme.exercices).length;
|
||||
this[key].gain = 0;
|
||||
angular.forEach(theme.exercices, function(ex, k) {
|
||||
this.gain += ex.gain;
|
||||
}, theme);
|
||||
$scope.max_gain += theme.gain;
|
||||
}, themes);
|
||||
actMenu();
|
||||
});
|
||||
|
@ -30,41 +30,45 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default" ng-show="(my.team_id && stats)">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Progressions</h3>
|
||||
<h3 class="panel-title">Progression</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<strong>Vous</strong>
|
||||
<div class="progress progress-striped">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60"
|
||||
aria-valuemin="0" aria-valuemax="100" style="width: 18%;">
|
||||
<span class="sr-only">18% Complete</span>
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60"
|
||||
aria-valuemin="0" aria-valuemax="100" style="width: 18%;">
|
||||
<span class="sr-only">18% Complete</span>
|
||||
aria-valuemin="0" aria-valuemax="100" style="width: {{ my.score * 100 / max_gain }}%;">
|
||||
<span class="sr-only">{{ my.score * 100 / max_gain }}% Complete</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<strong>Le temps</strong>
|
||||
<strong>Le temps </strong>
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60"
|
||||
aria-valuemin="0" aria-valuemax="100" style="width: 50%;">
|
||||
<span class="sr-only">90 minutes restantes</span>
|
||||
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60"
|
||||
aria-valuemin="0" aria-valuemax="100" style="width: {{ 100 - time.remaining / time.duration * 100 }}%;">
|
||||
<span class="sr-only">{{ time.remaining }} secondes restantes</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<strong>La meilleure équipe</strong>
|
||||
<div ng-show="rank.length && rank[0].id != my.team_id">
|
||||
<strong>La meilleure équipe ({{ rank[0].name }})</strong>
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60"
|
||||
aria-valuemin="0" aria-valuemax="100" style="width: 28%;">
|
||||
<span class="sr-only">18% Complete</span>
|
||||
aria-valuemin="0" aria-valuemax="100" style="width: {{ rank[0].score * 100 / max_gain }}%;">
|
||||
<span class="sr-only">{{ rank[0].score * 100 / max_gain }}% Complete</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="rank[0].id == my.team_id && rank.length > 1">
|
||||
<strong>La seconde équipe ({{ rank[1].name }})</strong>
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60"
|
||||
aria-valuemin="0" aria-valuemax="100" style="width: {{ rank[1].score * 100 / max_gain }}%;">
|
||||
<span class="sr-only">{{ rank[1].score * 100 / max_gain }}% Complete</span>
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60"
|
||||
aria-valuemin="0" aria-valuemax="100" style="width: 18%;">
|
||||
<span class="sr-only">18% Complete</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user