8b8795406b7c296e6c2bbe033b182b71c17a2013
[motion-next.git] /
1 <md-dialog class="project-dialog" aria-label="New dialog" ng-init="vm.onInit()">
2   <form name="dialogForm" class="md-inline-form" novalidate>
3     <md-toolbar class="md-accent md-hue-2">
4       <div
5         class="md-toolbar-tools"
6         layout="row"
7         layout-align="space-between center"
8       >
9         <span class="title"
10           ><span translate="CALLYSQUARE.EDIT"></span>
11           <span translate="CALLYSQUARE.{{vm.cellName | uppercase}}"></span
12         ></span>
13         <md-button class="md-icon-button" ng-click="vm.closeDialog()">
14           <md-icon
15             md-font-icon="icon-close"
16             aria-label="Close dialog"
17           ></md-icon>
18         </md-button>
19       </div>
20     </md-toolbar>
21     <md-dialog-content ms-scroll>
22       <md-input-container
23         class="md-block"
24         ng-repeat="attribute in vm.attributes"
25         ng-switch="attribute.name"
26       >
27         <label translate="CALLYSQUARE.{{attribute.name | uppercase}}"
28           >{{attribute.name | ucfirst }}</label
29         >
30
31         <!--  START SELECT INPUT -->
32         <md-select
33           name="{{attribute.name}}"
34           ng-model="attribute.value"
35           ng-disabled="!vm.crudPermissions.canEdit"
36           ng-switch-when-separator="|"
37           ng-switch-when="answer|trunk_name|trunk_id|queue_id|file_id|variable_id|google_cloud_tts_text_type|google_tts_language|ispeech_tts_language|ispeech_asr_language|google_asr_language|hiddendigitspos|odbc_id|project_id|beep|account_id|interval_id|template_id|list_id|recordingFormat|callback_priority|aws_polly_voice|aws_polly_region|aws_lex_region|sms_account_id|findBy|pause_id|aws_text_type|dialogflow_language|ndagenerate_audio|ndaactivity_type|languageCode|ssmlGender|method"
38           ng-required="attribute.required"
39         >
40           <md-option ng-if="attribute.defaultValue" ng-value="''">
41             - None -
42           </md-option>
43           <md-option
44             value="{{v.value}}"
45             ng-repeat="v in vm.values[attribute.name]"
46             ng-disabled="v.canSelect === false"
47             >{{v.option}}</md-option
48           >
49           <md-option ng-if="!vm.values[attribute.name].length" value="-1"
50             >No {{attribute.name}} available!</md-option
51           >
52         </md-select>
53         <!--  END SELECT INPUT -->
54
55         <!--  START SELECT INPUT -->
56         <md-select
57           name="{{attribute.name}}"
58           ng-model="attribute.value"
59           ng-disabled="!vm.crudPermissions.canEdit"
60           ng-switch-when-separator="|"
61           ng-switch-when="sip_id"
62           ng-required="attribute.required"
63         >
64           <md-optgroup label="{{'CALLYSQUARE.AGENTS' | translate}}">
65             <md-option
66               value="{{v.value}}"
67               ng-repeat="v in vm.values[attribute.name]"
68               ng-if="v.group === 'agent'"
69               ng-disabled="v.canSelect === false"
70               >{{v.option}}</md-option
71             >
72           </md-optgroup>
73           <md-optgroup label="{{'CALLYSQUARE.TELEPHONES' | translate}}">
74             <md-option
75               value="{{v.value}}"
76               ng-repeat="v in vm.values[attribute.name]"
77               ng-if="v.group === 'telephone'"
78               ng-disabled="v.canSelect === false"
79               >{{v.option}}</md-option
80             >
81           </md-optgroup>
82           <md-optgroup label="{{'CALLYSQUARE.USERS' | translate}}">
83             <md-option
84               value="{{v.value}}"
85               ng-repeat="v in vm.values[attribute.name]"
86               ng-if="v.group === 'admin' || v.group === 'user'"
87               >{{v.option}}</md-option
88             >
89           </md-optgroup>
90           <md-option ng-if="!vm.values[attribute.name].length" value="-1"
91             >No {{attribute.name}} available!</md-option
92           >
93         </md-select>
94         <!--  END SELECT INPUT -->
95
96         <!--  START NUMBER INPUT -->
97         <div ng-switch-when="timeout">
98           <div ng-switch="vm.cellName">
99             <input
100               ng-switch-when-separator="|"
101               ng-switch-when="answer|ext_dial|dial|queue"
102               type="number"
103               step="any"
104               name="{{attribute.name}}"
105               min="0"
106               ng-model="attribute.value"
107               ng-required="attribute.required"
108               ng-disabled="!vm.crudPermissions.canEdit"
109               string-to-number
110             />
111             <input
112               ng-switch-when-separator="|"
113               ng-switch-when="record|ispeechasr|googleasr"
114               type="number"
115               step="any"
116               name="{{attribute.name}}"
117               min="-1"
118               ng-model="attribute.value"
119               ng-required="attribute.required"
120               ng-disabled="!vm.crudPermissions.canEdit"
121               string-to-number
122             />
123             <input
124               ng-switch-when-separator="|"
125               ng-switch-when="restapi"
126               type="number"
127               step="any"
128               name="{{attribute.name}}"
129               min="1"
130               ng-model="attribute.value"
131               ng-required="attribute.required"
132               ng-disabled="!vm.crudPermissions.canEdit"
133               string-to-number
134             />
135             <input
136               ng-switch-default
137               type="number"
138               step="any"
139               name="{{attribute.name}}"
140               min="0"
141               ng-model="attribute.value"
142               ng-required="attribute.required"
143               ng-disabled="!vm.crudPermissions.canEdit"
144               string-to-number
145             />
146           </div>
147         </div>
148         <input
149           ng-switch-when-separator="|"
150           ng-switch-when="speed"
151           type="number"
152           step="any"
153           name="{{attribute.name}}"
154           min="-10"
155           max="-10"
156           ng-model="attribute.value"
157           ng-required="attribute.required"
158           ng-disabled="!vm.crudPermissions.canEdit"
159           string-to-number
160         />
161         <input
162           ng-switch-when-separator="|"
163           ng-switch-when="maxdigit|mindigit|digit"
164           type="number"
165           step="any"
166           name="{{attribute.name}}"
167           min="1"
168           ng-model="attribute.value"
169           ng-required="attribute.required"
170           ng-disabled="!vm.crudPermissions.canEdit"
171           string-to-number
172         />
173         <input
174           ng-switch-when-separator="|"
175           ng-switch-when="retry|response|hiddendigitsnum|priority"
176           type="number"
177           step="any"
178           name="{{attribute.name}}"
179           min="1"
180           ng-model="attribute.value"
181           ng-required="attribute.required"
182           ng-disabled="!vm.crudPermissions.canEdit"
183           string-to-number
184         />
185         <!--  END NUMBER INPUT -->
186
187         <!--  START TEXTAREA INPUT -->
188         <textarea
189           name="{{attribute.name}}"
190           ng-model="attribute.value"
191           ng-switch-when-separator="|"
192           ng-switch-when="query|sms_text|condition|text|custom_action_data|headers|body|rawHeaders|rawBody"
193           ng-required="attribute.required"
194           ng-disabled="!vm.crudPermissions.canEdit"
195         ></textarea>
196         <!--  END TEXTAREA INPUT -->
197
198         <!-- START URL INPUT -->
199         <input
200           ng-switch-when-separator="|"
201           ng-switch-when="ndauth_url|ndassistant_url|url"
202           type="url"
203           name="{{attribute.name}}"
204           ng-model="attribute.value"
205           ng-required="attribute.required"
206         />
207         <!-- END URL INPUT -->
208
209         <!--  START TEXT INPUT -->
210         <input
211           ng-switch-default
212           name="{{attribute.name}}"
213           ng-model="attribute.value"
214           ng-required="attribute.required"
215           ng-disabled="!vm.crudPermissions.canEdit"
216         />
217         <div
218           class="hint"
219           ng-if="attribute.name === 'text' && vm.cellName === 'tts' "
220         >
221           <span translate="CALLYSQUARE.HELP.MAX_TEXT_TTS" class="ng-scope"
222             >Max 250 chars are supported</span
223           >
224         </div>
225         <!--  END TEXT INPUT-->
226
227         <div class="hint" ng-if="attribute.help">
228           <span
229             translate="CALLYSQUARE.HELP.{{attribute.name | uppercase}}"
230           ></span>
231         </div>
232         <div
233           ng-messages="dialogForm[attribute.name].$error"
234           ng-show="dialogForm[attribute.name].$touched"
235           role="alert"
236         >
237           <div ng-message="required">
238             <span translate="CALLYSQUARE.ERRORS.FIELD_REQUIRED"
239               >The field is required</span
240             >
241           </div>
242         </div>
243       </md-input-container>
244     </md-dialog-content>
245
246     <md-dialog-actions
247       layout="row"
248       layout-align="space-between center"
249       ng-if="vm.crudPermissions.canEdit"
250     >
251       <div layout="row" layout-align="start center">
252         <md-button
253           type="submit"
254           ng-click="vm.closeDialog(true)"
255           class="send-button md-accent md-raised"
256           ng-disabled="dialogForm.$invalid || dialogForm.$pristine"
257           aria-label="SAVE"
258           translate="CALLYSQUARE.SAVE"
259           translate-attr-aria-label="CALLYSQUARE.SAVE"
260         >
261           SAVE
262         </md-button>
263       </div>
264     </md-dialog-actions>
265   </form>
266 </md-dialog>