caf25b5ac666d99257547af939f34fd5ed91de63
[motion-next.git] /
1 <div id="whatsappQueues" 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.WHATSAPPQUEUES">WhatsappQueues</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.selectedWhatsappQueues.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.selectedWhatsappQueues =[]">
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-whatsappQueues-count">
44           <span>{{vm.selectedWhatsappQueues.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.selectAllWhatsappQueues()" translate="APP.SELECT_ALL">
56                 Select all
57               </md-button>
58             </md-menu-item>
59             <md-menu-item>
60               <md-button ng-click="vm.deselectWhatsappQueues()" 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.exportSelectedWhatsappQueues" csv-label="true"
70           filename="whatsappQueues.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.deleteSelectedWhatsappQueues($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       <!-- WHATSAPPQUEUE TABLE -->
88       <md-card>
89         <md-table-container>
90           <table md-table md-row-select multiple ng-model="vm.selectedWhatsappQueues" md-progress="vm.promise">
91             <thead md-head md-order="vm.query.sort" md-on-reorder="vm.getWhatsappQueues">
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="strategy">
99                   {{ 'APP.STRATEGY' | translate }}
100                 </th>
101                 <th md-column width="10px"></th>
102               </tr>
103             </thead>
104             <tbody md-body>
105               <tr md-row ng-hide="vm.whatsappQueues.rows.length">
106                 <td md-cell colspan="4">
107                   <div layout="row" layout-align="center center">
108                     <span translate="APP.NO_AVAILABLE_INFO">No Available Info</span>
109                   </div>
110                 </td>
111               </tr>
112               <tr md-row md-select="whatsappQueue" md-select-id="id"
113                 ng-repeat="whatsappQueue in vm.whatsappQueues.rows">
114                 <td md-cell ng-if="whatsappQueue.userpic">
115                   <img class="avatar" alt="{{whatsappQueue.name}}" ng-src="api/users/{{whatsappQueue.id}}/avatar" />
116                 </td>
117                 <td md-cell ng-if="!whatsappQueue.userpic && (vm.table == 'users' || vm.table == 'agents')">
118                   <img class="avatar" alt="{{whatsappQueue.name}}" ng-src="assets/images/avatars/profile.png" />
119                 </td>
120                 <td
121                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)"
122                   md-cell class="id">
123                   {{whatsappQueue.id}}
124                 </td>
125                 <td
126                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)"
127                   md-cell class="name">
128                   {{whatsappQueue.name}}
129                 </td>
130                 <td
131                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(whatsappQueue, ev) : vm.createOrEditWhatsappQueue($event, whatsappQueue)"
132                   md-cell class="strategy">
133                   {{ vm.arraystrategy[whatsappQueue.strategy].option }}
134                 </td>
135
136                 <td md-cell class="actions">
137                   <md-menu>
138                     <md-button class="md-icon-button" aria-label="More" translate translate-attr-aria-label="APP.MORE"
139                       ng-click="$mdMenu.open($event)">
140                       <md-icon md-font-icon="icon-dots-vertical"></md-icon>
141                     </md-button>
142
143                     <md-menu-content width="3">
144                       <!-- SUBACTIONS -->
145
146                       <!-- ACTIONS -->
147
148                       <md-menu-item ng-if="vm.crudPermissions.canEdit">
149                         <md-button ng-click="vm.editstate(whatsappQueue, $event    )"
150                           translate="WHATSAPP.EDIT_WHATSAPPQUEUE">
151                           Edit WhatsappQueue
152                         </md-button>
153                       </md-menu-item>
154
155                       <!-- SUBACTIONS -->
156
157                       <!-- ACTIONS -->
158
159                       <md-menu-item>
160                         <md-button ng-click="vm.teamadddialog(whatsappQueue, $event    )"
161                           translate="WHATSAPP.TEAMADD_WHATSAPPQUEUE">
162                           teamadd WhatsappQueue
163                         </md-button>
164                       </md-menu-item>
165
166                       <!-- SUBACTIONS -->
167
168                       <!-- ACTIONS -->
169
170                       <md-menu-item>
171                         <md-button ng-click="vm.agentadddialog(whatsappQueue, $event    )"
172                           translate="WHATSAPP.AGENTADD_WHATSAPPQUEUE">
173                           agentadd WhatsappQueue
174                         </md-button>
175                       </md-menu-item>
176
177                       <!-- SUBACTIONS -->
178
179                       <!-- ACTIONS -->
180
181                       <md-menu-item ng-if="vm.crudPermissions.canDelete">
182                         <md-button ng-click="vm.deleteconfirm(whatsappQueue, $event    )"
183                           translate="WHATSAPP.DELETE_WHATSAPPQUEUE">
184                           Delete WhatsappQueue
185                         </md-button>
186                       </md-menu-item>
187
188                       <!-- SUBACTIONS -->
189
190                       <!-- ACTIONS -->
191
192                       <md-menu-item>
193                         <md-button ng-click="vm.gotorealtimegoto(whatsappQueue, $event    )"
194                           translate="WHATSAPP.GOTOREALTIME_WHATSAPPQUEUE">
195                           goToRealtime WhatsappQueue
196                         </md-button>
197                       </md-menu-item>
198                     </md-menu-content>
199                   </md-menu>
200                 </td>
201               </tr>
202             </tbody>
203           </table>
204         </md-table-container>
205
206         <md-table-pagination
207           md-label="{page: '{{'APP.PAGE' | translate}}:', rowsPerPage: '{{'APP.ROWSPERPAGE' | translate}}:', of: '{{'APP.OF' | translate}}'}"
208           md-limit="vm.query.limit" md-limit-options="[10, 15, 20, 50, 100, 250]" md-page="vm.query.page"
209           md-total="{{vm.whatsappQueues.count}}" md-on-paginate="vm.getWhatsappQueues" md-page-select>
210         </md-table-pagination>
211       </md-card>
212       <!-- / WHATSAPPQUEUE TABLE -->
213       <!-- NO RESULTS -->
214
215       <!-- / NO RESULTS -->
216     </div>
217     <!-- / MAIN -->
218   </div>
219   <!-- / CONTENT -->
220
221   <!-- ADD WHATSAPPQUEUE BUTTON -->
222   <md-button ng-if="vm.crudPermissions.canEdit" class="md-fab md-accent add-item-button" id="add-whatsappQueue-button"
223     ng-click="vm.createOrEditWhatsappQueue($event)" aria-label="add whatsappQueue" translate
224     translate-attr-aria-label="WHATSAPP.ADD_WHATSAPPQUEUE">
225     <md-icon md-font-icon="icon-plus"></md-icon>
226   </md-button>
227   <!-- / ADD WHATSAPPQUEUE BUTTON -->
228 </div>