3614c8d4caf0cb10cd0a14c49e6bc0fa6aa55df2
[motion-next.git] /
1 <div
2   id="whatsappQueues"
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-whatsapp" class="s24"></md-icon>
16         </span>
17         <span class="logo-text" translate="WHATSAPP.WHATSAPPQUEUES"
18           >WhatsappQueues</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="WHATSAPP.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.selectedWhatsappQueues.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.selectedWhatsappQueues =[]">
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="WHATSAPP.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-whatsappQueues-count">
68           <span>{{vm.selectedWhatsappQueues.length}}</span>
69           <span translate="WHATSAPP.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="WHATSAPP.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.selectAllWhatsappQueues()"
86                 translate="WHATSAPP.SELECT_ALL"
87               >
88                 Select all
89               </md-button>
90             </md-menu-item>
91             <md-menu-item>
92               <md-button
93                 ng-click="vm.deselectWhatsappQueues()"
94                 translate="WHATSAPP.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.exportSelectedWhatsappQueues"
107           csv-label="true"
108           filename="whatsappQueues.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.deleteSelectedWhatsappQueues($event)"
116           aria-label="delete selected"
117           translate
118           translate-attr-label="WHATSAPP.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       <!-- WHATSAPPQUEUE TABLE -->
132       <md-card>
133         <md-table-container>
134           <table
135             md-table
136             md-row-select
137             multiple
138             ng-model="vm.selectedWhatsappQueues"
139             md-progress="vm.promise"
140           >
141             <thead
142               md-head
143               md-order="vm.query.sort"
144               md-on-reorder="vm.getWhatsappQueues"
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                   {{ 'WHATSAPP.ID' | translate }}
154                 </th>
155                 <th md-column md-order-by="name">
156                   {{ 'WHATSAPP.NAME' | translate }}
157                 </th>
158                 <th md-column md-order-by="strategy">
159                   {{ 'WHATSAPP.STRATEGY' | translate }}
160                 </th>
161                 <th md-column width="10px"></th>
162               </tr>
163             </thead>
164             <tbody md-body>
165               <tr md-row ng-hide="vm.whatsappQueues.rows.length">
166                 <td md-cell colspan="4">
167                   <div layout="row" layout-align="center center">
168                     <span translate="WHATSAPP.NO_AVAILABLE_INFO"
169                       >No Available Info</span
170                     >
171                   </div>
172                 </td>
173               </tr>
174               <tr
175                 md-row
176                 md-select="whatsappQueue"
177                 md-select-id="id"
178                 ng-repeat="whatsappQueue in vm.whatsappQueues.rows"
179               >
180                 <td md-cell ng-if="whatsappQueue.userpic">
181                   <img
182                     class="avatar"
183                     alt="{{whatsappQueue.name}}"
184                     ng-src="api/users/{{whatsappQueue.id}}/avatar"
185                   />
186                 </td>
187                 <td
188                   md-cell
189                   ng-if="!whatsappQueue.userpic && (vm.table == 'users' || vm.table == 'agents')"
190                 >
191                   <img
192                     class="avatar"
193                     alt="{{whatsappQueue.name}}"
194                     ng-src="assets/images/avatars/profile.png"
195                   />
196                 </td>
197                 <td
198                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)"
199                   md-cell
200                   class="id"
201                 >
202                   {{whatsappQueue.id}}
203                 </td>
204                 <td
205                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)"
206                   md-cell
207                   class="name"
208                 >
209                   {{whatsappQueue.name}}
210                 </td>
211                 <td
212                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)"
213                   md-cell
214                   class="strategy"
215                 >
216                   {{ vm.arraystrategy[whatsappQueue.strategy].option }}
217                 </td>
218
219                 <td md-cell class="actions">
220                   <md-menu>
221                     <md-button
222                       class="md-icon-button"
223                       aria-label="More"
224                       translate
225                       translate-attr-aria-label="WHATSAPP.MORE"
226                       ng-click="$mdMenu.open($event)"
227                     >
228                       <md-icon md-font-icon="icon-dots-vertical"></md-icon>
229                     </md-button>
230
231                     <md-menu-content width="3">
232                       <!-- SUBACTIONS -->
233
234                       <!-- ACTIONS -->
235
236                       <md-menu-item ng-if="vm.crudPermissions.canEdit">
237                         <md-button
238                           ng-click="vm.editstate(whatsappQueue, $event    )"
239                           translate="WHATSAPP.EDIT_WHATSAPPQUEUE"
240                         >
241                           Edit WhatsappQueue
242                         </md-button>
243                       </md-menu-item>
244
245                       <!-- SUBACTIONS -->
246
247                       <!-- ACTIONS -->
248
249                       <md-menu-item>
250                         <md-button
251                           ng-click="vm.teamadddialog(whatsappQueue, $event    )"
252                           translate="WHATSAPP.TEAMADD_WHATSAPPQUEUE"
253                         >
254                           teamadd WhatsappQueue
255                         </md-button>
256                       </md-menu-item>
257
258                       <!-- SUBACTIONS -->
259
260                       <!-- ACTIONS -->
261
262                       <md-menu-item>
263                         <md-button
264                           ng-click="vm.agentadddialog(whatsappQueue, $event    )"
265                           translate="WHATSAPP.AGENTADD_WHATSAPPQUEUE"
266                         >
267                           agentadd WhatsappQueue
268                         </md-button>
269                       </md-menu-item>
270
271                       <!-- SUBACTIONS -->
272
273                       <!-- ACTIONS -->
274
275                       <md-menu-item ng-if="vm.crudPermissions.canDelete">
276                         <md-button
277                           ng-click="vm.deleteconfirm(whatsappQueue, $event    )"
278                           translate="WHATSAPP.DELETE_WHATSAPPQUEUE"
279                         >
280                           Delete WhatsappQueue
281                         </md-button>
282                       </md-menu-item>
283
284                       <!-- SUBACTIONS -->
285
286                       <!-- ACTIONS -->
287
288                       <md-menu-item>
289                         <md-button
290                           ng-click="vm.gotorealtimegoto(whatsappQueue, $event    )"
291                           translate="WHATSAPP.GOTOREALTIME_WHATSAPPQUEUE"
292                         >
293                           goToRealtime WhatsappQueue
294                         </md-button>
295                       </md-menu-item>
296                     </md-menu-content>
297                   </md-menu>
298                 </td>
299               </tr>
300             </tbody>
301           </table>
302         </md-table-container>
303
304         <md-table-pagination
305           md-label="{page: '{{'WHATSAPP.PAGE' | translate}}:', rowsPerPage: '{{'WHATSAPP.ROWSPERPAGE' | translate}}:', of: '{{'WHATSAPP.OF' | translate}}'}"
306           md-limit="vm.query.limit"
307           md-limit-options="[10, 15, 20, 50, 100, 250]"
308           md-page="vm.query.page"
309           md-total="{{vm.whatsappQueues.count}}"
310           md-on-paginate="vm.getWhatsappQueues"
311           md-page-select
312         ></md-table-pagination>
313       </md-card>
314       <!-- / WHATSAPPQUEUE TABLE -->
315       <!-- NO RESULTS -->
316
317       <!-- / NO RESULTS -->
318     </div>
319     <!-- / MAIN -->
320   </div>
321   <!-- / CONTENT -->
322
323   <!-- ADD WHATSAPPQUEUE BUTTON -->
324   <md-button
325     ng-if="vm.crudPermissions.canEdit"
326     class="md-fab md-accent add-item-button"
327     id="add-whatsappQueue-button"
328     ng-click="vm.createOrEditWhatsappQueue($event)"
329     aria-label="add whatsappQueue"
330     translate
331     translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPQUEUE"
332   >
333     <md-icon md-font-icon="icon-plus"></md-icon>
334   </md-button>
335   <!-- / ADD WHATSAPPQUEUE BUTTON -->
336 </div>