Browse Source

groups ui

develop
Robin Thoni 9 years ago
parent
commit
a0e8d284eb

+ 24
- 19
luticate/controllers/groups.controller.js View File

2
     .controller('GroupsController', ['$scope', 'luticateAuthGroups',
2
     .controller('GroupsController', ['$scope', 'luticateAuthGroups',
3
         function($scope, luticateAuthGroups) {
3
         function($scope, luticateAuthGroups) {
4
 
4
 
5
-            $scope.columns = [
6
-                {
7
-                    name: "Name",
8
-                    width: 11,
9
-                    getValue: function(item) {
10
-                        return item.Name;
5
+            $scope.luTable = {
6
+                columns: [
7
+                    {
8
+                        name: "Name",
9
+                        width: 11,
10
+                        getValue: function (item) {
11
+                            return item.Name;
12
+                        }
11
                     }
13
                     }
12
-                }
13
-            ];
14
+                ],
14
 
15
 
15
-            $scope.getLoadPagePromise = function(page, perPage, promise)
16
-            {
17
-                return luticateAuthGroups.getAll({page: page, perPage: perPage}, promise);
18
-            };
16
+                permissions: {
17
+                    add: 'LU_GROUP_ADD',
18
+                    del: 'LU_GROUP_DEL',
19
+                    edit: 'LU_GROUP_EDIT'
20
+                },
19
 
21
 
20
-            $scope.getDelPromise = function(id, promise)
21
-            {
22
-                return luticateAuthGroups.del({group_id: id}, promise);
23
-            };
22
+                getLoadPagePromise: function (page, perPage, promise) {
23
+                    return luticateAuthGroups.getAll({page: page, perPage: perPage}, promise);
24
+                },
24
 
25
 
25
-            $scope.getEditController = function()
26
-            {
27
-                return "GroupEdit";
26
+                getDelPromise: function (id, promise) {
27
+                    return luticateAuthGroups.del({group_id: id}, promise);
28
+                },
29
+
30
+                getEditController: function () {
31
+                    return "GroupEdit";
32
+                }
28
             };
33
             };
29
         }]);
34
         }]);

+ 3
- 1
luticate/controllers/modals/groupedit.controller.js View File

7
         function($scope, luticateAuthGroups, data, dialogs) {
7
         function($scope, luticateAuthGroups, data, dialogs) {
8
             if (data != null) {
8
             if (data != null) {
9
                 $scope.group = data;
9
                 $scope.group = data;
10
+                $scope.permission = "LU_GROUP_EDIT";
10
             }
11
             }
11
             else {
12
             else {
12
                 $scope.group = {
13
                 $scope.group = {
13
                     Name: ""
14
                     Name: ""
14
-                }
15
+                };
16
+                $scope.permission = "LU_GROUP_ADD";
15
             }
17
             }
16
 
18
 
17
             $scope.submitForm = function()
19
             $scope.submitForm = function()

+ 6
- 0
luticate/controllers/modals/grouppermissions.controller.js View File

11
             $scope.luPermissionEdit = {
11
             $scope.luPermissionEdit = {
12
                 item: $scope.group,
12
                 item: $scope.group,
13
 
13
 
14
+                permissions: {
15
+                    add: 'LU_PERM_GROUP_ADD',
16
+                    del: 'LU_PERM_GROUP_DEL',
17
+                    edit: 'LU_PERM_GROUP_EDIT'
18
+                },
19
+
14
                 getGetAllPromise: function (page, perPage, promise) {
20
                 getGetAllPromise: function (page, perPage, promise) {
15
                     return luticateAuthPermissionsGroup.getAll({
21
                     return luticateAuthPermissionsGroup.getAll({
16
                         group_id: this.item.Id,
22
                         group_id: this.item.Id,

+ 1
- 1
luticate/views/groups.html View File

1
 <!-- Page Content -->
1
 <!-- Page Content -->
2
 <div class="container">
2
 <div class="container">
3
-    <lu-table class="row col-sm-8 col-sm-offset-2" ></lu-table>
3
+    <lu-table options="luTable" class="row col-sm-8 col-sm-offset-2" ></lu-table>
4
 </div>
4
 </div>
5
 
5
 

+ 2
- 2
luticate/views/modals/groupedit.html View File

2
     <div class="form-group">
2
     <div class="form-group">
3
         <label for="name" class="col-sm-2 control-label">Name</label>
3
         <label for="name" class="col-sm-2 control-label">Name</label>
4
         <div class="col-sm-9">
4
         <div class="col-sm-9">
5
-            <input id="name" class="form-control" ng-model="group.Name" required/>
5
+            <input id="name" class="form-control" ng-model="group.Name" required lu-enable-permission="{{ permission }}"/>
6
         </div>
6
         </div>
7
     </div>
7
     </div>
8
-    <div class="form-group">
8
+    <div class="form-group" lu-show-permission="LU_PERM_GROUP_GET">
9
         <button type="button" class="btn btn-default col-sm-offset-2"
9
         <button type="button" class="btn btn-default col-sm-offset-2"
10
                 ng-click="editPermissions(group)" ng-show="group.Id != null">
10
                 ng-click="editPermissions(group)" ng-show="group.Id != null">
11
             Edit Permissions
11
             Edit Permissions

+ 1
- 1
luticate/views/modals/permissionedit.html View File

9
         <label class="col-sm-2 control-label">Allowed</label>
9
         <label class="col-sm-2 control-label">Allowed</label>
10
         <div class="col-sm-9">
10
         <div class="col-sm-9">
11
             <div class="btn-group">
11
             <div class="btn-group">
12
-                <a class="btn btn-default dropdown-toggle btn-select" data-toggle="dropdown" href="">{{ permission.Value ? 'Yes' : 'No' }} <span class="caret"></span></a>
12
+                <button class="btn btn-default dropdown-toggle btn-select" data-toggle="dropdown" href="">{{ permission.Value ? 'Yes' : 'No' }} <span class="caret"></span></button>
13
                 <ul class="dropdown-menu">
13
                 <ul class="dropdown-menu">
14
                     <li><a href="" ng-click="permission.Value = false">No</a></li>
14
                     <li><a href="" ng-click="permission.Value = false">No</a></li>
15
                     <li><a href="" ng-click="permission.Value = true">Yes</a></li>
15
                     <li><a href="" ng-click="permission.Value = true">Yes</a></li>

Loading…
Cancel
Save