frontend: improve rank rendering

This commit is contained in:
nemunaire 2017-01-14 15:01:18 +01:00 committed by nemunaire
parent 103979b29d
commit fbd97bdc4c
2 changed files with 23 additions and 19 deletions

View File

@ -325,7 +325,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
$scope.reverse = !$scope.reverse; $scope.reverse = !$scope.reverse;
} else { } else {
$scope.rankOrder = fld; $scope.rankOrder = fld;
$scope.reverse = false; $scope.reverse = (fld == "score");
} }
}; };
}) })

View File

@ -1,10 +1,13 @@
<p><input type="search" class="form-control" placeholder="Rechercher" ng-model="query"></p> <div class="panel panel-success">
<table class="table table-hover table-bordered table-striped"> <div class="panel-body">
<input type="search" class="form-control" placeholder="Rechercher" ng-model="query">
</div>
<table class="table table-hover table-striped">
<thead> <thead>
<tr> <tr>
<th ng-repeat="field in fields" ng-click="order(field)"> <th ng-repeat="field in fields" ng-click="order(field)" width="33%">
{{ field }} {{ field | rankTitle }}
<span class="glyphicon" ng-show="rankOrder === field" ng-class="{'glyphicon-up': !reverse, 'glyphicon-down': reverse}"></span> <span class="glyphicon" ng-show="rankOrder === field" ng-class="{'glyphicon-chevron-up': reverse, 'glyphicon-chevron-down': !reverse}"></span>
</th> </th>
</tr> </tr>
</thead> </thead>
@ -15,4 +18,5 @@
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div>