Initial OpenECOMP policy/engine commit
[policy/engine.git] / ecomp-sdk-app / src / main / webapp / WEB-INF / fusion / jsp / profile_search.jsp
1 <%--
2   ================================================================================
3   eCOMP Portal SDK
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 <%@ include file="/WEB-INF/fusion/jsp/popup_modal.html" %>
21 <div ng-controller="profileSearchController">
22         <div>
23                 <h1 class="heading1" style="margin-top:20px;">Profile Search</h1>
24                 <div style="margin-top:30px">
25                         <table att-table table-data="tableData" view-per-page="viewPerPage" current-page="currentPage" search-category="searchCategory" search-string="searchString" total-page="totalPage">
26
27                             <thead  att-table-row type="header">
28                                         <tr>
29                                                 <th att-table-header key="id">User ID</th>
30                                     <th att-table-header key="last_name">Last Name</th>        
31                                     <th att-table-header key="first_name">First Name</th>    
32                                     <th att-table-header key="email">Email</th>
33                                     <th att-table-header key="orgUserId">OrgUserId</th>        
34                                     <th att-table-header key="org_manager_userid">Manager OrgUserId</th> 
35                                     <th att-table-header >Edit</th>
36                                     <th att-table-header key="active">Active?</th>         
37                                 </tr>
38                             </thead>
39                             <tbody att-table-row type="body" row-repeat="rowData in tableData">
40                                 <tr>
41                                 <td att-table-body >{{rowData.id}}</td>
42                                 <td att-table-body >{{rowData.lastName}}</td>
43                                 <td att-table-body >{{rowData.firstName}}</td>
44                                 <td att-table-body >{{rowData.email}}</td>
45                                 <td att-table-body >{{rowData.orgUserId}}</td>
46                                 <td att-table-body >{{rowData.managerId}}</td>
47                                 <td att-table-body ><a href="" ng-click="editRow(rowData.id)" class="ion-edit" style="color: #888;font-size:20px;"></a></td>
48                                         <td att-table-body >
49                                            <div ng-click="toggleProfileActive(rowData)">
50                                              <input type="checkbox"  ng-model="rowData.active" att-toggle-main>
51                                            </div>
52                                    </td>
53                                 </tr>     
54                             </tbody>      
55                         </table>
56                 </div>
57         </div>  
58         <div class="fn-ebz-container">
59                   Rows Per Page:
60                   <input class="fn-ebz-text" type="text" ng-model="viewPerPage" size="5" style="width: 47px;">
61     </div>
62         <div class="fn-ebz-container">
63                   Current Page:
64                   <input class="fn-ebz-text" type="text" ng-model="currentPage" size="5" style="width: 47px;">
65     </div>
66     <div class="fn-ebz-container">
67                   Total Page(s):
68                   <input class="fn-ebz-text" type="text" ng-model="totalPage" size="5" readonly="true" style="width: 47px;">
69     </div>
70 </div>
71         
72 <script>
73 app.controller("profileSearchController", function ($scope,$http,modalService, $modal) { 
74         // Table Data
75         $scope.tableData=${model.profileList};
76         $scope.viewPerPage = 20;
77     $scope.scrollViewsPerPage = 2;
78     $scope.currentPage = 1;
79     $scope.totalPage;
80     $scope.searchCategory = "";
81     $scope.searchString = "";
82    // modalService.showSuccess('','Modal Sample') ;
83         for(x in $scope.tableData){
84                 if($scope.tableData[x].active_yn=='Y')
85                         $scope.tableData[x].active_yn=true;
86                 else
87                         $scope.tableData[x].active_yn=false;
88         }
89     $scope.editRow = function(profileId){
90         window.location = 'profile?profile_id=' + profileId;
91     }
92    
93     $scope.toggleProfileActive = function(rowData) {
94         modalService.popupConfirmWinWithCancel("Confirm","You are about to change user's active status. Do you want to continue?",
95                         function(){ 
96                         $http.get("profile/toggleProfileActive?profile_id="+rowData.id).success(function(){});
97         },
98         function(){
99                 rowData.active=!rowData.active;
100         })
101     };
102
103 });
104 </script>