a3cfc63dc8b2ec4752f6528159e2a16947875f84
[motion-next.git] /
1 <md-dialog class="hopper-dialog" aria-label="New Hopper">
2   <form name="hopperForm" 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       <div class="md-block">
41         <label translate="MOTIONDIALER.SCHEDULEDAT">ScheduledAt</label>
42         <md-content layout="row" class="md-padding">
43           <div flex class="md-block">
44             <mdp-date-picker
45               mdp-open-on-click
46               name="scheduledatDate"
47               mdp-placeholder="Date"
48               mdp-format="YYYY-MM-DD"
49               ng-model="vm.hopper.scheduledat"
50               ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)"
51             >
52               <div
53                 ng-messages="hopperForm.dateRangeFrom.$error"
54                 ng-show="hopperForm.dateRangeFrom.$touched"
55                 role="alert"
56               >
57                 <div ng-message="required">
58                   <span translate="MOTIONDIALER.ERRORS.DATE_REQUIRED"
59                     >Date is required</span
60                   >
61                 </div>
62                 <div ng-message="format">
63                   <span translate="MOTIONDIALER.ERRORS.DATE_INVALID"
64                     >Date is invalid</span
65                   >
66                 </div>
67               </div>
68             </mdp-date-picker>
69           </div>
70           <div flex class="md-block">
71             <mdp-time-picker
72               mdp-open-on-click
73               name="scheduledatTime"
74               mdp-placeholder="Time"
75               mdp-format="HH:mm:ss"
76               mdp-auto-switch="true"
77               ng-model="vm.hopper.scheduledat"
78               ng-init="vm.hopper.scheduledat = vm.getDateFromString(vm.hopper.scheduledat)"
79             >
80               <div
81                 ng-messages="hopperForm.timeRangeFrom.$error"
82                 ng-show="hopperForm.timeRangeFrom.$touched"
83                 role="alert"
84               >
85                 <div ng-message="required">
86                   <span translate="MOTIONDIALER.ERRORS.TIME_REQUIRED"
87                     >Time is required</span
88                   >
89                 </div>
90                 <div ng-message="format">
91                   <span translate="MOTIONDIALER.ERRORS.TIME_INVALID"
92                     >Time is invalid</span
93                   >
94                 </div>
95               </div>
96             </mdp-time-picker>
97           </div>
98         </md-content>
99       </div>
100       <md-input-container class="md-block">
101         <label translate="MOTIONDIALER.PRIORITY">Priority</label>
102         <md-select name="priority" ng-model="vm.hopper.priority">
103           <md-option ng-value="'4'">Highest</md-option>
104           <md-option ng-value="'3'">High</md-option>
105           <md-option ng-value="'2'">Medium</md-option>
106           <md-option ng-value="'1'">Low</md-option>
107           <md-option ng-value="'0'">Lowest</md-option>
108         </md-select>
109         <div class="hint">
110           <span translate="MOTIONDIALER.HELP.PRIORITY"></span>
111         </div>
112         <div
113           ng-messages="hopperForm['priority'].$error"
114           ng-show="hopperForm['priority'].$touched"
115           role="alert"
116         >
117           <div ng-message="required">
118             <span translate="MOTIONDIALER.ERRORS.PRIORITY_REQUIRED"
119               >Priority field is required</span
120             >
121           </div>
122         </div>
123       </md-input-container>
124       <md-input-container class="md-block">
125         <md-switch ng-model="vm.hopper.recallme" aria-label="RecallAgent"
126           ><span translate="MOTIONDIALER.RECALLAGENT"
127             >RecallAgent</span
128           ></md-switch
129         >
130       </md-input-container>
131       <md-input-container ng-if="vm.hopper.recallme" class="md-block">
132         <label translate="MOTIONDIALER.AGENT">Agent</label>
133         <md-select name="UserId" ng-model="vm.hopper.UserId" required>
134           <md-option
135             ng-value="UserId.id"
136             ng-repeat="UserId in vm.agents"
137             ng-disabled="UserId.canSelect === false"
138             >{{ UserId.name }}</md-option
139           >
140         </md-select>
141         <div
142           ng-messages="hopperForm['UserId'].$error"
143           ng-show="hopperForm['UserId'].$touched"
144           role="alert"
145         >
146           <div ng-message="required">
147             <span translate="MOTIONDIALER.ERRORS.AGENT_REQUIRED"
148               >Agent field is required</span
149             >
150           </div>
151         </div>
152       </md-input-container>
153
154       <div class="error-list">
155         <div
156           ng-repeat="error in vm.errors"
157           class="error"
158           layout="row"
159           layout-align="space-between center"
160         >
161           <div>
162             <span class="message">{{error.message}}</span>
163             <span class="type">({{error.type}})</span>
164           </div>
165           <md-button class="md-icon-button">
166             <md-icon
167               md-font-icon="icon-alert-box"
168               aria-label="alert error"
169               class="s16"
170             ></md-icon>
171           </md-button>
172         </div>
173       </div>
174     </md-dialog-content>
175
176     <md-dialog-actions
177       layout="row"
178       layout-align="space-between center"
179       ng-if="!vm.crudPermissions.readOnly"
180     >
181       <div layout="row" layout-align="start center">
182         <md-button
183           type="submit"
184           ng-if="vm.crudPermissions.canEdit && !vm.newHopper"
185           ng-click="vm.saveHopper()"
186           class="send-button md-accent md-raised"
187           ng-disabled="hopperForm.$invalid || hopperForm.$pristine"
188           aria-label="SAVE"
189           translate="MOTIONDIALER.SAVE"
190           translate-attr-aria-label="MOTIONDIALER.SAVE"
191         >
192           SAVE
193         </md-button>
194
195         <md-button
196           type="submit"
197           ng-if="vm.crudPermissions.canEdit && vm.newHopper"
198           ng-click="vm.addNewHopper()"
199           class="send-button md-accent md-raised"
200           ng-disabled="hopperForm.$invalid"
201           aria-label="ADD"
202           translate="MOTIONDIALER.ADD_HOPPER"
203           translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER"
204         >
205           ADD HOPPER
206         </md-button>
207       </div>
208       <div layout="row">
209         <md-button
210           class="md-icon-button"
211           ng-if="vm.crudPermissions.canDelete && !vm.newHopper"
212           ng-click="vm.deleteHopper($event)"
213           aria-label="DELETE"
214           translate
215           translate-attr-aria-label="MOTIONDIALER.DELETE"
216         >
217           <md-icon md-font-icon="icon-delete"></md-icon>
218           <md-tooltip
219             ><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip
220           >
221         </md-button>
222       </div>
223     </md-dialog-actions>
224   </form>
225 </md-dialog>