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