Verified Commit 5f76fdb6 authored by Hugo's avatar Hugo
Browse files

ajoute ajouter et enlever tous les utilisateurs

parent c4c3f99e
Pipeline #697 passed with stages
in 14 seconds
search-add-remove-user=Search, add, remove a user search-add-remove-user=Search, add, remove a user
\ No newline at end of file add-all-users=Add all users
remove-all-users=Remove all users
\ No newline at end of file
search-add-remove-user=Rechercher, ajouter, enlever un utilisateur search-add-remove-user=Rechercher, ajouter, enlever un utilisateur
\ No newline at end of file add-all-users=Ajouter tous les utilisateurs
remove-all-users=Enlever tous les utilisateurs
\ No newline at end of file
...@@ -58,7 +58,6 @@ module.controller( ...@@ -58,7 +58,6 @@ module.controller(
Notifications.success($translate.instant("user.groups.join.success")); Notifications.success($translate.instant("user.groups.join.success"));
parentScope.searchQuery(); parentScope.searchQuery();
$scope.users.find((x) => x.id == userId).isMember = true; $scope.users.find((x) => x.id == userId).isMember = true;
// $scope.search();
} }
); );
}; };
...@@ -76,9 +75,20 @@ module.controller( ...@@ -76,9 +75,20 @@ module.controller(
); );
parentScope.searchQuery(); parentScope.searchQuery();
$scope.users.find((x) => x.id == userId).isMember = false; $scope.users.find((x) => x.id == userId).isMember = false;
// $scope.search();
} }
); );
}; };
$scope.addAll = () => {
$scope.users
.filter((x) => x.isMember == false)
.forEach((x) => $scope.join(x.id));
};
$scope.removeAll = () => {
$scope.users
.filter((x) => x.isMember == true)
.forEach((x) => $scope.leave(x.id));
};
} }
); );
...@@ -66,6 +66,10 @@ ...@@ -66,6 +66,10 @@
<button class="btn btn-default" style="margin-left: 1rem;" ng-click="query=''">{{:: 'view-all-users' | translate}}</button> <button class="btn btn-default" style="margin-left: 1rem;" ng-click="query=''">{{:: 'view-all-users' | translate}}</button>
</div> </div>
</form> </form>
<div style="margin-top: 1rem;">
<button class="btn btn-default" ng-click="addAll()">{{:: 'add-all-users' | translate}}</button>
<button class="btn btn-default" ng-click="removeAll()">{{:: 'remove-all-users' | translate}}</button>
</div>
<div class="list-group list-view-pf list-view-pf-view"> <div class="list-group list-view-pf list-view-pf-view">
<div class="list-group-item" ng-repeat="user in users track by user.id"> <div class="list-group-item" ng-repeat="user in users track by user.id">
<div class="list-view-pf-actions"> <div class="list-view-pf-actions">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment