68f0cb9279ab92fef84623e7156498c9ad52c401
[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
125       <div class="error-list">
126         <div
127           ng-repeat="error in vm.errors"
128           class="error"
129           layout="row"
130           layout-align="space-between center"
131         >
132           <div>
133             <span class="message">{{error.message}}</span>
134             <span class="type">({{error.type}})</span>
135           </div>
136           <md-button class="md-icon-button">
137             <md-icon
138               md-font-icon="icon-alert-box"
139               aria-label="alert error"
140               class="s16"
141             ></md-icon>
142           </md-button>
143         </div>
144       </div>
145     </md-dialog-content>
146
147     <md-dialog-actions
148       layout="row"
149       layout-align="space-between center"
150       ng-if="!vm.crudPermissions.readOnly"
151     >
152       <div layout="row" layout-align="start center">
153         <md-button
154           type="submit"
155           ng-if="vm.crudPermissions.canEdit && !vm.newHopper"
156           ng-click="vm.saveHopper()"
157           class="send-button md-accent md-raised"
158           ng-disabled="hopperForm.$invalid || hopperForm.$pristine"
159           aria-label="SAVE"
160           translate="MOTIONDIALER.SAVE"
161           translate-attr-aria-label="MOTIONDIALER.SAVE"
162         >
163           SAVE
164         </md-button>
165
166         <md-button
167           type="submit"
168           ng-if="vm.crudPermissions.canEdit && vm.newHopper"
169           ng-click="vm.addNewHopper()"
170           class="send-button md-accent md-raised"
171           ng-disabled="hopperForm.$invalid"
172           aria-label="ADD"
173           translate="MOTIONDIALER.ADD_HOPPER"
174           translate-attr-aria-label="MOTIONDIALER.ADD_HOPPER"
175         >
176           ADD HOPPER
177         </md-button>
178       </div>
179       <div layout="row">
180         <md-button
181           class="md-icon-button"
182           ng-if="vm.crudPermissions.canDelete && !vm.newHopper"
183           ng-click="vm.deleteHopper($event)"
184           aria-label="DELETE"
185           translate
186           translate-attr-aria-label="MOTIONDIALER.DELETE"
187         >
188           <md-icon md-font-icon="icon-delete"></md-icon>
189           <md-tooltip
190             ><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip
191           >
192         </md-button>
193       </div>
194     </md-dialog-actions>
195   </form>
196 </md-dialog>