79fa7b1e62d3be6cb9ebb49dcfe5adcf4fdab465
[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.QUEUE">Queue</label>
42         <md-select
43           name="queue"
44           ng-model="vm.queue.queue"
45           autofocus
46           required
47           ng-disabled="!vm.crudPermissions.canEdit"
48         >
49           <md-option
50             ng-value="queue.name"
51             ng-repeat="queue in vm.queues"
52             ng-disabled="queue.canSelect === false"
53             >{{ queue.name }}</md-option
54           >
55         </md-select>
56         <div
57           ng-messages="internalrouteFormApp['queue'].$error"
58           ng-show="internalrouteFormApp['queue'].$touched"
59           role="alert"
60         >
61           <div ng-message="required">
62             <span translate="VOICE.ERRORS.QUEUE_REQUIRED"
63               >Queue field is required</span
64             >
65           </div>
66         </div>
67       </md-input-container>
68       <md-input-container class="md-block">
69         <label translate="VOICE.OPTIONS">Options</label>
70         <input
71           type="text"
72           name="options"
73           ng-model="vm.queue.options"
74           ng-disabled="!vm.crudPermissions.canEdit"
75         />
76
77         <div
78           ng-messages="internalrouteFormApp['options'].$error"
79           ng-show="internalrouteFormApp['options'].$touched"
80           role="alert"
81         >
82           <div ng-message="required">
83             <span translate="VOICE.ERRORS.OPTIONS_REQUIRED"
84               >Options field is required</span
85             >
86           </div>
87         </div>
88       </md-input-container>
89       <md-input-container class="md-block">
90         <label translate="VOICE.URL">Url</label>
91         <input
92           type="text"
93           name="URL"
94           ng-model="vm.queue.URL"
95           ng-disabled="!vm.crudPermissions.canEdit"
96         />
97
98         <div
99           ng-messages="internalrouteFormApp['URL'].$error"
100           ng-show="internalrouteFormApp['URL'].$touched"
101           role="alert"
102         >
103           <div ng-message="required">
104             <span translate="VOICE.ERRORS.URL_REQUIRED"
105               >Url field is required</span
106             >
107           </div>
108         </div>
109       </md-input-container>
110       <md-input-container class="md-block">
111         <label translate="VOICE.ANNOUNCE_OVERRIDES">Announce_Overrides</label>
112         <md-select
113           name="sound"
114           ng-model="vm.queue.sound"
115           ng-disabled="!vm.crudPermissions.canEdit"
116         >
117           <md-option ng-value="''">None</md-option>
118           <md-option
119             ng-value="'/var/opt/motion2/server/files/sounds/converted/{{sound.save_name}}'"
120             ng-repeat="sound in vm.sounds"
121             ng-disabled="sound.canSelect === false"
122             >{{ sound.name }}</md-option
123           >
124         </md-select>
125         <div
126           ng-messages="internalrouteFormApp['sound'].$error"
127           ng-show="internalrouteFormApp['sound'].$touched"
128           role="alert"
129         >
130           <div ng-message="required">
131             <span translate="VOICE.ERRORS.ANNOUNCE_OVERRIDES_REQUIRED"
132               >Announce_Overrides field is required</span
133             >
134           </div>
135         </div>
136       </md-input-container>
137       <md-input-container class="md-block">
138         <label translate="VOICE.TIMEOUT">Timeout</label>
139         <input
140           type="number"
141           name="timeout"
142           ng-model="vm.queue.timeout"
143           min="0"
144           ng-disabled="!vm.crudPermissions.canEdit"
145         />
146
147         <div
148           ng-messages="internalrouteFormApp['timeout'].$error"
149           ng-show="internalrouteFormApp['timeout'].$touched"
150           role="alert"
151         >
152           <div ng-message="required">
153             <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED"
154               >Timeout field is required</span
155             >
156           </div>
157           <div ng-message="min">
158             <span
159               translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO"
160               >Timeout must be a valid greater or equal than</span
161             >
162             <span>0</span>
163           </div>
164         </div>
165       </md-input-container>
166       <md-input-container class="md-block">
167         <label translate="VOICE.AGI">Agi</label>
168         <input
169           type="text"
170           name="agi"
171           ng-model="vm.queue.agi"
172           ng-disabled="!vm.crudPermissions.canEdit"
173         />
174
175         <div
176           ng-messages="internalrouteFormApp['agi'].$error"
177           ng-show="internalrouteFormApp['agi'].$touched"
178           role="alert"
179         >
180           <div ng-message="required">
181             <span translate="VOICE.ERRORS.AGI_REQUIRED"
182               >Agi field is required</span
183             >
184           </div>
185         </div>
186       </md-input-container>
187       <md-input-container class="md-block">
188         <label translate="VOICE.MACRO">Macro</label>
189         <input
190           type="text"
191           name="macro"
192           ng-model="vm.queue.macro"
193           ng-disabled="!vm.crudPermissions.canEdit"
194         />
195
196         <div
197           ng-messages="internalrouteFormApp['macro'].$error"
198           ng-show="internalrouteFormApp['macro'].$touched"
199           role="alert"
200         >
201           <div ng-message="required">
202             <span translate="VOICE.ERRORS.MACRO_REQUIRED"
203               >Macro field is required</span
204             >
205           </div>
206         </div>
207       </md-input-container>
208       <md-input-container class="md-block">
209         <label translate="VOICE.GOSUB">GoSub</label>
210         <input
211           type="text"
212           name="gosub"
213           ng-model="vm.queue.gosub"
214           ng-disabled="!vm.crudPermissions.canEdit"
215         />
216
217         <div
218           ng-messages="internalrouteFormApp['gosub'].$error"
219           ng-show="internalrouteFormApp['gosub'].$touched"
220           role="alert"
221         >
222           <div ng-message="required">
223             <span translate="VOICE.ERRORS.GOSUB_REQUIRED"
224               >GoSub field is required</span
225             >
226           </div>
227         </div>
228       </md-input-container>
229       <md-input-container class="md-block">
230         <label translate="VOICE.RULE">Rule</label>
231         <input
232           type="text"
233           name="rule"
234           ng-model="vm.queue.rule"
235           ng-disabled="!vm.crudPermissions.canEdit"
236         />
237
238         <div
239           ng-messages="internalrouteFormApp['rule'].$error"
240           ng-show="internalrouteFormApp['rule'].$touched"
241           role="alert"
242         >
243           <div ng-message="required">
244             <span translate="VOICE.ERRORS.RULE_REQUIRED"
245               >Rule field is required</span
246             >
247           </div>
248         </div>
249       </md-input-container>
250       <md-input-container class="md-block">
251         <label translate="VOICE.POSITION">Position</label>
252         <input
253           type="number"
254           name="position"
255           ng-model="vm.queue.position"
256           min="0"
257           ng-disabled="!vm.crudPermissions.canEdit"
258         />
259
260         <div
261           ng-messages="internalrouteFormApp['position'].$error"
262           ng-show="internalrouteFormApp['position'].$touched"
263           role="alert"
264         >
265           <div ng-message="required">
266             <span translate="VOICE.ERRORS.POSITION_REQUIRED"
267               >Position field is required</span
268             >
269           </div>
270           <div ng-message="min">
271             <span
272               translate="VOICE.ERRORS.POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO"
273               >Position must be a valid greater or equal than</span
274             >
275             <span>0</span>
276           </div>
277         </div>
278       </md-input-container>
279       <md-input-container class="md-block">
280         <md-switch
281           ng-model="vm.queue.answer"
282           aria-label="Answer"
283           ng-disabled="!vm.crudPermissions.canEdit"
284           ><span translate="VOICE.ANSWER">Answer</span></md-switch
285         >
286       </md-input-container>
287
288       <div class="error-list">
289         <div
290           ng-repeat="error in vm.errors"
291           class="error"
292           layout="row"
293           layout-align="space-between center"
294         >
295           <div>
296             <span class="message">{{error.message}}</span>
297             <span class="type">({{error.type}})</span>
298           </div>
299           <md-button class="md-icon-button">
300             <md-icon
301               md-font-icon="icon-alert-box"
302               aria-label="alert error"
303               class="s16"
304             ></md-icon>
305           </md-button>
306         </div>
307       </div>
308     </md-dialog-content>
309
310     <md-dialog-actions layout="row" layout-align="space-between center">
311       <div
312         layout="row"
313         layout-align="start center"
314         ng-if="vm.crudPermissions.canEdit"
315       >
316         <md-button
317           type="submit"
318           ng-click="vm.saveInternalRouteApp()"
319           class="send-button md-accent md-raised"
320           ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine"
321           aria-label="SAVE"
322           translate="VOICE.SAVE"
323           translate-attr-aria-label="VOICE.SAVE"
324         >
325           SAVE
326         </md-button>
327       </div>
328     </md-dialog-actions>
329   </form>
330 </md-dialog>