8ac879412e1f434cdbbb38bf134c42785ecfc98b
[motion-next.git] /
1 <md-dialog class="inboundroute-dialog" aria-label="New InboundRoute">
2   <form name="inboundrouteFormApp" 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.externaldial.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="inboundrouteFormApp['trunk'].$error"
58           ng-show="inboundrouteFormApp['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.PHONE">Phone</label>
70         <input
71           type="text"
72           name="phone"
73           ng-model="vm.externaldial.phone"
74           ng-required="true"
75           ng-disabled="!vm.crudPermissions.canEdit"
76         />
77
78         <div
79           ng-messages="inboundrouteFormApp['phone'].$error"
80           ng-show="inboundrouteFormApp['phone'].$touched"
81           role="alert"
82         >
83           <div ng-message="required">
84             <span translate="VOICE.ERRORS.PHONE_REQUIRED"
85               >Phone field is required</span
86             >
87           </div>
88         </div>
89       </md-input-container>
90       <md-input-container class="md-block">
91         <label translate="VOICE.TIMEOUT">Timeout</label>
92         <input
93           type="number"
94           name="timeout"
95           ng-model="vm.externaldial.timeout"
96           min="0"
97           ng-disabled="!vm.crudPermissions.canEdit"
98         />
99
100         <div
101           ng-messages="inboundrouteFormApp['timeout'].$error"
102           ng-show="inboundrouteFormApp['timeout'].$touched"
103           role="alert"
104         >
105           <div ng-message="required">
106             <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED"
107               >Timeout field is required</span
108             >
109           </div>
110           <div ng-message="min">
111             <span
112               translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO"
113               >Timeout must be a valid greater or equal than</span
114             >
115             <span>0</span>
116           </div>
117         </div>
118       </md-input-container>
119       <md-input-container class="md-block">
120         <label translate="VOICE.OPTIONS">Options</label>
121         <input
122           type="text"
123           name="options"
124           ng-model="vm.externaldial.options"
125           ng-disabled="!vm.crudPermissions.canEdit"
126         />
127
128         <div
129           ng-messages="inboundrouteFormApp['options'].$error"
130           ng-show="inboundrouteFormApp['options'].$touched"
131           role="alert"
132         >
133           <div ng-message="required">
134             <span translate="VOICE.ERRORS.OPTIONS_REQUIRED"
135               >Options field is required</span
136             >
137           </div>
138         </div>
139       </md-input-container>
140       <md-input-container class="md-block">
141         <label translate="VOICE.URL">Url</label>
142         <input
143           type="text"
144           name="url"
145           ng-model="vm.externaldial.url"
146           ng-disabled="!vm.crudPermissions.canEdit"
147         />
148
149         <div
150           ng-messages="inboundrouteFormApp['url'].$error"
151           ng-show="inboundrouteFormApp['url'].$touched"
152           role="alert"
153         >
154           <div ng-message="required">
155             <span translate="VOICE.ERRORS.URL_REQUIRED"
156               >Url field is required</span
157             >
158           </div>
159         </div>
160       </md-input-container>
161
162       <div class="error-list">
163         <div
164           ng-repeat="error in vm.errors"
165           class="error"
166           layout="row"
167           layout-align="space-between center"
168         >
169           <div>
170             <span class="message">{{error.message}}</span>
171             <span class="type">({{error.type}})</span>
172           </div>
173           <md-button class="md-icon-button">
174             <md-icon
175               md-font-icon="icon-alert-box"
176               aria-label="alert error"
177               class="s16"
178             ></md-icon>
179           </md-button>
180         </div>
181       </div>
182     </md-dialog-content>
183
184     <md-dialog-actions layout="row" layout-align="space-between center">
185       <div
186         layout="row"
187         layout-align="start center"
188         ng-if="vm.crudPermissions.canEdit"
189       >
190         <md-button
191           type="submit"
192           ng-click="vm.saveInboundRouteApp()"
193           class="send-button md-accent md-raised"
194           ng-disabled="inboundrouteFormApp.$invalid || inboundrouteFormApp.$pristine"
195           aria-label="SAVE"
196           translate="VOICE.SAVE"
197           translate-attr-aria-label="VOICE.SAVE"
198         >
199           SAVE
200         </md-button>
201       </div>
202     </md-dialog-actions>
203   </form>
204 </md-dialog>