dashboard: add rank on the side

This commit is contained in:
nemunaire 2019-01-23 01:02:45 +01:00
parent c1bc86d3c9
commit fa2d514bbc
3 changed files with 70 additions and 0 deletions

View File

@ -613,6 +613,7 @@ angular.module("FICApp")
"themes": "Présentation des thèmes",
"exercice_follow": "Dernier exercice des événements",
"exercice": "Exercice",
"rank": "Classement",
"message": "Message",
"panel": "Boîte",
};
@ -639,6 +640,10 @@ angular.module("FICApp")
$scope.rank_types = {
"general": "Classement général",
};
$scope.rank_types_side = {
"carousel": "Classement général carousel",
"general": "Classement général",
};
$scope.table_types = {
"levels": "Niveaux d'exercices",
"teams": "Équipes",

View File

@ -247,6 +247,27 @@
<select class="custom-select custom-select-sm" id="eex" ng-model="scene.params.exercice" ng-options="ex.id as ex.title group by ex.path.split('/')[0] for ex in exercices"></select>
</div>
<div class="form-group row" ng-if="scene.type == 'rank'">
<label for="rtype" class="col-sm-4 col-form-label col-form-label-sm">Sorte</label>
<div class="col-sm-8">
<select class="custom-select custom-select-sm" id="rtype" ng-model="scene.params.which" ng-options="k as v for (k, v) in rank_types_side"></select>
</div>
</div>
<div class="form-group row" ng-if="scene.type == 'rank' && scene.params.which == 'general'">
<label for="rlimit" class="col-sm-4 col-form-label col-form-label-sm">Nb lign</label>
<div class="col-sm-8">
<input type="text" id="rlimit" ng-model="scene.params.limit" class="form-control form-control-sm" integer>
</div>
</div>
<div class="form-group row" ng-if="scene.type == 'rank' && scene.params.which == 'general'">
<label for="begin" class="col-sm-4 col-form-label col-form-label-sm">Début</label>
<div class="col-sm-8">
<input type="text" id="rbegin" ng-model="scene.params.begin" class="form-control form-control-sm" integer>
</div>
</div>
</div>
</div>

View File

@ -370,6 +370,50 @@
<div class="card-body" ng-if="s.params.html" ng-bind-html="s.params.html"></div>
</div>
<div class="card niceborder bg-dark" ng-if="s.type == 'rank' && !s.params.hide">
<table class="table table-bordered table-striped table-sm table-dark" ng-if="s.params.which == 'general'">
<thead class="thead-dark">
<tr>
<th class="text-right">Place</th>
<th>Équipe</th>
<th>Score</th>
</tr>
</thead>
<tbody ng-if="s.params.which == 'general'">
<tr ng-repeat="r in rank | orderBy: 'rank' | limitTo: s.params.limit: s.params.begin">
<th class="text-right">{{ r.rank }}<sup ng-if="r.rank == 1">er</sup><sup ng-if="r.rank > 1">e</sup></th>
<td>{{ r.name }}</td>
<td>{{ r.score | number:0 }}</td>
</tr>
</tbody>
</table>
<div class="carousel slide" data-interval="10000" autocarousel ng-if="s.params.which == 'carousel'">
<div class="carousel-inner">
<div class="carousel-item" ng-repeat="(i,t) in pagesrank" ng-class="{active: $first}">
<div class="carousel-caption">
<table class="table table-bordered table-striped table-sm table-dark">
<thead class="thead-dark">
<tr>
<th class="text-right">Place</th>
<th>Équipe</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="r in rank | orderBy: 'rank' | limitTo: 7: 7*i">
<th class="text-right">{{ r.rank }}<sup ng-if="r.rank == 1">er</sup><sup ng-if="r.rank > 1">e</sup></th>
<td>{{ r.name }}</td>
<td>{{ r.score }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>