dashboard: add graph score

This commit is contained in:
nemunaire 2020-01-30 04:17:53 +01:00
commit b9fa5accff
5 changed files with 216 additions and 8 deletions

View file

@ -871,9 +871,53 @@ angular.module("FICApp")
type: "table",
params: { kind: "levels", levels: [1,2,3,4,5], themes: $scope.themes.map(function(z, i) { return z.id; }), total: true },
},
{
type: "graph",
params: { teams: [], height: 400, legend: true },
},
];
angular.forEach($scope.teams, function(team, tid) {
if (team.rank >= 1 && team.rank <= 9)
$scope.display.scenes[1].params.teams.push(tid)
});
$scope.display.side = [
{
type: "exercice_follow",
params: { },
},
];
}
else if (scene == "summary2") {
$scope.display.scenes = [
{
type: "graph",
params: { teams: [], height: 400, legend: false },
},
{
type: "rank",
params: { limit: 10, which: "general" },
params: { limit: 10, which: "general", legend: true },
},
];
angular.forEach($scope.teams, function(team, tid) {
if (team.rank >= 1 && team.rank <= 9)
$scope.display.scenes[0].params.teams.push(tid)
});
$scope.display.side = [
{
type: "exercice_follow",
params: { },
},
];
}
else if (scene == "summary3") {
$scope.display.scenes = [
{
type: "table",
params: { kind: "levels", levels: [1,2,3,4,5], themes: $scope.themes.map(function(z, i) { return z.id; }), total: true },
},
{
type: "rank",
params: { limit: 10, which: "general", legend: false },
},
];
$scope.display.side = [

View file

@ -12,6 +12,8 @@
<a class="dropdown-item" ng-click="presetScene('start')">Lancement</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" ng-click="presetScene('summary')">Résumé</a>
<a class="dropdown-item" ng-click="presetScene('summary2')">Résumé 2</a>
<a class="dropdown-item" ng-click="presetScene('summary3')">Résumé 3</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" ng-click="presetScene('freehintquarter')">Free Hint Quarter</a>
<a class="dropdown-item" ng-click="presetScene('happyhour')">Happy Hour</a>
@ -67,7 +69,7 @@
</div>
</div>
<div class="form-group row" ng-if="scene.type == 'message' || scene.type == 'panel' || scene.type == 'carousel' || scene.type == 'countdown'">
<div class="form-group row" ng-if="scene.type == 'message' || scene.type == 'panel' || scene.type == 'carousel' || scene.type == 'countdown' || scene.type == 'graph'">
<label for="mtitle" class="col-sm-2 col-form-label col-form-label-sm">Titre</label>
<div class="col-sm-10">
<input type="text" id="mtitle" ng-model="scene.params.title" class="form-control form-control-sm">
@ -161,7 +163,7 @@
</div>
</div>
<div class="form-group row" ng-if="scene.type == 'table' && scene.params.kind == 'teams'">
<div class="form-group row" ng-if="(scene.type == 'table' && scene.params.kind == 'teams') || scene.type == 'graph'">
<label for="tteams" class="col-sm-2 col-form-label col-form-label-sm">Équipes à afficher</label>
<div class="col-sm-10">
<select class="custom-select custom-select-sm" id="tteams" multiple="1" ng-model="scene.params.teams" ng-options="tid as (t.rank + 'e - ' + t.name) for (tid,t) in teams">
@ -201,6 +203,25 @@
</div>
</div>
<div class="form-group row" ng-if="scene.type == 'graph'">
<label for="gheight" class="col-sm-2 col-form-label col-form-label-sm">Hauteur</label>
<div class="col-sm-10">
<input type="text" id="gheight" ng-model="scene.params.height" class="form-control form-control-sm" integer>
</div>
</div>
<div class="form-group row" ng-if="scene.type == 'graph' || (scene.type == 'rank' && scene.params.which == 'general')">
<div class="col-sm-2"></div>
<div class="col-sm-10">
<div class="form-check">
<label class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" ng-model="scene.params.legend">
<span class="custom-control-label">Afficher la légende</span>
</label>
</div>
</div>
</div>
</div>
</div>
</div>
@ -222,7 +243,7 @@
<select class="custom-select custom-select-sm" id="type" ng-model="scene.type" ng-options="k as v for (k, v) in typeside"></select>
</div>
<div class="form-group row" ng-if="scene.type == 'panel' || scene.type == 'carousel' || scene.type == 'countdown'">
<div class="form-group row" ng-if="scene.type == 'panel' || scene.type == 'carousel' || scene.type == 'countdown' || scene.type == 'graph'">
<label for="ptype" class="col-sm-4 col-form-label col-form-label-sm">Couleur</label>
<div class="col-sm-8">
<select class="custom-select custom-select-sm" id="ptype" ng-model="scene.params.color" ng-options="k as v for (k, v) in colors"></select>