ce838e71b61fb15b0bb3037e916b846c449bc138
[motion-next.git] /
1 <div
2   id="servicenowAccounts"
3   class="page-layout simple left-sidenav inner-sidenav motion-list"
4 >
5   <!-- HEADER -->
6   <div
7     class="header md-accent-bg"
8     layout="row"
9     layout-align="space-between center"
10   >
11     <!-- APP TITLE -->
12     <div layout="row" layout-align="start center">
13       <div class="logo" layout="row" layout-align="start center">
14         <span class="logo-icon">
15           <md-icon md-font-icon="icon-heart" class="s24"></md-icon>
16         </span>
17         <span class="logo-text" translate="INTEGRATIONS.SERVICENOWACCOUNTS"
18           >ServicenowAccounts</span
19         >
20       </div>
21     </div>
22     <!-- / APP TITLE -->
23
24     <div layout="row">
25       <!-- SEARCH -->
26       <div
27         class="search-input-wrapper"
28         layout="row"
29         layout-align="start center"
30       >
31         <label for="search">
32           <md-icon md-font-icon="icon-magnify"></md-icon>
33         </label>
34         <md-input-container md-no-float class="m-0">
35           <input
36             id="search"
37             placeholder="Search for anyone"
38             type="text"
39             ng-model="vm.query.filter"
40             ng-model-options="{ debounce: 1000 }"
41             translate
42             translate-attr-placeholder="INTEGRATIONS.SEARCH_FOR_ANYONE"
43           />
44         </md-input-container>
45       </div>
46       <!-- / SEARCH -->
47     </div>
48   </div>
49   <!-- / HEADER -->
50
51   <!-- SELECTED BAR -->
52   <div
53     ng-show="vm.selectedServicenowAccounts.length > 0"
54     class="selected-bar header animate-slide-down md-accent-bg"
55     layout="row"
56     layout-align="start center"
57   >
58     <div
59       class="close-button-wrapper"
60       ng-click="vm.selectedServicenowAccounts =[]"
61     >
62       <md-button layout="row" layout-align="start center">
63         <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>
64         <span translate="INTEGRATIONS.BACK">Back</span>
65       </md-button>
66     </div>
67
68     <div flex layout="row" layout-align="space-between center">
69       <div>
70         <span class="selected-servicenowAccounts-count">
71           <span>{{vm.selectedServicenowAccounts.length}}</span>
72           <span translate="INTEGRATIONS.SELECTED">selected</span>
73         </span>
74
75         <md-menu class="select-menu" ng-if="!vm.currentThread">
76           <md-button
77             class="md-icon-button"
78             ng-click="$mdMenu.open($event)"
79             aria-label="multi select toggle"
80             translate
81             translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE"
82           >
83             <md-icon md-font-icon="icon-menu-down"></md-icon>
84           </md-button>
85           <md-menu-content width="3">
86             <md-menu-item>
87               <md-button
88                 ng-click="vm.selectAllServicenowAccounts()"
89                 translate="INTEGRATIONS.SELECT_ALL"
90               >
91                 Select all
92               </md-button>
93             </md-menu-item>
94             <md-menu-item>
95               <md-button
96                 ng-click="vm.deselectServicenowAccounts()"
97                 translate="INTEGRATIONS.SELECT_NONE"
98               >
99                 Select none
100               </md-button>
101             </md-menu-item>
102           </md-menu-content>
103         </md-menu>
104       </div>
105
106       <div class="multi-select-actions">
107         <button
108           class="md-icon-button"
109           ng-csv="vm.exportSelectedServicenowAccounts"
110           csv-label="true"
111           filename="servicenowAccounts.csv"
112         >
113           <md-icon md-font-icon="icon-file-excel"></md-icon>
114         </button>
115         <md-button
116           class="md-icon-button"
117           ng-if="vm.crudPermissions.canDelete"
118           ng-click="vm.deleteSelectedServicenowAccounts($event)"
119           aria-label="delete selected"
120           translate
121           translate-attr-label="INTEGRATIONS.DELETE_SELECTED"
122         >
123           <md-icon md-font-icon="icon-delete"></md-icon>
124         </md-button>
125       </div>
126     </div>
127   </div>
128   <!-- / SELECTED BAR -->
129
130   <!-- CONTENT -->
131   <div class="content" md-background-bg layout="row" layout-align="start start">
132     <!-- MAIN -->
133     <div class="main scrollable" ms-scroll>
134       <!-- SERVICENOWACCOUNT TABLE -->
135       <md-card>
136         <md-table-container>
137           <table
138             md-table
139             md-row-select
140             multiple
141             ng-model="vm.selectedServicenowAccounts"
142             md-progress="vm.promise"
143           >
144             <thead
145               md-head
146               md-order="vm.query.sort"
147               md-on-reorder="vm.getServicenowAccounts"
148             >
149               <tr md-row>
150                 <th
151                   md-column
152                   ng-if="vm.table == 'users' || vm.table == 'agents'"
153                   width="20px"
154                 ></th>
155                 <th md-column md-order-by="id">
156                   {{ 'INTEGRATIONS.ID' | translate }}
157                 </th>
158                 <th md-column md-order-by="name">
159                   {{ 'INTEGRATIONS.NAME' | translate }}
160                 </th>
161                 <th md-column md-order-by="username">
162                   {{ 'INTEGRATIONS.USERNAME' | translate }}
163                 </th>
164                 <th md-column md-order-by="email">
165                   {{ 'INTEGRATIONS.EMAIL' | translate }}
166                 </th>
167                 <th md-column md-order-by="remoteUri">
168                   {{ 'INTEGRATIONS.HOST' | translate }}
169                 </th>
170                 <th md-column width="10px"></th>
171               </tr>
172             </thead>
173             <tbody md-body>
174               <tr md-row ng-hide="vm.servicenowAccounts.rows.length">
175                 <td md-cell colspan="6">
176                   <div layout="row" layout-align="center center">
177                     <span translate="INTEGRATIONS.NO_AVAILABLE_INFO"
178                       >No Available Info</span
179                     >
180                   </div>
181                 </td>
182               </tr>
183               <tr
184                 md-row
185                 md-select="servicenowAccount"
186                 md-select-id="id"
187                 ng-repeat="servicenowAccount in vm.servicenowAccounts.rows"
188               >
189                 <td md-cell ng-if="servicenowAccount.userpic">
190                   <img
191                     class="avatar"
192                     alt="{{servicenowAccount.name}}"
193                     ng-src="api/users/{{servicenowAccount.id}}/avatar"
194                   />
195                 </td>
196                 <td
197                   md-cell
198                   ng-if="!servicenowAccount.userpic && (vm.table == 'users' || vm.table == 'agents')"
199                 >
200                   <img
201                     class="avatar"
202                     alt="{{servicenowAccount.name}}"
203                     ng-src="assets/images/avatars/profile.png"
204                   />
205                 </td>
206                 <td
207                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)"
208                   md-cell
209                   class="id"
210                 >
211                   {{servicenowAccount.id}}
212                 </td>
213                 <td
214                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)"
215                   md-cell
216                   class="name"
217                 >
218                   {{servicenowAccount.name}}
219                 </td>
220                 <td
221                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)"
222                   md-cell
223                   class="username"
224                 >
225                   {{servicenowAccount.username}}
226                 </td>
227                 <td
228                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)"
229                   md-cell
230                   class="email"
231                 >
232                   {{servicenowAccount.email}}
233                 </td>
234                 <td
235                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(servicenowAccount, ev) : vm.createOrEditServicenowAccount($event, servicenowAccount)"
236                   md-cell
237                   class="remoteUri"
238                 >
239                   {{servicenowAccount.remoteUri}}
240                 </td>
241
242                 <td md-cell class="actions">
243                   <md-menu>
244                     <md-button
245                       class="md-icon-button"
246                       aria-label="More"
247                       translate
248                       translate-attr-aria-label="INTEGRATIONS.MORE"
249                       ng-click="$mdMenu.open($event)"
250                     >
251                       <md-icon md-font-icon="icon-dots-vertical"></md-icon>
252                     </md-button>
253
254                     <md-menu-content width="3">
255                       <!-- SUBACTIONS -->
256
257                       <!-- ACTIONS -->
258
259                       <md-menu-item ng-if="vm.crudPermissions.canEdit">
260                         <md-button
261                           ng-click="vm.editstate(servicenowAccount, $event    )"
262                           translate="INTEGRATIONS.EDIT_SERVICENOWACCOUNT"
263                         >
264                           Edit ServicenowAccount
265                         </md-button>
266                       </md-menu-item>
267
268                       <!-- SUBACTIONS -->
269
270                       <!-- ACTIONS -->
271
272                       <md-menu-item>
273                         <md-button
274                           ng-click="vm.testtestintegrationaccount(servicenowAccount, $event    )"
275                           translate="INTEGRATIONS.TEST_SERVICENOWACCOUNT"
276                         >
277                           Test ServicenowAccount
278                         </md-button>
279                       </md-menu-item>
280
281                       <!-- SUBACTIONS -->
282
283                       <!-- ACTIONS -->
284
285                       <md-menu-item
286                         ng-if="vm.currentUser.crudPermissions === 0 || vm.currentUser.role === 'admin'"
287                       >
288                         <md-button
289                           ng-click="vm.deleteconfirm(servicenowAccount, $event    )"
290                           translate="INTEGRATIONS.DELETE_SERVICENOWACCOUNT"
291                         >
292                           Delete ServicenowAccount
293                         </md-button>
294                       </md-menu-item>
295                     </md-menu-content>
296                   </md-menu>
297                 </td>
298               </tr>
299             </tbody>
300           </table>
301         </md-table-container>
302
303         <md-table-pagination
304           md-label="{page: '{{'INTEGRATIONS.PAGE' | translate}}:', rowsPerPage: '{{'INTEGRATIONS.ROWSPERPAGE' | translate}}:', of: '{{'INTEGRATIONS.OF' | translate}}'}"
305           md-limit="vm.query.limit"
306           md-limit-options="[10, 15, 20, 50, 100, 250]"
307           md-page="vm.query.page"
308           md-total="{{vm.servicenowAccounts.count}}"
309           md-on-paginate="vm.getServicenowAccounts"
310           md-page-select
311         ></md-table-pagination>
312       </md-card>
313       <!-- / SERVICENOWACCOUNT TABLE -->
314       <!-- NO RESULTS -->
315
316       <!-- / NO RESULTS -->
317     </div>
318     <!-- / MAIN -->
319   </div>
320   <!-- / CONTENT -->
321
322   <!-- ADD SERVICENOWACCOUNT BUTTON -->
323   <md-button
324     ng-if="vm.crudPermissions.canEdit"
325     class="md-fab md-accent add-item-button"
326     id="add-servicenowAccount-button"
327     ng-click="vm.createOrEditServicenowAccount($event)"
328     aria-label="add servicenowAccount"
329     translate
330     translate-attr-aria-label="INTEGRATIONS.ADD_SERVICENOWACCOUNT"
331   >
332     <md-icon md-font-icon="icon-plus"></md-icon>
333   </md-button>
334   <!-- / ADD SERVICENOWACCOUNT BUTTON -->
335 </div>