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