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;
} else {
$scope.rankOrder = fld;
$scope.reverse = false;
$scope.reverse = (fld == "score");
}
};
})

View File

@ -1,18 +1,22 @@
<p><input type="search" class="form-control" placeholder="Rechercher" ng-model="query"></p>
<table class="table table-hover table-bordered table-striped">
<thead>
<tr>
<th ng-repeat="field in fields" ng-click="order(field)">
{{ field }}
<span class="glyphicon" ng-show="rankOrder === field" ng-class="{'glyphicon-up': !reverse, 'glyphicon-down': reverse}"></span>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="team in rank | filter: query | orderBy:rankOrder:reverse" ng-click="show(team.id)" ng-show="team.rank">
<td ng-repeat="field in fields" ng-class="{info: my.team_id == team.id}">
{{ team[field] }}
</td>
</tr>
</tbody>
</table>
<div class="panel panel-success">
<div class="panel-body">
<input type="search" class="form-control" placeholder="Rechercher" ng-model="query">
</div>
<table class="table table-hover table-striped">
<thead>
<tr>
<th ng-repeat="field in fields" ng-click="order(field)" width="33%">
{{ field | rankTitle }}
<span class="glyphicon" ng-show="rankOrder === field" ng-class="{'glyphicon-chevron-up': reverse, 'glyphicon-chevron-down': !reverse}"></span>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="team in rank | filter: query | orderBy:rankOrder:reverse" ng-click="show(team.id)" ng-show="team.rank">
<td ng-repeat="field in fields" ng-class="{info: my.team_id == team.id}">
{{ team[field] }}
</td>
</tr>
</tbody>
</table>
</div>