3211cb242ab91a63ecd2a4cea51b5fae69ead370
[motion-next.git] /
1 <div
2   id="whatsappAccounts"
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.WHATSAPPACCOUNTS"
18           >WhatsappAccounts</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.selectedWhatsappAccounts.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.selectedWhatsappAccounts =[]"
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="WHATSAPP.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-whatsappAccounts-count">
71           <span>{{vm.selectedWhatsappAccounts.length}}</span>
72           <span translate="WHATSAPP.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="WHATSAPP.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.selectAllWhatsappAccounts()"
89                 translate="WHATSAPP.SELECT_ALL"
90               >
91                 Select all
92               </md-button>
93             </md-menu-item>
94             <md-menu-item>
95               <md-button
96                 ng-click="vm.deselectWhatsappAccounts()"
97                 translate="WHATSAPP.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.exportSelectedWhatsappAccounts"
110           csv-label="true"
111           filename="whatsappAccounts.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.deleteSelectedWhatsappAccounts($event)"
119           aria-label="delete selected"
120           translate
121           translate-attr-label="WHATSAPP.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       <!-- WHATSAPPACCOUNT TABLE -->
135       <md-card>
136         <md-table-container>
137           <table
138             md-table
139             md-row-select
140             multiple
141             ng-model="vm.selectedWhatsappAccounts"
142             md-progress="vm.promise"
143           >
144             <thead
145               md-head
146               md-order="vm.query.sort"
147               md-on-reorder="vm.getWhatsappAccounts"
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                   {{ 'WHATSAPP.ID' | translate }}
157                 </th>
158                 <th md-column md-order-by="name">
159                   {{ 'WHATSAPP.NAME' | translate }}
160                 </th>
161                 <th md-column md-order-by="key">
162                   {{ 'WHATSAPP.KEY' | translate }}
163                 </th>
164                 <th md-column md-order-by="ListId">
165                   {{ 'WHATSAPP.LIST' | translate }}
166                 </th>
167                 <th md-column md-order-by="type">
168                   {{ 'WHATSAPP.TYPE' | translate }}
169                 </th>
170                 <th md-column md-order-by="phone">
171                   {{ 'WHATSAPP.PHONE' | translate }}
172                 </th>
173                 <th md-column md-order-by="description">
174                   {{ 'WHATSAPP.DESCRIPTION' | translate }}
175                 </th>
176                 <th md-column width="10px"></th>
177               </tr>
178             </thead>
179             <tbody md-body>
180               <tr md-row ng-hide="vm.whatsappAccounts.rows.length">
181                 <td md-cell colspan="8">
182                   <div layout="row" layout-align="center center">
183                     <span translate="WHATSAPP.NO_AVAILABLE_INFO"
184                       >No Available Info</span
185                     >
186                   </div>
187                 </td>
188               </tr>
189               <tr
190                 md-row
191                 md-select="whatsappAccount"
192                 md-select-id="id"
193                 ng-repeat="whatsappAccount in vm.whatsappAccounts.rows"
194               >
195                 <td md-cell ng-if="whatsappAccount.userpic">
196                   <img
197                     class="avatar"
198                     alt="{{whatsappAccount.name}}"
199                     ng-src="api/users/{{whatsappAccount.id}}/avatar"
200                   />
201                 </td>
202                 <td
203                   md-cell
204                   ng-if="!whatsappAccount.userpic && (vm.table == 'users' || vm.table == 'agents')"
205                 >
206                   <img
207                     class="avatar"
208                     alt="{{whatsappAccount.name}}"
209                     ng-src="assets/images/avatars/profile.png"
210                   />
211                 </td>
212                 <td
213                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)"
214                   md-cell
215                   class="id"
216                 >
217                   {{whatsappAccount.id}}
218                 </td>
219                 <td
220                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)"
221                   md-cell
222                   class="name"
223                 >
224                   {{whatsappAccount.name}}
225                 </td>
226                 <td
227                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)"
228                   md-cell
229                   class="key"
230                 >
231                   {{whatsappAccount.key}}
232                 </td>
233                 <td
234                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)"
235                   md-cell
236                   class="ListId"
237                 >
238                   {{ (vm.lists | filter : {'id':whatsappAccount.ListId} :
239                   true)[0].name }}
240                 </td>
241                 <td
242                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)"
243                   md-cell
244                   class="type"
245                 >
246                   {{ vm.arraytype[whatsappAccount.type].option }}
247                 </td>
248                 <td
249                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)"
250                   md-cell
251                   class="phone"
252                 >
253                   {{whatsappAccount.phone}}
254                 </td>
255                 <td
256                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)"
257                   md-cell
258                   class="description"
259                 >
260                   {{whatsappAccount.description}}
261                 </td>
262
263                 <td md-cell class="actions">
264                   <md-menu>
265                     <md-button
266                       class="md-icon-button"
267                       aria-label="More"
268                       translate
269                       translate-attr-aria-label="WHATSAPP.MORE"
270                       ng-click="$mdMenu.open($event)"
271                     >
272                       <md-icon md-font-icon="icon-dots-vertical"></md-icon>
273                     </md-button>
274
275                     <md-menu-content width="3">
276                       <!-- SUBACTIONS -->
277
278                       <!-- ACTIONS -->
279
280                       <md-menu-item ng-if="vm.crudPermissions.canEdit">
281                         <md-button
282                           ng-click="vm.editstate(whatsappAccount, $event    )"
283                           translate="WHATSAPP.EDIT_WHATSAPPACCOUNT"
284                         >
285                           Edit WhatsappAccount
286                         </md-button>
287                       </md-menu-item>
288
289                       <!-- SUBACTIONS -->
290
291                       <!-- ACTIONS -->
292
293                       <md-menu-item>
294                         <md-button
295                           ng-click="vm.interactionsgoto(whatsappAccount, $event    )"
296                           translate="WHATSAPP.INTERACTIONS_WHATSAPPACCOUNT"
297                         >
298                           Interactions WhatsappAccount
299                         </md-button>
300                       </md-menu-item>
301
302                       <!-- SUBACTIONS -->
303
304                       <!-- ACTIONS -->
305
306                       <md-menu-item>
307                         <md-button
308                           ng-click="vm.agentadddialog(whatsappAccount, $event    )"
309                           translate="WHATSAPP.AGENTADD_WHATSAPPACCOUNT"
310                         >
311                           AgentAdd WhatsappAccount
312                         </md-button>
313                       </md-menu-item>
314
315                       <!-- SUBACTIONS -->
316
317                       <!-- ACTIONS -->
318
319                       <md-menu-item ng-if="vm.crudPermissions.canDelete">
320                         <md-button
321                           ng-click="vm.deleteconfirm(whatsappAccount, $event    )"
322                           translate="WHATSAPP.DELETE_WHATSAPPACCOUNT"
323                         >
324                           Delete WhatsappAccount
325                         </md-button>
326                       </md-menu-item>
327                     </md-menu-content>
328                   </md-menu>
329                 </td>
330               </tr>
331             </tbody>
332           </table>
333         </md-table-container>
334
335         <md-table-pagination
336           md-label="{page: '{{'WHATSAPP.PAGE' | translate}}:', rowsPerPage: '{{'WHATSAPP.ROWSPERPAGE' | translate}}:', of: '{{'WHATSAPP.OF' | translate}}'}"
337           md-limit="vm.query.limit"
338           md-limit-options="[10, 15, 20, 50, 100, 250]"
339           md-page="vm.query.page"
340           md-total="{{vm.whatsappAccounts.count}}"
341           md-on-paginate="vm.getWhatsappAccounts"
342           md-page-select
343         ></md-table-pagination>
344       </md-card>
345       <!-- / WHATSAPPACCOUNT TABLE -->
346       <!-- NO RESULTS -->
347
348       <!-- / NO RESULTS -->
349     </div>
350     <!-- / MAIN -->
351   </div>
352   <!-- / CONTENT -->
353
354   <!-- ADD WHATSAPPACCOUNT BUTTON -->
355   <md-button
356     ng-if="vm.crudPermissions.canEdit"
357     class="md-fab md-accent add-item-button"
358     id="add-whatsappAccount-button"
359     ng-click="vm.createOrEditWhatsappAccount($event)"
360     aria-label="add whatsappAccount"
361     translate
362     translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPACCOUNT"
363   >
364     <md-icon md-font-icon="icon-plus"></md-icon>
365   </md-button>
366   <!-- / ADD WHATSAPPACCOUNT BUTTON -->
367 </div>