1 <md-dialog class="inboundroute-dialog" aria-label="New Interval">
2 <form name="intervalForm" class="md-inline-form" novalidate>
3 <md-toolbar class="md-accent md-hue-2">
5 class="md-toolbar-tools"
7 layout-align="space-between center"
9 <span class="title">{{ vm.title | translate }}</span>
10 <md-button class="md-icon-button" ng-click="vm.closeDialog()">
12 md-font-icon="icon-close"
13 aria-label="Close dialog"
19 <md-dialog-content ms-scroll>
20 <div class="error-list">
22 ng-repeat="error in vm.errors"
25 layout-align="space-between center"
28 <span class="message">{{error.message}}</span>
29 <span class="type">({{error.type}})</span>
31 <md-button class="md-icon-button">
33 md-font-icon="icon-alert-box"
34 aria-label="alert error"
41 <md-input-container class="md-block">
42 <label translate="TOOLS.NAME">Name</label>
44 ng-model="vm.interval.name"
47 placeholder="{{'TOOLS.NAME' | translate}}"
48 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
53 ng-messages="intervalForm.name.$error"
54 ng-show="intervalForm.name.$touched"
57 <div ng-message="required">
58 <span translate="TOOLS.ERRORS.NAME_REQUIRED"
59 >Name field is required</span
65 <md-input-container class="md-block">
66 <label translate="TOOLS.TYPE">Type</label>
69 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
71 <md-option ng-value="type" ng-repeat="type in vm.types"
72 >{{ type | ucfirst }}</md-option
77 <md-input-container class="md-block" ng-if="vm.type === 'list'">
78 <label translate="TOOLS.INTERVALS">Intervals</label>
80 ng-model="vm.interval.IntervalId"
81 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
83 <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals"
84 >{{ interval.name }}</md-option
89 <!-- TIMERANGE START -->
90 <label ng-if="vm.type === 'custom'" translate="TOOLS.TIME_RANGE"
93 <div layout="row" ng-if="vm.type === 'custom'">
94 <div class="md-block" flex>
97 mdp-placeholder="FROM"
98 ng-model="vm.timeRangeFrom"
100 mdp-auto-switch="true"
101 mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
104 ng-messages="intervalForm.timeRangeFrom.$error"
105 ng-show="intervalForm.timeRangeFrom.$touched"
108 <div ng-message="format">
109 <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID"
110 >Time Range From field is invalid</span
116 <div class="md-block" flex ng-if="vm.timeRangeFrom">
119 mdp-placeholder="TO*"
120 ng-model="vm.timeRangeTo"
122 mdp-auto-switch="true"
123 mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
127 ng-messages="intervalForm.timeRangeTo.$error"
128 ng-show="intervalForm.timeRangeTo.$invalid"
131 <div ng-message="format">
132 <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID"
133 >Time Range To field is invalid</span
136 <div ng-message="required">
137 <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED"
138 >Time Range To field is required</span
145 <!-- TIMERANGE END -->
147 <!-- DAYSOFWEEK START -->
148 <label ng-if="vm.type === 'custom'" translate="TOOLS.WEEK_DAYS"
151 <div layout="row" ng-if="vm.type === 'custom'">
152 <md-input-container flex class="md-block">
153 <label translate="TOOLS.FROM">From</label>
155 ng-model="vm.dayOfWeekFrom"
156 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
158 <md-option ng-value="null"
159 ><span translate="TOOLS.ALWAYS">Always</span></md-option
161 <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"
162 ><span translate="TOOLS.{{day.value | uppercase}}"
163 >{{ day.value | ucfirst }}</span
167 </md-input-container>
169 <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">
170 <label translate="TOOLS.TO">To</label>
173 ng-model="vm.dayOfWeekTo"
174 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
176 <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"
177 ><span translate="TOOLS.{{day.value | uppercase}}"
178 >{{ day.value | ucfirst }}</span
183 ng-messages="intervalForm.dayOfWeekTo.$error"
184 ng-show="intervalForm.dayOfWeekTo.$touched"
187 </md-input-container>
189 <!-- DAYSOFWEEK END -->
191 <!-- MONTHDAY START -->
192 <label ng-if="vm.type === 'custom'" translate="TOOLS.MONTH_DAYS"
195 <div layout="row" ng-if="vm.type === 'custom'">
196 <md-input-container flex layout="column" class="md-block">
197 <label translate="TOOLS.FROM">From</label>
199 ng-model="vm.monthDayFrom"
200 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
202 <md-option ng-value="null"
203 ><span translate="TOOLS.ALWAYS">Always</span></md-option
205 <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth"
206 >{{ month }}</md-option
209 </md-input-container>
215 ng-if="vm.monthDayFrom"
217 <label translate="TOOLS.TO">To</label>
220 ng-model="vm.monthDayTo"
221 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
223 <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth"
224 >{{ month }}</md-option
228 ng-messages="intervalForm.monthDayTo.$error"
229 ng-show="intervalForm.monthDayTo.$touched"
232 </md-input-container>
234 <!-- MONTHDAY END -->
237 <label ng-if="vm.type === 'custom'" translate="TOOLS.MONTHS"
240 <div layout="row" ng-if="vm.type === 'custom'">
241 <md-input-container flex layout="column" class="md-block">
242 <label translate="TOOLS.FROM">From</label>
244 ng-model="vm.monthFrom"
245 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
247 <md-option ng-value="null"
248 ><span translate="TOOLS.ALWAYS">Always</span></md-option
250 <md-option ng-value="month.value" ng-repeat="month in vm.monthName"
251 ><span translate="TOOLS.{{month.value | uppercase}}"
252 >{{ month.value | ucfirst }}</span
256 </md-input-container>
264 <label translate="TOOLS.TO">To</label>
267 ng-model="vm.monthTo"
268 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
270 <md-option ng-value="month.value" ng-repeat="month in vm.monthName"
271 ><span translate="TOOLS.{{month.value | uppercase}}"
272 >{{ month.value | ucfirst }}</span
277 ng-messages="intervalForm.monthTo.$error"
278 ng-show="intervalForm.monthTo.$touched"
281 </md-input-container>
285 <div class="error-list">
287 ng-repeat="error in vm.errors"
290 layout-align="space-between center"
293 <span class="message">{{error.message}}</span>
294 <span class="type">({{error.type}})</span>
296 <md-button class="md-icon-button">
298 md-font-icon="icon-alert-box"
299 aria-label="alert error"
307 <md-dialog-actions layout="row" layout-align="space-between center">
308 <div layout="row" layout-align="start center">
311 ng-if="!vm.newInterval && vm.crudPermissions.canEdit"
312 ng-click="vm.saveInterval()"
313 class="send-button md-accent md-raised"
314 ng-disabled="intervalForm.$invalid || intervalForm.$pristine"
316 translate="TOOLS.SAVE"
317 translate-attr-aria-label="TOOLS.SAVE"
324 ng-if="vm.newInterval && vm.crudPermissions.canEdit"
325 ng-click="vm.addNewInterval()"
326 class="send-button md-accent md-raised"
327 ng-disabled="intervalForm.$invalid"
329 translate="TOOLS.ADD_INTERVAL"
330 translate-attr-aria-label="TOOLS.ADD_INTERVAL"