Deliver centralized role management feature
[portal.git] / ecomp-portal-FE-common / client / app / views / role / role.html
1 <!--
2   ================================================================================
3   ECOMP Portal
4   ================================================================================
5   Copyright (C) 2017 AT&T Intellectual Property
6   ================================================================================
7   Licensed under the Apache License, Version 2.0 (the "License");
8   you may not use this file except in compliance with the License.
9   You may obtain a copy of the License at
10   
11        http://www.apache.org/licenses/LICENSE-2.0
12   
13   Unless required by applicable law or agreed to in writing, software
14   distributed under the License is distributed on an "AS IS" BASIS,
15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   See the License for the specific language governing permissions and
17   limitations under the License.
18   ================================================================================
19   -->
20   <style>
21   .checkbox .skin {
22     left: 112px;
23     top: -8px;
24 }
25 .checkbox input {
26     margin: 0px;
27     left: 105px;
28     height: 20px;
29     top: -4px;
30     }
31 .checkbox span {
32     display: inline-block;
33     margin-left: 1px;
34     margin-top: 0;
35     position: relative;
36     top: -3px;
37 }
38   </style>
39 <div class="w-ecomp-admins-page-main">
40         <div class="admins-home-container" id="page-content">
41                 <div id="title" class="w-ecomp-main-view-title">
42                 <h3 class="heading-page" >Role</h3>
43             </div>      
44             <div  class="admins-table" >
45                         <div>
46                                 <br>
47                             <p class="p-info">Please edit the role details below:&nbsp;</p><br>
48                             
49                              <div class="property-label checkbox-label"> 
50                                         <label for="checkbox-app-is-restricted" class="checkbox"> 
51                                 <input type="checkbox" ng-model="isGlobalRoleChecked" id="checkbox-app-is-restricted"  ng-checked="isGlobalRoleChecked" /> 
52                                 <i id="checkbox-app-is-restricted" class="skin"></i> 
53                                 <span>Global Roles: </span> 
54                             </label> 
55                                 </div> 
56                              
57                                 <div id="role-text" >
58                                         <label id="role-text-name-label" >*Name:</label>
59                                         <input id="input-name"  class="input-field" maxlength="300"  type="text" data-ng-model="role.name">                                      
60                                         <br>
61                                         <label id="role-text-priority-label">Priority:</label>
62                                         <input id="input-priority" class="input-field" maxlength="30"  type="text" data-ng-model="role.priority">                                               
63                                 </div>
64                                 <br>
65                                 <div align="left" >
66                                                 <button id="button-role-save" type="submit" ng-click="saveRole();" class="btn btn-alt btn-small">Save</button>
67                                 </div>
68                                 
69                                 <br>
70                                 <div ng-if="routeRoleId!=0">
71                                 <div id="page-title"  class="pageTitle">
72                                         <label>Role Functions</label>
73                                         <a id="add-new-role" ng-click="addNewRoleFunctionModalPopup();" ng-style="{'cursor':'pointer'}" class="icon-primary-accordion-plus" size="small"></a>
74                                 </div>
75                         
76                                 <div b2b-table table-data="role.roleFunctions"  ng-hide="users.isLoadingTable"  search-string="users.searchString" class="b2b-table-div">
77                                 <span class="ecomp-spinner" ng-show="isLoadingRoleFunctions"></span>
78                                         <table>
79                                                 <thead b2b-table-row type="header">
80                                                         <tr >
81                                                                 <th id="table-header-name" b2b-table-header key="name" sortable="true" >Name</th>
82                                                                 <th id="table-header-remove" b2b-table-header sortable="false" >Remove</th>
83                                                         </tr>
84                                                 </thead>
85                                                 <tbody b2b-table-row type="body"        row-repeat="roleFunction in role.roleFunctions">
86                                                         <tr >
87                                                                 <td id="role-function-{{roleFunction.name}}" b2b-table-body id="rowheader_t1_{{$index}}" headers="col1" ng-bind="roleFunction.name"></td>
88                                                                 <td b2b-table-body headers="rowheader_t1_{{$index}} col4">
89                                                                 <div id="{{$index}}-remove-trash-button" ng-click="removeRoleFunction(roleFunction);" ><a href="javascript:void(0)" class="icon-misc-trash"></a></div>
90                                                                 </td>                                                   
91                                                         </tr>
92                                                 </tbody>
93                                         </table>
94                                 </div>          
95                                 
96                                 <a id="manage-role"  href="roleFunctions">Manage Role Functions</a><br><br>
97                                 
98                                 <div id="page-title-child" class="pageTitle">
99                                         <label>Child Roles</label>
100                                         <a id="add-child-role"  ng-click="addNewChildRoleModalPopup();" ng-style="{'cursor':'pointer'}" class="icon-primary-accordion-plus" size="small"></a>
101                                 </div>
102                                 
103                                 <div b2b-table table-data="role.childRoles"  ng-hide="users.isLoadingTable"     search-string="users.searchString" class="b2b-table-div">
104                                         <table>
105                                                 <thead b2b-table-row type="header">
106                                                         <tr >
107                                                                 <th id="table-header-name" b2b-table-header key="firstName" sortable="true" >Name</th>
108                                                                 <th id="table-header-remove" b2b-table-header key="lastName" sortable="true" >Remove</th>
109                                                         </tr>
110                                                 </thead>
111                                                 <tbody b2b-table-row type="body"        row-repeat="role in role.childRoles">
112                                                         <tr >
113                                                                 <td id="role-function-{{role.name}}" b2b-table-body id="rowheader_t1_{{$index}}" headers="col1" ng-bind="role.name"></td>
114                                                                 <td b2b-table-body headers="rowheader_t1_{{$index}} col4" id="{{$index}}-button-remove-role" >
115                                                                 <div ng-click="removeChildRole(role);" ><a href="javascript:void(0)" class="icon-misc-trash"></a></div>
116                                                                 </td>                                                   
117                                                         </tr>
118                                                 </tbody>
119                                         </table>
120                                 </div>                                  
121                         </div>
122                         </div>
123                 </div>
124         </div>
125 </div>