public front: can choose levels to display in levels table

This commit is contained in:
nemunaire 2018-01-23 03:52:24 +01:00
parent 1e36eb8b2f
commit 1110afa058
3 changed files with 10 additions and 2 deletions

View File

@ -606,7 +606,7 @@ angular.module("FICApp")
$scope.scenes = [
{
type: "table",
params: { kind: "levels", themes: $scope.themes.map(function(z, i) { return z.id; }), total: true },
params: { kind: "levels", levels: [1,2,3,4,5,6,7,8,9,10], themes: $scope.themes.map(function(z, i) { return z.id; }), total: true },
},
{
type: "rank",

View File

@ -137,6 +137,14 @@
</div>
</div>
<div class="form-group row" ng-if="scene.type == 'table' && scene.params.kind == 'levels'">
<label for="ttheme" class="col-sm-2 col-form-label col-form-label-sm">Niveaux à afficher</label>
<div class="col-sm-10">
<select class="custom-select custom-select-sm" id="tlevels" multiple="1" ng-model="scene.params.levels" ng-options="lvl for lvl in [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]">
</select>
</div>
</div>
<div class="form-group row" ng-if="scene.type == 'table' && scene.params.kind == 'teams'">
<label for="tteams" class="col-sm-2 col-form-label col-form-label-sm">Équipes à afficher</label>
<div class="col-sm-10">

View File

@ -119,7 +119,7 @@
</tr>
</thead>
<tbody class="table-bordered bg-secondary text-dark" ng-if="s.params.kind == 'levels'">
<tr ng-repeat="lvl in [1,2,3,4,5,6,7,8,9,10]">
<tr ng-repeat="lvl in s.params.levels">
<th class="text-center"><nobr>Niveau {{ 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}">