85d3bec553db3bb7dfbb14afbc0c4b857ef2a2ec
[motion-next.git] /
1 <md-dialog class="outboundroute-dialog" aria-label="New OutboundRoute">
2   <form name="outboundrouteForm" 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.PHONENUMBER">PhoneNumber</label>
42         <input
43           type="text"
44           name="exten"
45           ng-model="vm.outboundroute.exten"
46           ng-required="true"
47           autofocus
48         />
49
50         <div
51           ng-messages="outboundrouteForm['exten'].$error"
52           ng-show="outboundrouteForm['exten'].$touched"
53           role="alert"
54         >
55           <div ng-message="required">
56             <span translate="VOICE.ERRORS.PHONENUMBER_REQUIRED"
57               >PhoneNumber field is required</span
58             >
59           </div>
60         </div>
61       </md-input-container>
62       <md-input-container class="md-block">
63         <label translate="VOICE.CONTEXT">Context</label>
64         <md-select name="context" ng-model="vm.outboundroute.context" required>
65           <md-option
66             ng-value="context.name"
67             ng-repeat="context in vm.contexts"
68             ng-disabled="context.canSelect === false"
69             >{{ context.name }}</md-option
70           >
71         </md-select>
72         <div
73           ng-messages="outboundrouteForm['context'].$error"
74           ng-show="outboundrouteForm['context'].$touched"
75           role="alert"
76         >
77           <div ng-message="required">
78             <span translate="VOICE.ERRORS.CONTEXT_REQUIRED"
79               >Context field is required</span
80             >
81           </div>
82         </div>
83       </md-input-container>
84       <md-input-container class="md-block">
85         <label translate="VOICE.RECORDING">Recording</label>
86         <md-select
87           name="recordingFormat"
88           ng-model="vm.outboundroute.recordingFormat"
89           required
90         >
91           <md-option ng-value="'none'">none</md-option>
92           <md-option ng-value="'wav'">wav</md-option>
93           <md-option ng-value="'WAV'">wav49</md-option>
94           <md-option ng-value="'gsm'">gsm</md-option>
95         </md-select>
96         <div class="hint"><span translate="VOICE.HELP.RECORDING"></span></div>
97         <div
98           ng-messages="outboundrouteForm['recordingFormat'].$error"
99           ng-show="outboundrouteForm['recordingFormat'].$touched"
100           role="alert"
101         >
102           <div ng-message="required">
103             <span translate="VOICE.ERRORS.RECORDING_REQUIRED"
104               >Recording field is required</span
105             >
106           </div>
107         </div>
108       </md-input-container>
109       <md-input-container class="md-block">
110         <label translate="VOICE.CUTDIGITS">CutDigits</label>
111         <input
112           type="number"
113           name="cutdigits"
114           ng-model="vm.outboundroute.cutdigits"
115           min="0"
116         />
117
118         <div
119           ng-messages="outboundrouteForm['cutdigits'].$error"
120           ng-show="outboundrouteForm['cutdigits'].$touched"
121           role="alert"
122         >
123           <div ng-message="required">
124             <span translate="VOICE.ERRORS.CUTDIGITS_REQUIRED"
125               >CutDigits field is required</span
126             >
127           </div>
128           <div ng-message="min">
129             <span
130               translate="VOICE.ERRORS.CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO"
131               >CutDigits must be a valid greater or equal than</span
132             >
133             <span>0</span>
134           </div>
135         </div>
136       </md-input-container>
137       <md-input-container class="md-block">
138         <label translate="VOICE.DESCRIPTION">Description</label>
139         <input
140           type="text"
141           name="description"
142           ng-model="vm.outboundroute.description"
143         />
144
145         <div
146           ng-messages="outboundrouteForm['description'].$error"
147           ng-show="outboundrouteForm['description'].$touched"
148           role="alert"
149         >
150           <div ng-message="required">
151             <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED"
152               >Description field is required</span
153             >
154           </div>
155         </div>
156       </md-input-container>
157
158       <div class="error-list">
159         <div
160           ng-repeat="error in vm.errors"
161           class="error"
162           layout="row"
163           layout-align="space-between center"
164         >
165           <div>
166             <span class="message">{{error.message}}</span>
167             <span class="type">({{error.type}})</span>
168           </div>
169           <md-button class="md-icon-button">
170             <md-icon
171               md-font-icon="icon-alert-box"
172               aria-label="alert error"
173               class="s16"
174             ></md-icon>
175           </md-button>
176         </div>
177       </div>
178     </md-dialog-content>
179
180     <md-dialog-actions
181       layout="row"
182       layout-align="space-between center"
183       ng-if="!vm.crudPermissions.readOnly"
184     >
185       <div layout="row" layout-align="start center">
186         <md-button
187           type="submit"
188           ng-if="vm.crudPermissions.canEdit && !vm.newOutboundRoute"
189           ng-click="vm.saveOutboundRoute()"
190           class="send-button md-accent md-raised"
191           ng-disabled="outboundrouteForm.$invalid || outboundrouteForm.$pristine"
192           aria-label="SAVE"
193           translate="VOICE.SAVE"
194           translate-attr-aria-label="VOICE.SAVE"
195         >
196           SAVE
197         </md-button>
198
199         <md-button
200           type="submit"
201           ng-if="vm.crudPermissions.canEdit && vm.newOutboundRoute"
202           ng-click="vm.addNewOutboundRoute()"
203           class="send-button md-accent md-raised"
204           ng-disabled="outboundrouteForm.$invalid"
205           aria-label="ADD"
206           translate="VOICE.ADD_OUTBOUNDROUTE"
207           translate-attr-aria-label="VOICE.ADD_OUTBOUNDROUTE"
208         >
209           ADD OUTBOUNDROUTE
210         </md-button>
211       </div>
212       <div layout="row">
213         <md-button
214           class="md-icon-button"
215           ng-if="vm.crudPermissions.canDelete && !vm.newOutboundRoute"
216           ng-click="vm.deleteOutboundRoute($event)"
217           aria-label="DELETE"
218           translate
219           translate-attr-aria-label="VOICE.DELETE"
220         >
221           <md-icon md-font-icon="icon-delete"></md-icon>
222           <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>
223         </md-button>
224       </div>
225     </md-dialog-actions>
226   </form>
227 </md-dialog>