932a7a5c7a7b8edbcc5347d2e26bb67a3b5c9100
[motion-next.git] /
1 <md-dialog class="internalroute-dialog" aria-label="New InternalRoute">
2   <form name="internalrouteForm" 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.internalroute.exten"
46           ng-required="true"
47           autofocus
48         />
49
50         <div
51           ng-messages="internalrouteForm['exten'].$error"
52           ng-show="internalrouteForm['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.internalroute.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="internalrouteForm['context'].$error"
74           ng-show="internalrouteForm['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.DESCRIPTION">Description</label>
86         <input
87           type="text"
88           name="description"
89           ng-model="vm.internalroute.description"
90         />
91
92         <div
93           ng-messages="internalrouteForm['description'].$error"
94           ng-show="internalrouteForm['description'].$touched"
95           role="alert"
96         >
97           <div ng-message="required">
98             <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED"
99               >Description field is required</span
100             >
101           </div>
102         </div>
103       </md-input-container>
104
105       <div class="error-list">
106         <div
107           ng-repeat="error in vm.errors"
108           class="error"
109           layout="row"
110           layout-align="space-between center"
111         >
112           <div>
113             <span class="message">{{error.message}}</span>
114             <span class="type">({{error.type}})</span>
115           </div>
116           <md-button class="md-icon-button">
117             <md-icon
118               md-font-icon="icon-alert-box"
119               aria-label="alert error"
120               class="s16"
121             ></md-icon>
122           </md-button>
123         </div>
124       </div>
125     </md-dialog-content>
126
127     <md-dialog-actions
128       layout="row"
129       layout-align="space-between center"
130       ng-if="!vm.crudPermissions.readOnly"
131     >
132       <div layout="row" layout-align="start center">
133         <md-button
134           type="submit"
135           ng-if="vm.crudPermissions.canEdit && !vm.newInternalRoute"
136           ng-click="vm.saveInternalRoute()"
137           class="send-button md-accent md-raised"
138           ng-disabled="internalrouteForm.$invalid || internalrouteForm.$pristine"
139           aria-label="SAVE"
140           translate="VOICE.SAVE"
141           translate-attr-aria-label="VOICE.SAVE"
142         >
143           SAVE
144         </md-button>
145
146         <md-button
147           type="submit"
148           ng-if="vm.crudPermissions.canEdit && vm.newInternalRoute"
149           ng-click="vm.addNewInternalRoute()"
150           class="send-button md-accent md-raised"
151           ng-disabled="internalrouteForm.$invalid"
152           aria-label="ADD"
153           translate="VOICE.ADD_INTERNALROUTE"
154           translate-attr-aria-label="VOICE.ADD_INTERNALROUTE"
155         >
156           ADD INTERNALROUTE
157         </md-button>
158       </div>
159       <div layout="row">
160         <md-button
161           class="md-icon-button"
162           ng-if="vm.crudPermissions.canDelete && !vm.newInternalRoute"
163           ng-click="vm.deleteInternalRoute($event)"
164           aria-label="DELETE"
165           translate
166           translate-attr-aria-label="VOICE.DELETE"
167         >
168           <md-icon md-font-icon="icon-delete"></md-icon>
169           <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>
170         </md-button>
171       </div>
172     </md-dialog-actions>
173   </form>
174 </md-dialog>