0f3e9fd50b0770ce01f9bda2b89c74f04008f25d
[motion-next.git] /
1 <div id="whatsappAccounts" class="page-layout simple left-sidenav inner-sidenav motion-list">
2   <!-- HEADER -->
3   <div class="header md-accent-bg" layout="row" layout-align="space-between center">
4     <!-- APP TITLE -->
5     <div layout="row" layout-align="start center">
6       <div class="logo" layout="row" layout-align="start center">
7         <span class="logo-icon">
8           <md-icon md-font-icon="icon-whatsapp" class="s24"></md-icon>
9         </span>
10         <span class="logo-text" translate="WHATSAPP.WHATSAPPACCOUNTS">WhatsappAccounts</span>
11       </div>
12     </div>
13     <!-- / APP TITLE -->
14
15     <div layout="row">
16       <!-- SEARCH -->
17       <div class="search-input-wrapper" layout="row" layout-align="start center">
18         <label for="search">
19           <md-icon md-font-icon="icon-magnify"></md-icon>
20         </label>
21         <md-input-container md-no-float class="m-0">
22           <input id="search" placeholder="Search for anyone" type="text" ng-model="vm.query.filter"
23             ng-model-options="{ debounce: 1000 }" translate translate-attr-placeholder="APP.SEARCH_FOR_ANYONE" />
24         </md-input-container>
25       </div>
26       <!-- / SEARCH -->
27     </div>
28   </div>
29   <!-- / HEADER -->
30
31   <!-- SELECTED BAR -->
32   <div ng-show="vm.selectedWhatsappAccounts.length > 0" class="selected-bar header animate-slide-down md-accent-bg"
33     layout="row" layout-align="start center">
34     <div class="close-button-wrapper" ng-click="vm.selectedWhatsappAccounts =[]">
35       <md-button layout="row" layout-align="start center">
36         <md-icon md-font-icon="icon-arrow-left" class="mr-8"></md-icon>
37         <span translate="APP.BACK">Back</span>
38       </md-button>
39     </div>
40
41     <div flex layout="row" layout-align="space-between center">
42       <div>
43         <span class="selected-whatsappAccounts-count">
44           <span>{{vm.selectedWhatsappAccounts.length}}</span>
45           <span translate="APP.SELECTED">selected</span>
46         </span>
47
48         <md-menu class="select-menu" ng-if="!vm.currentThread">
49           <md-button class="md-icon-button" ng-click="$mdMenu.open($event)" aria-label="multi select toggle" translate
50             translate-attr-aria-label="WHATSAPP.MULTI_SELECT_TOGGLE">
51             <md-icon md-font-icon="icon-menu-down"></md-icon>
52           </md-button>
53           <md-menu-content width="3">
54             <md-menu-item>
55               <md-button ng-click="vm.selectAllWhatsappAccounts()" translate="APP.SELECT_ALL">
56                 Select all
57               </md-button>
58             </md-menu-item>
59             <md-menu-item>
60               <md-button ng-click="vm.deselectWhatsappAccounts()" translate="APP.SELECT_NONE">
61                 Select none
62               </md-button>
63             </md-menu-item>
64           </md-menu-content>
65         </md-menu>
66       </div>
67
68       <div class="multi-select-actions">
69         <button class="md-icon-button" ng-csv="vm.exportSelectedWhatsappAccounts" csv-label="true"
70           filename="whatsappAccounts.csv">
71           <md-icon md-font-icon="icon-file-excel"></md-icon>
72         </button>
73         <md-button class="md-icon-button" ng-if="vm.crudPermissions.canDelete"
74           ng-click="vm.deleteSelectedWhatsappAccounts($event)" aria-label="delete selected" translate
75           translate-attr-label="APP.DELETE_SELECTED">
76           <md-icon md-font-icon="icon-delete"></md-icon>
77         </md-button>
78       </div>
79     </div>
80   </div>
81   <!-- / SELECTED BAR -->
82
83   <!-- CONTENT -->
84   <div class="content" md-background-bg layout="row" layout-align="start start">
85     <!-- MAIN -->
86     <div class="main scrollable" ms-scroll>
87       <!-- WHATSAPPACCOUNT TABLE -->
88       <md-card>
89         <md-table-container>
90           <table md-table md-row-select multiple ng-model="vm.selectedWhatsappAccounts" md-progress="vm.promise">
91             <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getWhatsappAccounts">
92               <tr md-row>
93                 <th md-column ng-if="vm.table == 'users' || vm.table == 'agents'" width="20px"></th>
94                 <th md-column md-order-by="id">{{ 'APP.ID' | translate }}</th>
95                 <th md-column md-order-by="name">
96                   {{ 'APP.NAME' | translate }}
97                 </th>
98                 <th md-column md-order-by="key">{{ 'APP.KEY' | translate }}</th>
99                 <th md-column md-order-by="ListId">
100                   {{ 'APP.LIST' | translate }}
101                 </th>
102                 <th md-column md-order-by="type">
103                   {{ 'APP.TYPE' | translate }}
104                 </th>
105                 <th md-column md-order-by="phone">
106                   {{ 'APP.PHONE' | translate }}
107                 </th>
108                 <th md-column md-order-by="description">
109                   {{ 'APP.DESCRIPTION' | translate }}
110                 </th>
111                 <th md-column width="10px"></th>
112               </tr>
113             </thead>
114             <tbody md-body>
115               <tr md-row ng-hide="vm.whatsappAccounts.rows.length">
116                 <td md-cell colspan="8">
117                   <div layout="row" layout-align="center center">
118                     <span translate="APP.NO_AVAILABLE_INFO">No Available Info</span>
119                   </div>
120                 </td>
121               </tr>
122               <tr md-row md-select="whatsappAccount" md-select-id="id"
123                 ng-repeat="whatsappAccount in vm.whatsappAccounts.rows">
124                 <td md-cell ng-if="whatsappAccount.userpic">
125                   <img class="avatar" alt="{{whatsappAccount.name}}" ng-src="api/users/{{whatsappAccount.id}}/avatar" />
126                 </td>
127                 <td md-cell ng-if="!whatsappAccount.userpic && (vm.table == 'users' || vm.table == 'agents')">
128                   <img class="avatar" alt="{{whatsappAccount.name}}" ng-src="assets/images/avatars/profile.png" />
129                 </td>
130                 <td
131                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)"
132                   md-cell class="id">
133                   {{whatsappAccount.id}}
134                 </td>
135                 <td
136                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)"
137                   md-cell class="name">
138                   {{whatsappAccount.name}}
139                 </td>
140                 <td
141                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)"
142                   md-cell class="key">
143                   {{whatsappAccount.key}}
144                 </td>
145                 <td
146                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)"
147                   md-cell class="ListId">
148                   {{ (vm.lists | filter : {'id':whatsappAccount.ListId} :
149                   true)[0].name }}
150                 </td>
151                 <td
152                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)"
153                   md-cell class="type">
154                   {{ vm.arraytype[whatsappAccount.type].option }}
155                 </td>
156                 <td
157                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)"
158                   md-cell class="phone">
159                   {{whatsappAccount.phone}}
160                 </td>
161                 <td
162                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappAccount, ev) : vm.createOrEditWhatsappAccount($event, whatsappAccount)"
163                   md-cell class="description">
164                   {{whatsappAccount.description}}
165                 </td>
166
167                 <td md-cell class="actions">
168                   <md-menu>
169                     <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="APP.MORE"
170                       ng-click="$mdMenu.open($event)">
171                       <md-icon md-font-icon="icon-dots-vertical"></md-icon>
172                     </md-button>
173
174                     <md-menu-content width="3">
175                       <!-- SUBACTIONS -->
176
177                       <!-- ACTIONS -->
178
179                       <md-menu-item ng-if="vm.crudPermissions.canEdit">
180                         <md-button ng-click="vm.editstate(whatsappAccount, $event    )"
181                           translate="WHATSAPP.EDIT_WHATSAPPACCOUNT">
182                           Edit WhatsappAccount
183                         </md-button>
184                       </md-menu-item>
185
186                       <!-- SUBACTIONS -->
187
188                       <!-- ACTIONS -->
189
190                       <md-menu-item>
191                         <md-button ng-click="vm.interactionsgoto(whatsappAccount, $event    )"
192                           translate="WHATSAPP.INTERACTIONS_WHATSAPPACCOUNT">
193                           Interactions WhatsappAccount
194                         </md-button>
195                       </md-menu-item>
196
197                       <!-- SUBACTIONS -->
198
199                       <!-- ACTIONS -->
200
201                       <md-menu-item>
202                         <md-button ng-click="vm.agentadddialog(whatsappAccount, $event    )"
203                           translate="WHATSAPP.AGENTADD_WHATSAPPACCOUNT">
204                           AgentAdd WhatsappAccount
205                         </md-button>
206                       </md-menu-item>
207
208                       <!-- SUBACTIONS -->
209
210                       <!-- ACTIONS -->
211
212                       <md-menu-item ng-if="vm.crudPermissions.canDelete">
213                         <md-button ng-click="vm.deleteconfirm(whatsappAccount, $event    )"
214                           translate="WHATSAPP.DELETE_WHATSAPPACCOUNT">
215                           Delete WhatsappAccount
216                         </md-button>
217                       </md-menu-item>
218                     </md-menu-content>
219                   </md-menu>
220                 </td>
221               </tr>
222             </tbody>
223           </table>
224         </md-table-container>
225
226         <md-table-pagination
227           md-label="{page: '{{'APP.PAGE' | translate}}:', rowsPerPage: '{{'APP.ROWSPERPAGE' | translate}}:', of: '{{'APP.OF' | translate}}'}"
228           md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"
229           md-total="{{vm.whatsappAccounts.count}}" md-on-paginate="vm.getWhatsappAccounts" md-page-select>
230         </md-table-pagination>
231       </md-card>
232       <!-- / WHATSAPPACCOUNT TABLE -->
233       <!-- NO RESULTS -->
234
235       <!-- / NO RESULTS -->
236     </div>
237     <!-- / MAIN -->
238   </div>
239   <!-- / CONTENT -->
240
241   <!-- ADD WHATSAPPACCOUNT BUTTON -->
242   <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent add-item-button" id="add-whatsappAccount-button"
243     ng-click="vm.createOrEditWhatsappAccount($event)" aria-label="add whatsappAccount" translate
244     translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPACCOUNT">
245     <md-icon md-font-icon="icon-plus"></md-icon>
246   </md-button>
247   <!-- / ADD WHATSAPPACCOUNT BUTTON -->
248 </div>