87e1fba30ac444eb026d757c55e1c852a463e929
[motion-next.git] /
1 <div
2   id="chatWebsites"
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-hangouts" class="s24"></md-icon>
16         </span>
17         <span class="logo-text" translate="CHAT.CHATWEBSITES"
18           >ChatWebsites</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="CHAT.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.selectedChatWebsites.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.selectedChatWebsites =[]">
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="CHAT.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-chatWebsites-count">
68           <span>{{vm.selectedChatWebsites.length}}</span>
69           <span translate="CHAT.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="CHAT.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.selectAllChatWebsites()"
86                 translate="CHAT.SELECT_ALL"
87               >
88                 Select all
89               </md-button>
90             </md-menu-item>
91             <md-menu-item>
92               <md-button
93                 ng-click="vm.deselectChatWebsites()"
94                 translate="CHAT.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.exportSelectedChatWebsites"
107           csv-label="true"
108           filename="chatWebsites.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.deleteSelectedChatWebsites($event)"
116           aria-label="delete selected"
117           translate
118           translate-attr-label="CHAT.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       <!-- CHATWEBSITE TABLE -->
132       <md-card>
133         <md-table-container>
134           <table
135             md-table
136             md-row-select
137             multiple
138             ng-model="vm.selectedChatWebsites"
139             md-progress="vm.promise"
140           >
141             <thead
142               md-head
143               md-order="vm.query.sort"
144               md-on-reorder="vm.getChatWebsites"
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">{{ 'CHAT.ID' | translate }}</th>
153                 <th md-column md-order-by="name">
154                   {{ 'CHAT.NAME' | translate }}
155                 </th>
156                 <th md-column md-order-by="key">
157                   {{ 'CHAT.KEY' | translate }}
158                 </th>
159                 <th md-column md-order-by="address">
160                   {{ 'CHAT.MOTIONADDRESS' | translate }}
161                 </th>
162                 <th md-column md-order-by="remote">
163                   {{ 'CHAT.MOTIONPROXY' | translate }}
164                 </th>
165                 <th md-column md-order-by="description">
166                   {{ 'CHAT.DESCRIPTION' | translate }}
167                 </th>
168                 <th md-column width="10px"></th>
169               </tr>
170             </thead>
171             <tbody md-body>
172               <tr md-row ng-hide="vm.chatWebsites.rows.length">
173                 <td md-cell colspan="7">
174                   <div layout="row" layout-align="center center">
175                     <span translate="CHAT.NO_AVAILABLE_INFO"
176                       >No Available Info</span
177                     >
178                   </div>
179                 </td>
180               </tr>
181               <tr
182                 md-row
183                 md-select="chatWebsite"
184                 md-select-id="id"
185                 ng-repeat="chatWebsite in vm.chatWebsites.rows"
186               >
187                 <td md-cell ng-if="chatWebsite.userpic">
188                   <img
189                     class="avatar"
190                     alt="{{chatWebsite.name}}"
191                     ng-src="api/users/{{chatWebsite.id}}/avatar"
192                   />
193                 </td>
194                 <td
195                   md-cell
196                   ng-if="!chatWebsite.userpic && (vm.table == 'users' || vm.table == 'agents')"
197                 >
198                   <img
199                     class="avatar"
200                     alt="{{chatWebsite.name}}"
201                     ng-src="assets/images/avatars/profile.png"
202                   />
203                 </td>
204                 <td
205                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)"
206                   md-cell
207                   class="id"
208                 >
209                   {{chatWebsite.id}}
210                 </td>
211                 <td
212                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)"
213                   md-cell
214                   class="name"
215                 >
216                   {{chatWebsite.name}}
217                 </td>
218                 <td
219                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)"
220                   md-cell
221                   class="key"
222                 >
223                   {{chatWebsite.key}}
224                 </td>
225                 <td
226                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)"
227                   md-cell
228                   class="address"
229                 >
230                   {{chatWebsite.address}}
231                 </td>
232                 <td
233                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)"
234                   md-cell
235                   class="remote"
236                 >
237                   {{chatWebsite.remote}}
238                 </td>
239                 <td
240                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(chatWebsite, ev) : vm.createOrEditChatWebsite($event, chatWebsite)"
241                   md-cell
242                   class="description"
243                 >
244                   {{chatWebsite.description}}
245                 </td>
246
247                 <td md-cell class="actions">
248                   <md-menu>
249                     <md-button
250                       class="md-icon-button"
251                       aria-label="More"
252                       translate
253                       translate-attr-aria-label="CHAT.MORE"
254                       ng-click="$mdMenu.open($event)"
255                     >
256                       <md-icon md-font-icon="icon-dots-vertical"></md-icon>
257                     </md-button>
258
259                     <md-menu-content width="3">
260                       <!-- SUBACTIONS -->
261
262                       <!-- ACTIONS -->
263
264                       <md-menu-item ng-if="vm.crudPermissions.canEdit">
265                         <md-button
266                           ng-click="vm.editstate(chatWebsite, $event    )"
267                           translate="CHAT.EDIT_CHATWEBSITE"
268                         >
269                           Edit ChatWebsite
270                         </md-button>
271                       </md-menu-item>
272
273                       <!-- SUBACTIONS -->
274
275                       <!-- ACTIONS -->
276
277                       <md-menu-item>
278                         <md-button
279                           ng-click="vm.interactionsgoto(chatWebsite, $event    )"
280                           translate="CHAT.INTERACTIONS_CHATWEBSITE"
281                         >
282                           Interactions ChatWebsite
283                         </md-button>
284                       </md-menu-item>
285
286                       <!-- SUBACTIONS -->
287
288                       <!-- ACTIONS -->
289
290                       <md-menu-item>
291                         <md-button
292                           ng-click="vm.offlinemessagesgoto(chatWebsite, $event    )"
293                           translate="CHAT.OFFLINEMESSAGES_CHATWEBSITE"
294                         >
295                           OfflineMessages ChatWebsite
296                         </md-button>
297                       </md-menu-item>
298
299                       <!-- SUBACTIONS -->
300
301                       <!-- ACTIONS -->
302
303                       <md-menu-item>
304                         <md-button
305                           ng-click="vm.agentadddialog(chatWebsite, $event    )"
306                           translate="CHAT.AGENTADD_CHATWEBSITE"
307                         >
308                           AgentAdd ChatWebsite
309                         </md-button>
310                       </md-menu-item>
311
312                       <!-- SUBACTIONS -->
313
314                       <!-- ACTIONS -->
315
316                       <md-menu-item ng-if="vm.crudPermissions.canDelete">
317                         <md-button
318                           ng-click="vm.deleteconfirm(chatWebsite, $event    )"
319                           translate="CHAT.DELETE_CHATWEBSITE"
320                         >
321                           Delete ChatWebsite
322                         </md-button>
323                       </md-menu-item>
324                     </md-menu-content>
325                   </md-menu>
326                 </td>
327               </tr>
328             </tbody>
329           </table>
330         </md-table-container>
331
332         <md-table-pagination
333           md-label="{page: '{{'CHAT.PAGE' | translate}}:', rowsPerPage: '{{'CHAT.ROWSPERPAGE' | translate}}:', of: '{{'CHAT.OF' | translate}}'}"
334           md-limit="vm.query.limit"
335           md-limit-options="[10, 15, 20, 50, 100, 250]"
336           md-page="vm.query.page"
337           md-total="{{vm.chatWebsites.count}}"
338           md-on-paginate="vm.getChatWebsites"
339           md-page-select
340         ></md-table-pagination>
341       </md-card>
342       <!-- / CHATWEBSITE TABLE -->
343       <!-- NO RESULTS -->
344
345       <!-- / NO RESULTS -->
346     </div>
347     <!-- / MAIN -->
348   </div>
349   <!-- / CONTENT -->
350
351   <!-- ADD CHATWEBSITE BUTTON -->
352   <md-button
353     ng-if="vm.crudPermissions.canEdit"
354     class="md-fab md-accent add-item-button"
355     id="add-chatWebsite-button"
356     ng-click="vm.createOrEditChatWebsite($event)"
357     aria-label="add chatWebsite"
358     translate
359     translate-attr-aria-label="CHAT.ADD_CHATWEBSITE"
360   >
361     <md-icon md-font-icon="icon-plus"></md-icon>
362   </md-button>
363   <!-- / ADD CHATWEBSITE BUTTON -->
364 </div>