1 <md-dialog class="globalCustomField-dialog" aria-label="New GlobalCustomField">
2 <form name="globalCustomFieldForm" class="md-inline-form" novalidate>
3 <md-toolbar class="md-accent md-hue-2">
5 class="md-toolbar-tools"
7 layout-align="space-between center"
9 <span class="title">{{ vm.title | translate }}</span>
10 <md-button class="md-icon-button" ng-click="vm.closeDialog()">
12 md-font-icon="icon-close"
13 aria-label="Close dialog"
19 <md-dialog-content ms-scroll>
20 <div class="error-list">
22 ng-repeat="error in vm.errors"
25 layout-align="space-between center"
28 <span class="message">{{error.message}}</span>
29 <span class="type">({{error.type}})</span>
31 <md-button class="md-icon-button">
33 md-font-icon="icon-alert-box"
34 aria-label="alert error"
40 <md-input-container class="md-block">
41 <label translate="CONTACTMANAGER.ALIAS">Alias</label>
45 ng-model="vm.globalCustomField.alias"
51 ng-messages="globalCustomFieldForm['alias'].$error"
52 ng-show="globalCustomFieldForm['alias'].$touched"
55 <div ng-message="required">
56 <span translate="CONTACTMANAGER.ERRORS.ALIAS_REQUIRED"
57 >Alias field is required</span
62 <md-input-container class="md-block">
63 <label translate="CONTACTMANAGER.TYPE">Type</label>
66 ng-model="vm.globalCustomField.type"
68 ng-disabled="!vm.newGlobalCustomField"
70 <md-option ng-value="'text'">Text</md-option>
71 <md-option ng-value="'select'">Select</md-option>
72 <md-option ng-value="'number'">Number</md-option>
73 <md-option ng-value="'switch'">Switch</md-option>
74 <md-option ng-value="'datetime'">Datetime</md-option>
77 ng-messages="globalCustomFieldForm['type'].$error"
78 ng-show="globalCustomFieldForm['type'].$touched"
81 <div ng-message="required">
82 <span translate="CONTACTMANAGER.ERRORS.TYPE_REQUIRED"
83 >Type field is required</span
88 <div ng-if="vm.globalCustomField.type == 'select'" class="md-block">
90 <md-list-item layout-margin>
92 class="md-fab md-mini md-secondary"
93 ng-click="vm.addItem(vm.globalCustomField.values);"
96 ><span translate="CONTACTMANAGER.ADD">ADD</span></md-tooltip
99 md-font-icon="icon-plus"
100 aria-label="alert error"
104 ng-if="vm.globalCustomField.values.length"
105 class="md-fab md-mini md-warn md-secondary"
106 ng-click="vm.removeItems(vm.globalCustomField.values);"
109 ><span translate="CONTACTMANAGER.DELETE_ALL"
114 md-font-icon="icon-delete"
115 aria-label="alert error"
120 <md-list ng-sortable="vm.sortable">
122 ng-repeat="item in vm.globalCustomField.values"
123 style="border: 1px solid #ccc !important; border-radius: 7px"
130 md-font-icon="icon-drag"
133 <input type="text" ng-model="item.value" flex />
136 class="md-fab md-mini md-warn md-secondary"
137 ng-click="vm.removeItem(vm.globalCustomField.values, $index);"
140 ><span translate="CONTACTMANAGER.DELETE"
145 md-font-icon="icon-delete"
146 aria-label="alert error"
153 ng-if="!vm.globalCustomField.values.length"
155 layout-align="center center"
157 <em translate="CONTACTMANAGER.NO_AVAILABLE_ITEMS"
158 >No Available Items</em
163 <md-input-container class="md-block">
165 ng-model="vm.globalCustomField.required"
166 aria-label="Required"
167 ><span translate="CONTACTMANAGER.REQUIRED">Required</span></md-switch
169 </md-input-container>
171 ng-if="vm.globalCustomField.type == 'text'"
175 ng-model="vm.globalCustomField.clickToAction"
176 aria-label="ClickToAction"
177 ><span translate="CONTACTMANAGER.CLICKTOACTION"
181 </md-input-container>
183 ng-if="vm.globalCustomField.clickToAction"
186 <label translate="CONTACTMANAGER.ACTIONTYPE">ActionType</label>
187 <md-select name="actionType" ng-model="vm.globalCustomField.actionType">
188 <md-option ng-value="'voice'">Voice</md-option>
191 ng-messages="globalCustomFieldForm['actionType'].$error"
192 ng-show="globalCustomFieldForm['actionType'].$touched"
195 <div ng-message="required">
196 <span translate="CONTACTMANAGER.ERRORS.ACTIONTYPE_REQUIRED"
197 >ActionType field is required</span
201 </md-input-container>
203 <div class="error-list">
205 ng-repeat="error in vm.errors"
208 layout-align="space-between center"
211 <span class="message">{{error.message}}</span>
212 <span class="type">({{error.type}})</span>
214 <md-button class="md-icon-button">
216 md-font-icon="icon-alert-box"
217 aria-label="alert error"
227 layout-align="space-between center"
228 ng-if="!vm.crudPermissions.readOnly"
230 <div layout="row" layout-align="start center">
233 ng-if="vm.crudPermissions.canEdit && !vm.newGlobalCustomField"
234 ng-click="vm.saveGlobalCustomField()"
235 class="send-button md-accent md-raised"
236 ng-disabled="globalCustomFieldForm.$invalid || globalCustomFieldForm.$pristine"
238 translate="CONTACTMANAGER.SAVE"
239 translate-attr-aria-label="CONTACTMANAGER.SAVE"
246 ng-if="vm.crudPermissions.canEdit && vm.newGlobalCustomField"
247 ng-click="vm.addNewGlobalCustomField()"
248 class="send-button md-accent md-raised"
249 ng-disabled="globalCustomFieldForm.$invalid"
251 translate="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD"
252 translate-attr-aria-label="CONTACTMANAGER.ADD_GLOBALCUSTOMFIELD"
254 ADD GLOBALCUSTOMFIELD
259 class="md-icon-button"
260 ng-if="vm.crudPermissions.canDelete && !vm.newGlobalCustomField"
261 ng-click="vm.deleteGlobalCustomField($event)"
264 translate-attr-aria-label="CONTACTMANAGER.DELETE"
266 <md-icon md-font-icon="icon-delete"></md-icon>
268 ><span translate="CONTACTMANAGER.DELETE">DELETE</span></md-tooltip