1d1586b4671b07f0fa3a4ca866ff59e6b3e8233c
[motion-next.git] /
1 <div
2   id="zendeskAccounts"
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.ZENDESKACCOUNTS"
18           >ZendeskAccounts</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.selectedZendeskAccounts.length > 0"
54     class="selected-bar header animate-slide-down md-accent-bg"
55     layout="row"
56     layout-align="start center"
57   >
58     <div class="close-button-wrapper" ng-click="vm.selectedZendeskAccounts =[]">
59       <md-button layout="row" layout-align="start center">
60         <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>
61         <span translate="INTEGRATIONS.BACK">Back</span>
62       </md-button>
63     </div>
64
65     <div flex layout="row" layout-align="space-between center">
66       <div>
67         <span class="selected-zendeskAccounts-count">
68           <span>{{vm.selectedZendeskAccounts.length}}</span>
69           <span translate="INTEGRATIONS.SELECTED">selected</span>
70         </span>
71
72         <md-menu class="select-menu" ng-if="!vm.currentThread">
73           <md-button
74             class="md-icon-button"
75             ng-click="$mdMenu.open($event)"
76             aria-label="multi select toggle"
77             translate
78             translate-attr-aria-label="INTEGRATIONS.MULTI_SELECT_TOGGLE"
79           >
80             <md-icon md-font-icon="icon-menu-down"></md-icon>
81           </md-button>
82           <md-menu-content width="3">
83             <md-menu-item>
84               <md-button
85                 ng-click="vm.selectAllZendeskAccounts()"
86                 translate="INTEGRATIONS.SELECT_ALL"
87               >
88                 Select all
89               </md-button>
90             </md-menu-item>
91             <md-menu-item>
92               <md-button
93                 ng-click="vm.deselectZendeskAccounts()"
94                 translate="INTEGRATIONS.SELECT_NONE"
95               >
96                 Select none
97               </md-button>
98             </md-menu-item>
99           </md-menu-content>
100         </md-menu>
101       </div>
102
103       <div class="multi-select-actions">
104         <button
105           class="md-icon-button"
106           ng-csv="vm.exportSelectedZendeskAccounts"
107           csv-label="true"
108           filename="zendeskAccounts.csv"
109         >
110           <md-icon md-font-icon="icon-file-excel"></md-icon>
111         </button>
112         <md-button
113           class="md-icon-button"
114           ng-if="vm.crudPermissions.canDelete"
115           ng-click="vm.deleteSelectedZendeskAccounts($event)"
116           aria-label="delete selected"
117           translate
118           translate-attr-label="INTEGRATIONS.DELETE_SELECTED"
119         >
120           <md-icon md-font-icon="icon-delete"></md-icon>
121         </md-button>
122       </div>
123     </div>
124   </div>
125   <!-- / SELECTED BAR -->
126
127   <!-- CONTENT -->
128   <div class="content" md-background-bg layout="row" layout-align="start start">
129     <!-- MAIN -->
130     <div class="main scrollable" ms-scroll>
131       <!-- ZENDESKACCOUNT TABLE -->
132       <md-card>
133         <md-table-container>
134           <table
135             md-table
136             md-row-select
137             multiple
138             ng-model="vm.selectedZendeskAccounts"
139             md-progress="vm.promise"
140           >
141             <thead
142               md-head
143               md-order="vm.query.sort"
144               md-on-reorder="vm.getZendeskAccounts"
145             >
146               <tr md-row>
147                 <th
148                   md-column
149                   ng-if="vm.table == 'users' || vm.table == 'agents'"
150                   width="20px"
151                 ></th>
152                 <th md-column md-order-by="id">
153                   {{ 'INTEGRATIONS.ID' | translate }}
154                 </th>
155                 <th md-column md-order-by="name">
156                   {{ 'INTEGRATIONS.NAME' | translate }}
157                 </th>
158                 <th md-column md-order-by="username">
159                   {{ 'INTEGRATIONS.USERNAME' | translate }}
160                 </th>
161                 <th md-column md-order-by="remoteUri">
162                   {{ 'INTEGRATIONS.URI' | translate }}
163                 </th>
164                 <th md-column width="10px"></th>
165               </tr>
166             </thead>
167             <tbody md-body>
168               <tr md-row ng-hide="vm.zendeskAccounts.rows.length">
169                 <td md-cell colspan="5">
170                   <div layout="row" layout-align="center center">
171                     <span translate="INTEGRATIONS.NO_AVAILABLE_INFO"
172                       >No Available Info</span
173                     >
174                   </div>
175                 </td>
176               </tr>
177               <tr
178                 md-row
179                 md-select="zendeskAccount"
180                 md-select-id="id"
181                 ng-repeat="zendeskAccount in vm.zendeskAccounts.rows"
182               >
183                 <td md-cell ng-if="zendeskAccount.userpic">
184                   <img
185                     class="avatar"
186                     alt="{{zendeskAccount.name}}"
187                     ng-src="api/users/{{zendeskAccount.id}}/avatar"
188                   />
189                 </td>
190                 <td
191                   md-cell
192                   ng-if="!zendeskAccount.userpic && (vm.table == 'users' || vm.table == 'agents')"
193                 >
194                   <img
195                     class="avatar"
196                     alt="{{zendeskAccount.name}}"
197                     ng-src="assets/images/avatars/profile.png"
198                   />
199                 </td>
200                 <td
201                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)"
202                   md-cell
203                   class="id"
204                 >
205                   {{zendeskAccount.id}}
206                 </td>
207                 <td
208                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)"
209                   md-cell
210                   class="name"
211                 >
212                   {{zendeskAccount.name}}
213                 </td>
214                 <td
215                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)"
216                   md-cell
217                   class="username"
218                 >
219                   {{zendeskAccount.username}}
220                 </td>
221                 <td
222                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(zendeskAccount, ev) : vm.createOrEditZendeskAccount($event, zendeskAccount)"
223                   md-cell
224                   class="remoteUri"
225                 >
226                   {{zendeskAccount.remoteUri}}
227                 </td>
228
229                 <td md-cell class="actions">
230                   <md-menu>
231                     <md-button
232                       class="md-icon-button"
233                       aria-label="More"
234                       translate
235                       translate-attr-aria-label="INTEGRATIONS.MORE"
236                       ng-click="$mdMenu.open($event)"
237                     >
238                       <md-icon md-font-icon="icon-dots-vertical"></md-icon>
239                     </md-button>
240
241                     <md-menu-content width="3">
242                       <!-- SUBACTIONS -->
243
244                       <!-- ACTIONS -->
245
246                       <md-menu-item ng-if="vm.crudPermissions.canEdit">
247                         <md-button
248                           ng-click="vm.editstate(zendeskAccount, $event    )"
249                           translate="INTEGRATIONS.EDIT_ZENDESKACCOUNT"
250                         >
251                           Edit ZendeskAccount
252                         </md-button>
253                       </md-menu-item>
254
255                       <!-- SUBACTIONS -->
256
257                       <!-- ACTIONS -->
258
259                       <md-menu-item>
260                         <md-button
261                           ng-click="vm.testtestintegrationaccount(zendeskAccount, $event    )"
262                           translate="INTEGRATIONS.TEST_ZENDESKACCOUNT"
263                         >
264                           Test ZendeskAccount
265                         </md-button>
266                       </md-menu-item>
267
268                       <!-- SUBACTIONS -->
269
270                       <!-- ACTIONS -->
271
272                       <md-menu-item ng-if="vm.crudPermissions.canDelete">
273                         <md-button
274                           ng-click="vm.deleteconfirm(zendeskAccount, $event    )"
275                           translate="INTEGRATIONS.DELETE_ZENDESKACCOUNT"
276                         >
277                           Delete ZendeskAccount
278                         </md-button>
279                       </md-menu-item>
280                     </md-menu-content>
281                   </md-menu>
282                 </td>
283               </tr>
284             </tbody>
285           </table>
286         </md-table-container>
287
288         <md-table-pagination
289           md-label="{page: '{{'INTEGRATIONS.PAGE' | translate}}:', rowsPerPage: '{{'INTEGRATIONS.ROWSPERPAGE' | translate}}:', of: '{{'INTEGRATIONS.OF' | translate}}'}"
290           md-limit="vm.query.limit"
291           md-limit-options="[10, 15, 20, 50, 100, 250]"
292           md-page="vm.query.page"
293           md-total="{{vm.zendeskAccounts.count}}"
294           md-on-paginate="vm.getZendeskAccounts"
295           md-page-select
296         ></md-table-pagination>
297       </md-card>
298       <!-- / ZENDESKACCOUNT TABLE -->
299       <!-- NO RESULTS -->
300
301       <!-- / NO RESULTS -->
302     </div>
303     <!-- / MAIN -->
304   </div>
305   <!-- / CONTENT -->
306
307   <!-- ADD ZENDESKACCOUNT BUTTON -->
308   <md-button
309     ng-if="vm.crudPermissions.canEdit"
310     class="md-fab md-accent add-item-button"
311     id="add-zendeskAccount-button"
312     ng-click="vm.createOrEditZendeskAccount($event)"
313     aria-label="add zendeskAccount"
314     translate
315     translate-attr-aria-label="INTEGRATIONS.ADD_ZENDESKACCOUNT"
316   >
317     <md-icon md-font-icon="icon-plus"></md-icon>
318   </md-button>
319   <!-- / ADD ZENDESKACCOUNT BUTTON -->
320 </div>