884bacfad195013ed6c10a4694662ff77403857f
[motion-next.git] /
1 <div
2   id="globalCustomFields"
3   class="page-layout simple left-sidenav inner-sidenav"
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-account-circle" class="s24"></md-icon>
16         </span>
17         <span class="logo-text" translate="CONTACTMANAGER.GLOBALCUSTOMFIELDS"
18           >GlobalCustomFields</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="CONTACTMANAGER.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.selectedGlobalCustomFields.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.selectedGlobalCustomFields =[]"
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="CONTACTMANAGER.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-globalCustomFields-count">
71           <span>{{vm.selectedGlobalCustomFields.length}}</span>
72           <span translate="CONTACTMANAGER.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="CONTACTMANAGER.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.selectAllGlobalCustomFields()"
89                 translate="CONTACTMANAGER.SELECT_ALL"
90               >
91                 Select all
92               </md-button>
93             </md-menu-item>
94             <md-menu-item>
95               <md-button
96                 ng-click="vm.deselectGlobalCustomFields()"
97                 translate="CONTACTMANAGER.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.exportSelectedGlobalCustomFields"
110           csv-label="true"
111           filename="globalCustomFields.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.deleteSelectedGlobalCustomFields($event)"
119           aria-label="delete selected"
120           translate
121           translate-attr-label="CONTACTMANAGER.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       <!-- GLOBALCUSTOMFIELD TABLE -->
135       <md-card>
136         <md-table-container>
137           <table
138             md-table
139             md-row-select
140             multiple
141             ng-model="vm.selectedGlobalCustomFields"
142             md-progress="vm.promise"
143           >
144             <thead
145               md-head
146               md-order="vm.query.sort"
147               md-on-reorder="vm.getGlobalCustomFields"
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                   {{ 'CONTACTMANAGER.ID' | translate }}
157                 </th>
158                 <th md-column md-order-by="alias">
159                   {{ 'CONTACTMANAGER.ALIAS' | translate }}
160                 </th>
161                 <th md-column md-order-by="type">
162                   {{ 'CONTACTMANAGER.TYPE' | translate }}
163                 </th>
164                 <th md-column md-order-by="required">
165                   {{ 'CONTACTMANAGER.REQUIRED' | translate }}
166                 </th>
167                 <th md-column width="10px"></th>
168               </tr>
169             </thead>
170             <tbody md-body>
171               <tr md-row ng-hide="vm.globalCustomFields.rows.length">
172                 <td md-cell colspan="5">
173                   <div layout="row" layout-align="center center">
174                     <span translate="CONTACTMANAGER.NO_AVAILABLE_INFO"
175                       >No Available Info</span
176                     >
177                   </div>
178                 </td>
179               </tr>
180               <tr
181                 md-row
182                 md-select="globalCustomField"
183                 md-select-id="id"
184                 ng-repeat="globalCustomField in vm.globalCustomFields.rows"
185               >
186                 <td md-cell ng-if="globalCustomField.userpic">
187                   <img
188                     class="avatar"
189                     alt="{{globalCustomField.name}}"
190                     ng-src="api/users/{{globalCustomField.id}}/avatar"
191                   />
192                 </td>
193                 <td
194                   md-cell
195                   ng-if="!globalCustomField.userpic && (vm.table == 'users' || vm.table == 'agents')"
196                 >
197                   <img
198                     class="avatar"
199                     alt="{{globalCustomField.name}}"
200                     ng-src="assets/images/avatars/profile.png"
201                   />
202                 </td>
203                 <td
204                   ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)"
205                   md-cell
206                   class="id"
207                 >
208                   {{globalCustomField.id}}
209                 </td>
210                 <td
211                   ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)"
212                   md-cell
213                   class="alias"
214                 >
215                   {{globalCustomField.alias}}
216                 </td>
217                 <td
218                   ng-click="vm.createOrEditGlobalCustomField($event, globalCustomField)"
219                   md-cell
220                   class="type"
221                 >
222                   {{ vm.arraytype[globalCustomField.type].option }}
223                 </td>
224                 <td
225                   ng-click="vm.crudPermissions.readOnly || (vm.crudPermissions.canDelete && !vm.crudPermissions.canEdit) ? vm.editstate(globalCustomField, ev) : vm.createOrEditGlobalCustomField($event, globalCustomField)"
226                   md-cell
227                   class="required"
228                 >
229                   <md-icon
230                     md-colors="{color: {{globalCustomField.required ? '\'green\'' : '\'grey\''}}}"
231                     md-font-icon="{{globalCustomField.required ? 'icon-check' : 'icon-close'}}"
232                   ></md-icon>
233                 </td>
234
235                 <td
236                   md-cell
237                   class="actions"
238                   ng-if="!vm.crudPermissions.readOnly"
239                 >
240                   <md-menu>
241                     <md-button
242                       class="md-icon-button"
243                       aria-label="More"
244                       translate
245                       translate-attr-aria-label="CONTACTMANAGER.MORE"
246                       ng-click="$mdMenu.open($event)"
247                     >
248                       <md-icon md-font-icon="icon-dots-vertical"></md-icon>
249                     </md-button>
250
251                     <md-menu-content width="3">
252                       <!-- SUBACTIONS -->
253
254                       <!-- ACTIONS -->
255
256                       <md-menu-item ng-if="vm.crudPermissions.canEdit">
257                         <md-button
258                           ng-click="vm.editdialog(globalCustomField, $event    )"
259                           translate="CONTACTMANAGER.EDIT_GLOBALCUSTOMFIELD"
260                         >
261                           Edit GlobalCustomField
262                         </md-button>
263                       </md-menu-item>
264
265                       <!-- SUBACTIONS -->
266
267                       <!-- ACTIONS -->
268
269                       <md-menu-item ng-if="vm.crudPermissions.canDelete">
270                         <md-button
271                           ng-click="vm.deleteconfirm(globalCustomField, $event    )"
272                           translate="CONTACTMANAGER.DELETE_GLOBALCUSTOMFIELD"
273                         >
274                           Delete GlobalCustomField
275                         </md-button>
276                       </md-menu-item>
277                     </md-menu-content>
278                   </md-menu>
279                 </td>
280               </tr>
281             </tbody>
282           </table>
283         </md-table-container>
284
285         <md-table-pagination
286           md-label="{page: '{{'CONTACTMANAGER.PAGE' | translate}}:', rowsPerPage: '{{'CONTACTMANAGER.ROWSPERPAGE' | translate}}:', of: '{{'CONTACTMANAGER.OF' | translate}}'}"
287           md-limit="vm.query.limit"
288           md-limit-options="[10, 15, 20, 50, 100, 250]"
289           md-page="vm.query.page"
290           md-total="{{vm.globalCustomFields.count}}"
291           md-on-paginate="vm.getGlobalCustomFields"
292           md-page-select
293         ></md-table-pagination>
294       </md-card>
295       <!-- / GLOBALCUSTOMFIELD TABLE -->
296       <!-- NO RESULTS -->
297
298       <!-- / NO RESULTS -->
299     </div>
300     <!-- / MAIN -->
301   </div>
302   <!-- / CONTENT -->
303
304   <!-- ADD GLOBALCUSTOMFIELD BUTTON -->
305   <md-button
306     ng-if="vm.crudPermissions.canEdit"
307     class="md-fab md-accent"
308     id="add-globalCustomField-button"
309     ng-click="vm.createOrEditGlobalCustomField($event)"
310     aria-label="add globalCustomField"
311     translate
312     translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD"
313   >
314     <md-icon md-font-icon="icon-plus"></md-icon>
315   </md-button>
316   <!-- / ADD GLOBALCUSTOMFIELD BUTTON -->
317 </div>