a07bc22e4869f86c5cfcca4a28f31fe1af357a28
[motion-next.git] /
1 <md-dialog class="outboundroute-dialog" aria-label="New OutboundRoute">
2   <form name="outboundrouteFormApp" 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">{{ vm.title | translate }}</span>
10         <md-button class="md-icon-button" ng-click="vm.closeDialog()">
11           <md-icon
12             md-font-icon="icon-close"
13             aria-label="Close dialog"
14           ></md-icon>
15         </md-button>
16       </div>
17     </md-toolbar>
18
19     <md-dialog-content ms-scroll>
20       <div class="error-list">
21         <div
22           ng-repeat="error in vm.errors"
23           class="error"
24           layout="row"
25           layout-align="space-between center"
26         >
27           <div>
28             <span class="message">{{error.message}}</span>
29             <span class="type">({{error.type}})</span>
30           </div>
31           <md-button class="md-icon-button">
32             <md-icon
33               md-font-icon="icon-alert-box"
34               aria-label="alert error"
35               class="s16"
36             ></md-icon>
37           </md-button>
38         </div>
39       </div>
40       <md-input-container class="md-block">
41         <label translate="VOICE.TRUNK">Trunk</label>
42         <md-select
43           name="trunk"
44           ng-model="vm.outbounddial.trunk"
45           autofocus
46           required
47           ng-disabled="!vm.crudPermissions.canEdit"
48         >
49           <md-option
50             ng-value="trunk.name"
51             ng-repeat="trunk in vm.trunks"
52             ng-disabled="trunk.canSelect === false"
53             >{{ trunk.name }}</md-option
54           >
55         </md-select>
56         <div
57           ng-messages="outboundrouteFormApp['trunk'].$error"
58           ng-show="outboundrouteFormApp['trunk'].$touched"
59           role="alert"
60         >
61           <div ng-message="required">
62             <span translate="VOICE.ERRORS.TRUNK_REQUIRED"
63               >Trunk field is required</span
64             >
65           </div>
66         </div>
67       </md-input-container>
68       <md-input-container class="md-block">
69         <label translate="VOICE.CALLER_ID">Caller_ID</label>
70         <input
71           type="text"
72           name="callerID"
73           ng-model="vm.outbounddial.callerID"
74           ng-disabled="!vm.crudPermissions.canEdit"
75         />
76
77         <div class="hint"><span translate="VOICE.HELP.CALLER_ID"></span></div>
78         <div
79           ng-messages="outboundrouteFormApp['callerID'].$error"
80           ng-show="outboundrouteFormApp['callerID'].$touched"
81           role="alert"
82         >
83           <div ng-message="required">
84             <span translate="VOICE.ERRORS.CALLER_ID_REQUIRED"
85               >Caller_ID field is required</span
86             >
87           </div>
88         </div>
89       </md-input-container>
90       <md-input-container class="md-block">
91         <label translate="VOICE.PREFIX">Prefix</label>
92         <input
93           type="text"
94           name="prefix"
95           ng-model="vm.outbounddial.prefix"
96           ng-disabled="!vm.crudPermissions.canEdit"
97         />
98
99         <div
100           ng-messages="outboundrouteFormApp['prefix'].$error"
101           ng-show="outboundrouteFormApp['prefix'].$touched"
102           role="alert"
103         >
104           <div ng-message="required">
105             <span translate="VOICE.ERRORS.PREFIX_REQUIRED"
106               >Prefix field is required</span
107             >
108           </div>
109         </div>
110       </md-input-container>
111       <md-input-container class="md-block">
112         <label translate="VOICE.TAGS">Tags</label>
113         <md-select
114           name="tag"
115           ng-model="vm.outbounddial.tag"
116           ng-disabled="!vm.crudPermissions.canEdit"
117         >
118           <md-option ng-value="'--'">None</md-option>
119           <md-option
120             ng-value="tag.name"
121             ng-repeat="tag in vm.tags"
122             ng-disabled="tag.canSelect === false"
123             >{{ tag.name }}</md-option
124           >
125         </md-select>
126         <div
127           ng-messages="outboundrouteFormApp['tag'].$error"
128           ng-show="outboundrouteFormApp['tag'].$touched"
129           role="alert"
130         >
131           <div ng-message="required">
132             <span translate="VOICE.ERRORS.TAGS_REQUIRED"
133               >Tags field is required</span
134             >
135           </div>
136         </div>
137       </md-input-container>
138       <md-input-container class="md-block">
139         <label translate="VOICE.TIMEOUT">Timeout</label>
140         <input
141           type="number"
142           name="timeout"
143           ng-model="vm.outbounddial.timeout"
144           min="0"
145           ng-disabled="!vm.crudPermissions.canEdit"
146         />
147
148         <div
149           ng-messages="outboundrouteFormApp['timeout'].$error"
150           ng-show="outboundrouteFormApp['timeout'].$touched"
151           role="alert"
152         >
153           <div ng-message="required">
154             <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED"
155               >Timeout field is required</span
156             >
157           </div>
158           <div ng-message="min">
159             <span
160               translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO"
161               >Timeout must be a valid greater or equal than</span
162             >
163             <span>0</span>
164           </div>
165         </div>
166       </md-input-container>
167       <md-input-container class="md-block">
168         <label translate="VOICE.OPTIONS">Options</label>
169         <input
170           type="text"
171           name="options"
172           ng-model="vm.outbounddial.options"
173           ng-disabled="!vm.crudPermissions.canEdit"
174         />
175
176         <div
177           ng-messages="outboundrouteFormApp['options'].$error"
178           ng-show="outboundrouteFormApp['options'].$touched"
179           role="alert"
180         >
181           <div ng-message="required">
182             <span translate="VOICE.ERRORS.OPTIONS_REQUIRED"
183               >Options field is required</span
184             >
185           </div>
186         </div>
187       </md-input-container>
188       <md-input-container class="md-block">
189         <label translate="VOICE.URL">Url</label>
190         <input
191           type="text"
192           name="url"
193           ng-model="vm.outbounddial.url"
194           ng-disabled="!vm.crudPermissions.canEdit"
195         />
196
197         <div
198           ng-messages="outboundrouteFormApp['url'].$error"
199           ng-show="outboundrouteFormApp['url'].$touched"
200           role="alert"
201         >
202           <div ng-message="required">
203             <span translate="VOICE.ERRORS.URL_REQUIRED"
204               >Url field is required</span
205             >
206           </div>
207         </div>
208       </md-input-container>
209
210       <div class="error-list">
211         <div
212           ng-repeat="error in vm.errors"
213           class="error"
214           layout="row"
215           layout-align="space-between center"
216         >
217           <div>
218             <span class="message">{{error.message}}</span>
219             <span class="type">({{error.type}})</span>
220           </div>
221           <md-button class="md-icon-button">
222             <md-icon
223               md-font-icon="icon-alert-box"
224               aria-label="alert error"
225               class="s16"
226             ></md-icon>
227           </md-button>
228         </div>
229       </div>
230     </md-dialog-content>
231
232     <md-dialog-actions layout="row" layout-align="space-between center">
233       <div
234         layout="row"
235         layout-align="start center"
236         ng-if="vm.crudPermissions.canEdit"
237       >
238         <md-button
239           type="submit"
240           ng-click="vm.saveOutboundRouteApp()"
241           class="send-button md-accent md-raised"
242           ng-disabled="outboundrouteFormApp.$invalid || outboundrouteFormApp.$pristine"
243           aria-label="SAVE"
244           translate="VOICE.SAVE"
245           translate-attr-aria-label="VOICE.SAVE"
246         >
247           SAVE
248         </md-button>
249       </div>
250     </md-dialog-actions>
251   </form>
252 </md-dialog>