admin: add button to disable inactive teams
This commit is contained in:
parent
48fcfec0d0
commit
088c2402cd
4 changed files with 61 additions and 1 deletions
|
|
@ -1427,10 +1427,17 @@ angular.module("FICApp")
|
|||
}
|
||||
})
|
||||
|
||||
.controller("TeamsListController", function($scope, Team, $location) {
|
||||
.controller("TeamsListController", function($scope, $rootScope, Team, $location, $http) {
|
||||
$scope.teams = Team.query();
|
||||
$scope.fields = ["id", "name"];
|
||||
|
||||
$scope.desactiveTeams = function() {
|
||||
$http.post("/api/disableinactiveteams").then(function() {
|
||||
$scope.teams = Team.query();
|
||||
}, function(response) {
|
||||
$rootScope.newBox('danger', 'An error occurs when disabling inactive teams:', response.data.errmsg);
|
||||
});
|
||||
}
|
||||
$scope.show = function(id) {
|
||||
$location.url("/teams/" + id);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
<button type="button" ng-click="show('new')" class="float-right btn btn-sm btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter une équipe</button>
|
||||
<button type="button" ng-click="show('print')" class="float-right btn btn-sm btn-secondary mr-2"><span class="glyphicon glyphicon-print" aria-hidden="true"></span> Imprimer les équipes</button>
|
||||
<button type="button" ng-click="show('export')" class="float-right btn btn-sm btn-secondary mr-2"><span class="glyphicon glyphicon-export" aria-hidden="true"></span> Statistiques générales</button>
|
||||
<button type="button" ng-click="desactiveTeams()" class="float-right btn btn-sm btn-danger mr-2" title="Cliquer pour marquer les équipes sans certificat comme inactives (et ainsi éviter que ses fichiers ne soient générés)"><span class="glyphicon glyphicon-leaf" aria-hidden="true"></span> Désactiver les équipes inactives</button>
|
||||
</h2>
|
||||
|
||||
<p><input type="search" class="form-control" placeholder="Search" ng-model="query" autofocus></p>
|
||||
|
|
|
|||
Reference in a new issue