a70155df66aa71a5b522cc1e8990624571ddcba7
[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.USER">User</label>
42         <md-select
43           name="user"
44           ng-model="vm.internaldial.user"
45           autofocus
46           required
47           ng-disabled="!vm.crudPermissions.canEdit"
48         >
49           <md-option
50             ng-value="'SIP/{{user.name}}'"
51             ng-repeat="user in vm.users"
52             ng-disabled="user.canSelect === false"
53             >{{ user.name }}</md-option
54           >
55         </md-select>
56         <div
57           ng-messages="internalrouteFormApp['user'].$error"
58           ng-show="internalrouteFormApp['user'].$touched"
59           role="alert"
60         >
61           <div ng-message="required">
62             <span translate="VOICE.ERRORS.USER_REQUIRED"
63               >User field is required</span
64             >
65           </div>
66         </div>
67       </md-input-container>
68       <md-input-container class="md-block">
69         <label translate="VOICE.TIMEOUT">Timeout</label>
70         <input
71           type="number"
72           name="timeout"
73           ng-model="vm.internaldial.timeout"
74           min="0"
75           ng-disabled="!vm.crudPermissions.canEdit"
76         />
77
78         <div
79           ng-messages="internalrouteFormApp['timeout'].$error"
80           ng-show="internalrouteFormApp['timeout'].$touched"
81           role="alert"
82         >
83           <div ng-message="required">
84             <span translate="VOICE.ERRORS.TIMEOUT_REQUIRED"
85               >Timeout field is required</span
86             >
87           </div>
88           <div ng-message="min">
89             <span
90               translate="VOICE.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO"
91               >Timeout must be a valid greater or equal than</span
92             >
93             <span>0</span>
94           </div>
95         </div>
96       </md-input-container>
97       <md-input-container class="md-block">
98         <label translate="VOICE.OPTIONS">Options</label>
99         <input
100           type="text"
101           name="options"
102           ng-model="vm.internaldial.options"
103           ng-disabled="!vm.crudPermissions.canEdit"
104         />
105
106         <div
107           ng-messages="internalrouteFormApp['options'].$error"
108           ng-show="internalrouteFormApp['options'].$touched"
109           role="alert"
110         >
111           <div ng-message="required">
112             <span translate="VOICE.ERRORS.OPTIONS_REQUIRED"
113               >Options field is required</span
114             >
115           </div>
116         </div>
117       </md-input-container>
118       <md-input-container class="md-block">
119         <label translate="VOICE.URL">Url</label>
120         <input
121           type="text"
122           name="url"
123           ng-model="vm.internaldial.url"
124           ng-disabled="!vm.crudPermissions.canEdit"
125         />
126
127         <div
128           ng-messages="internalrouteFormApp['url'].$error"
129           ng-show="internalrouteFormApp['url'].$touched"
130           role="alert"
131         >
132           <div ng-message="required">
133             <span translate="VOICE.ERRORS.URL_REQUIRED"
134               >Url field is required</span
135             >
136           </div>
137         </div>
138       </md-input-container>
139
140       <div class="error-list">
141         <div
142           ng-repeat="error in vm.errors"
143           class="error"
144           layout="row"
145           layout-align="space-between center"
146         >
147           <div>
148             <span class="message">{{error.message}}</span>
149             <span class="type">({{error.type}})</span>
150           </div>
151           <md-button class="md-icon-button">
152             <md-icon
153               md-font-icon="icon-alert-box"
154               aria-label="alert error"
155               class="s16"
156             ></md-icon>
157           </md-button>
158         </div>
159       </div>
160     </md-dialog-content>
161
162     <md-dialog-actions layout="row" layout-align="space-between center">
163       <div
164         layout="row"
165         layout-align="start center"
166         ng-if="vm.crudPermissions.canEdit"
167       >
168         <md-button
169           type="submit"
170           ng-click="vm.saveInternalRouteApp()"
171           class="send-button md-accent md-raised"
172           ng-disabled="internalrouteFormApp.$invalid || internalrouteFormApp.$pristine"
173           aria-label="SAVE"
174           translate="VOICE.SAVE"
175           translate-attr-aria-label="VOICE.SAVE"
176         >
177           SAVE
178         </md-button>
179       </div>
180     </md-dialog-actions>
181   </form>
182 </md-dialog>