Browse Source

group users get/del

develop
Robin Thoni 8 years ago
parent
commit
dc6546e5d3

+ 5
- 0
luticate/controllers/modals/groupedit.controller.js View File

@@ -35,4 +35,9 @@ angular.module('luticate')
35 35
             {
36 36
                 dialogs.create('views/modals/grouppermissions.html', 'GroupPermissionsController', group);
37 37
             };
38
+
39
+            $scope.editUsers = function(group)
40
+            {
41
+                dialogs.create('views/modals/groupusers.html', 'GroupUsersController', group);
42
+            };
38 43
         }]);

+ 65
- 0
luticate/controllers/modals/groupusers.controller.js View File

@@ -0,0 +1,65 @@
1
+/**
2
+ * Created by robin on 11/2/15.
3
+ */
4
+
5
+angular.module('luticate')
6
+    .controller('GroupUsersController', ['$scope', 'luticateAuthGroups', 'data',
7
+        function($scope, luticateAuthGroups, data) {
8
+
9
+            $scope.group = data;
10
+
11
+            $scope.luTable = {
12
+                columns: [
13
+                    {
14
+                        name: "Username",
15
+                        width: 3,
16
+                        getValue: function (item) {
17
+                            return item.Username;
18
+                        }
19
+                    }, {
20
+                        name: "Email",
21
+                        width: 3,
22
+                        getValue: function (item) {
23
+                            return item.Email;
24
+                        }
25
+                    }, {
26
+                        name: "Firstname",
27
+                        width: 3,
28
+                        getValue: function (item) {
29
+                            return item.Firstname;
30
+                        }
31
+                    }, {
32
+                        name: "Lastname",
33
+                        width: 3,
34
+                        getValue: function (item) {
35
+                            return item.Lastname;
36
+                        }
37
+                    }
38
+                ],
39
+
40
+                permissions: {
41
+                    add: 'LU_GROUP_USER_ADD',
42
+                    del: 'LU_GROUP_USER_DEL'
43
+                },
44
+
45
+                getLoadPagePromise: function (page, perPage, promise) {
46
+                    return luticateAuthGroups.usersGetAll({
47
+                        group_id: $scope.group.Id,
48
+                        page: page,
49
+                        perPage: perPage
50
+                    }, promise);
51
+                },
52
+
53
+                getDelPromise: function (id, promise) {
54
+                    return luticateAuthGroups.usersDel({
55
+                        group_id: $scope.group.Id,
56
+                        user_id: id
57
+                    }, promise);
58
+                },
59
+
60
+                getEditController: function () {
61
+                    return null;
62
+                }
63
+            };
64
+
65
+        }]);

+ 1
- 0
luticate/index.html View File

@@ -60,6 +60,7 @@
60 60
     <script src="controllers/modals/userpermissions.controller.js"></script>
61 61
     <script src="controllers/modals/usereffectivepermissions.controller.js"></script>
62 62
     <script src="controllers/modals/grouppermissions.controller.js"></script>
63
+    <script src="controllers/modals/groupusers.controller.js"></script>
63 64
 
64 65
     <!-- SDK -->
65 66
     <script src="../sdk/cache.js"></script>

+ 8
- 3
luticate/views/modals/groupedit.html View File

@@ -5,10 +5,15 @@
5 5
             <input id="name" class="form-control" ng-model="group.Name" required lu-enable-permission="{{ permission }}"/>
6 6
         </div>
7 7
     </div>
8
-    <div class="form-group" lu-show-permission="LU_PERM_GROUP_GET,LU_PERM_GET">
9
-        <button type="button" class="btn btn-default col-sm-offset-2"
8
+    <div class="form-group">
9
+        <div class="col-sm-2"></div>
10
+        <button type="button" class="btn btn-default" lu-show-permission="LU_PERM_GROUP_GET,LU_PERM_GET"
10 11
                 ng-click="editPermissions(group)" ng-show="group.Id != null">
11
-            Edit Permissions
12
+            Edit permissions
13
+        </button>
14
+        <button type="button" class="btn btn-default" lu-show-permission="LU_PERM_GROUP_GET,LU_PERM_GET"
15
+                ng-click="editUsers(group)" ng-show="group.Id != null">
16
+            Edit users
12 17
         </button>
13 18
     </div>
14 19
 </dialog-ok-cancel>

+ 4
- 0
luticate/views/modals/groupusers.html View File

@@ -0,0 +1,4 @@
1
+<!-- Page Content -->
2
+<dialog-close title="Edit {{ group.Name }} users">
3
+    <lu-table options="luTable" class="row col-sm-8 col-sm-offset-2" ></lu-table>
4
+</dialog-close>

Loading…
Cancel
Save