frontend/public: minor fixes

This commit is contained in:
nemunaire 2018-01-26 12:01:05 +01:00
parent 9d36e55227
commit 0b2e61faef
2 changed files with 5 additions and 2 deletions

View File

@ -155,7 +155,10 @@ angular.module("FICApp")
$scope.themes = themes;
$scope.max_gain = 0;
angular.forEach(themes, function(theme, key) {
this[key].exercice_count = Object.keys(theme.exercices).length;
if (theme.exercices)
this[key].exercice_count = Object.keys(theme.exercices).length;
else
this[key].exercice_count = 0;
this[key].gain = 0;
angular.forEach(theme.exercices, function(ex, k) {
this.gain += ex.gain;

View File

@ -120,7 +120,7 @@
</thead>
<tbody class="table-bordered bg-secondary text-dark" ng-if="s.params.kind == 'levels'">
<tr ng-repeat="lvl in s.params.levels">
<th class="text-center"><nobr>Niveau {{ lvl }}</nobr></th>
<th class="text-center"><nobr>Challenge {{ lvl }}</nobr></th>
<td ng-repeat="(tid,th) in themes" class="text-center" ng-if="s.params.themes.indexOf(tid-0) !== -1">
<span ng-repeat="exercice in th.exercices" ng-if="$index == lvl-1 && (exercice.tried || lvl == 1)" ng-class="{'text-primary': exercice.solved == 0, 'text-success': exercice.solved >= 1, 'text-bold': exercice.solved >= 1, 'text-warning': exercice.solved == 0 && exercice.tried}">
<span ng-if="exercice.solved">{{ exercice.solved }}</span>