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