Deliver centralized role management feature
[portal.git] / ecomp-portal-FE-common / client / app / views / dashboard / dashboard-widget-manage.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  
21
22 <div class="manage-widget-txt">
23
24                 <div class="b2b-modal-header">
25                         <h2 class="title" id="manage-contactUs-home-manageWidgets-title">Manage {{widgetTypeDisplay}} Widgets</h2>
26
27                         <div class="corner-button in">
28                                 <button type="button" class="close" aria-label="Close"
29                                         ng-click="$dismiss('cancel')"></button>
30                         </div>
31                 </div>
32
33 <div class="b2b-modal-body" tabindex="0" role="region" aria-label="Modal header text content"   >
34             <div class="get-access-table">
35                 <div class="table-control widget-table-control">
36                                         <div class="c-ecomp-portal-abs-table widget-table" >
37                     <table b2b-table id="table-main" 
38                         table-data="ignoredTableData"
39                         current-page="ignoredCurrentPage">
40                         <thead b2b-table-row type="header">
41                                 <tr>
42                                     <th id="th-users-1" b2b-table-header key="title" sortable="true" >Title</th>
43                                     <th id="th-users-2" b2b-table-header key="href" sortable="true" >URL</th>
44                                     <th ng-show="{{widgetType=='EVENTS'}}" id="th-users-3" b2b-table-header key="event_date" sortable="true" >Date</th>
45                                     <th ng-show="{{widgetType=='EVENTS'}}" id="th-users-4" b2b-table-header key="content" sortable="true" >Content</th>
46                                     <th id="th-users-5" b2b-table-header key="sortOrder" sortable="true" >Order</th>
47                                     <th id="th-users-6" b2b-table-header key="edit" sortable="false" >Edit</th>
48                                      <th id="th-users-7" b2b-table-header key="delete" sortable="false" >Delete</th>
49                                 </tr>
50                         </thead>
51                         <!-- Use track-by="UNIQUE KEY HERE" or leave out if no unique keys in data -->
52                         <tbody b2b-table-row type="body" class="table-body" track-by="$index" row-repeat="rowData in widgetData">
53                                 <tr id="tr-rowData" ng-click="">
54                                     <td b2b-table-body>
55                                         <div id="widget-td-title" ng-hide="rowData.showEdit" ng-bind="rowData.title"></div>
56                                        <input id="widget-input-title-{{$index}}"  type="text" ng-show="rowData.showEdit" ng-model="widgetData[$index].title"/>
57                                     </td>
58                                     <td b2b-table-body>
59                                         <div id="widget-td-href" ng-hide="rowData.showEdit" ng-bind="rowData.href"></div>
60                                         <input id="widget-input-href-{{$index}}" type="text" ng-show="rowData.showEdit" ng-model="widgetData[$index].href"/>
61                                     </td>
62                                     <td  ng-show="{{widgetType=='EVENTS'}}" b2b-table-body>
63                                         <div id="widget-td-date" ng-hide="rowData.showEdit" ng-bind="rowData.eventDate"></div>
64                                         <input id="widget-input-date-{{$index}}" type="text" ng-show="rowData.showEdit" ng-model="widgetData[$index].eventDate"/>
65                                     </td>
66                                     <td  ng-show="{{widgetType=='EVENTS'}}" b2b-table-body>
67                                         <div id="widget-td-content" ng-hide="rowData.showEdit">{{rowData.content | cut:true:20:' ...'}}</div>
68                                         <input id="widget-input-content-{{$index}}"  type="text" ng-show="rowData.showEdit" ng-model="widgetData[$index].content"/>
69                                     </td>
70                                     <td b2b-table-body>
71                                         <div id="widget-td-order" ng-hide="rowData.showEdit" ng-bind="rowData.sortOrder"></div>
72                                         <input id="widget-input-order-{{$index}}"  type="text" ng-show="rowData.showEdit" ng-model="widgetData[$index].sortOrder"/>      
73                                     </td>                            
74                                     <td b2b-table-body>
75                                         <div id="edit-contact-us-button" class="delete-contact-us" ng-hide="rowData.showEdit" ng-click="setEdit($index);">
76                                                 <span class="icon-edit"></span>
77                                         </div>
78                                         <span ng-show="rowData.showEdit">
79                                                 <a id="save-button"  ng-click="modify($index);" class="btn btn-alt btn-small" size="small" >Save</a>
80                                         </span>
81                                     </td>
82                                     <td b2b-table-body>
83                                         <div id="remove-contact-us" class="delete-contact-us" ng-click="remove($index);">
84                                                 <span class="icon-misc-trash"></span>
85                                         </div>
86                                     </td>
87                                 </tr>
88                         </tbody>
89                     </table>
90                 </div>
91                 
92                                         <div class="widget-field" >
93                                         <form name = "widgetForm" novalidate>                           
94                                                 <div id="addWidgetHeader" class="contact-us-margin">                            
95                                                         <h1 class="widget-add">Add</h1>
96                                                         <div class="errMsg">{{errMsg}}</div>
97                                                         <div class="sucessMsg" ng-bind="successMsg"></div>
98                                                 </div>                                                            
99                                                 <div id="addWidget" class="contact-us-margin">
100                                                         <div>
101                                                                 <div>
102                                                                         <div class="add-widget-field">
103                                                                    <div id="mots-property-label" class="property-label">Title</div>
104                                                                     <input id="widget-input-add-title" class="input-text-area" type="text"  ng-model="newWidgetObject.title" name="title" ng-required="true"/>                                                            
105                                                                 </div>
106                                                                 <div class="add-widget-field">
107                                                                     <div  class="property-label">URL</div>
108                                                                     <input id="widget-input-add-url" class="input-text-area" type="text"  ng-model="newWidgetObject.href" type="url" size="3" name = "url"  ng-required = "true"/>
109                                                                 </div>
110                                                                 <div class="add-widget-field" >
111                                                                     <div class="property-label">Sort Order</div>
112                                                                     <input id="widget-input-add-order" class="input-text-area" type="text" ng-model="newWidgetObject.sortOrder"/>
113                                                                 </div>
114                                                         </div>
115                                                         <div  class="add-widget-field">
116                                                                 <h4>Event Date</h4>
117                                                                 <input class="notif-input-calendar" type="text" id="datepicker-end" 
118                                                                         ng-model="newWidgetObject.eventDate" b2b-datepicker min="minDate" max="maxDate" 
119                                                                         required />
120                                                                 </div>
121                                                                 
122                                                         <div class="add-contact-us-field-des"  ng-show="{{widgetType=='EVENTS'}}">
123                                                             <div  class="property-label">Content</div>
124                                                             <textarea class="widget-type-txt-area" ng-model="newWidgetObject.content" name="content" ng-required = "widgetType =='EVENTS'">
125                                                             </textarea>                                                     
126                                                         </div>
127                                                 </div>
128                                                         
129                                                         
130                                         
131                                                 </div>
132                                         </form>
133                                         </div>
134                                         
135             </div>
136     </div>
137         
138                         </div>
139                         <br>
140                         <div class="b2b-modal-footer">
141                         <div class="dialog-control">
142                                         <a id="add-button" class="btn btn-alt btn-small"  ng-click="saveNew()">Add New</a>
143                                         
144                                                 <a id="close-button"  class="btn btn-alt btn-small"  ng-click="$dismiss('cancel')">Close</a>
145   
146     </div>
147                         
148                 </div>
149
150 </div>
151
152 <script type="application/javascript">
153     $(document).ready(function(){
154         $(".ngdialog-content").css("width","85%");
155         $(".ngdialog-close").attr('id','dialog-close');
156     });
157 </script>