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.TYPE">Type</label>
45 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
47 <md-option ng-value="type" ng-repeat="type in vm.types"
48 >{{ type | ucfirst }}</md-option
53 <md-input-container class="md-block" ng-if="vm.type === 'list'">
54 <label translate="TOOLS.INTERVALS">Intervals</label>
56 ng-model="vm.interval.IntervalId"
57 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
59 <md-option ng-value="interval.id" ng-repeat="interval in vm.intervals"
60 >{{ interval.name }}</md-option
65 <!-- TIMERANGE START -->
66 <label ng-if="vm.type === 'custom'" translate="TOOLS.TIME_RANGE"
69 <div layout="row" ng-if="vm.type === 'custom'">
70 <div class="md-block" flex>
73 mdp-placeholder="FROM"
74 ng-model="vm.timeRangeFrom"
76 mdp-auto-switch="true"
77 mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
80 ng-messages="intervalForm.timeRangeFrom.$error"
81 ng-show="intervalForm.timeRangeFrom.$touched"
84 <div ng-message="format">
85 <span translate="TOOLS.ERRORS.TIME_RANGE_FROM_INVALID"
86 >Time Range From field is invalid</span
92 <div class="md-block" flex ng-if="vm.timeRangeFrom">
96 ng-model="vm.timeRangeTo"
98 mdp-auto-switch="true"
99 mdp-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
103 ng-messages="intervalForm.timeRangeTo.$error"
104 ng-show="intervalForm.timeRangeTo.$invalid"
107 <div ng-message="format">
108 <span translate="TOOLS.ERRORS.TIME_RANGE_TO_INVALID"
109 >Time Range To field is invalid</span
112 <div ng-message="required">
113 <span translate="TOOLS.ERRORS.TIME_RANGE_TO_REQUIRED"
114 >Time Range To field is required</span
121 <!-- TIMERANGE END -->
123 <!-- DAYSOFWEEK START -->
124 <label ng-if="vm.type === 'custom'" translate="TOOLS.WEEK_DAYS"
127 <div layout="row" ng-if="vm.type === 'custom'">
128 <md-input-container flex class="md-block">
129 <label translate="TOOLS.FROM">From</label>
131 ng-model="vm.dayOfWeekFrom"
132 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
134 <md-option ng-value="null"
135 ><span translate="TOOLS.ALWAYS">Always</span></md-option
137 <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"
138 ><span translate="TOOLS.{{day.value | uppercase}}"
139 >{{ day.value | ucfirst }}</span
143 </md-input-container>
145 <md-input-container flex class="md-block" ng-if="vm.dayOfWeekFrom">
146 <label translate="TOOLS.TO">To</label>
149 ng-model="vm.dayOfWeekTo"
150 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
152 <md-option ng-value="day.value" ng-repeat="day in vm.daysOfWeek"
153 ><span translate="TOOLS.{{day.value | uppercase}}"
154 >{{ day.value | ucfirst }}</span
159 ng-messages="intervalForm.dayOfWeekTo.$error"
160 ng-show="intervalForm.dayOfWeekTo.$touched"
163 </md-input-container>
165 <!-- DAYSOFWEEK END -->
167 <!-- MONTHDAY START -->
168 <label ng-if="vm.type === 'custom'" translate="TOOLS.MONTH_DAYS"
171 <div layout="row" ng-if="vm.type === 'custom'">
172 <md-input-container flex layout="column" class="md-block">
173 <label translate="TOOLS.FROM">From</label>
175 ng-model="vm.monthDayFrom"
176 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
178 <md-option ng-value="null"
179 ><span translate="TOOLS.ALWAYS">Always</span></md-option
181 <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth"
182 >{{ month }}</md-option
185 </md-input-container>
191 ng-if="vm.monthDayFrom"
193 <label translate="TOOLS.TO">To</label>
196 ng-model="vm.monthDayTo"
197 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
199 <md-option ng-value="month" ng-repeat="month in vm.daysOfMonth"
200 >{{ month }}</md-option
204 ng-messages="intervalForm.monthDayTo.$error"
205 ng-show="intervalForm.monthDayTo.$touched"
208 </md-input-container>
210 <!-- MONTHDAY END -->
213 <label ng-if="vm.type === 'custom'" translate="TOOLS.MONTHS"
216 <div layout="row" ng-if="vm.type === 'custom'">
217 <md-input-container flex layout="column" class="md-block">
218 <label translate="TOOLS.FROM">From</label>
220 ng-model="vm.monthFrom"
221 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
223 <md-option ng-value="null"
224 ><span translate="TOOLS.ALWAYS">Always</span></md-option
226 <md-option ng-value="month.value" ng-repeat="month in vm.monthName"
227 ><span translate="TOOLS.{{month.value | uppercase}}"
228 >{{ month.value | ucfirst }}</span
232 </md-input-container>
240 <label translate="TOOLS.TO">To</label>
243 ng-model="vm.monthTo"
244 ng-disabled="!vm.newInterval && !vm.crudPermissions.canEdit"
246 <md-option ng-value="month.value" ng-repeat="month in vm.monthName"
247 ><span translate="TOOLS.{{month.value | uppercase}}"
248 >{{ month.value | ucfirst }}</span
253 ng-messages="intervalForm.monthTo.$error"
254 ng-show="intervalForm.monthTo.$touched"
257 </md-input-container>
261 <div class="error-list">
263 ng-repeat="error in vm.errors"
266 layout-align="space-between center"
269 <span class="message">{{error.message}}</span>
270 <span class="type">({{error.type}})</span>
272 <md-button class="md-icon-button">
274 md-font-icon="icon-alert-box"
275 aria-label="alert error"
283 <md-dialog-actions layout="row" layout-align="space-between center">
284 <div layout="row" layout-align="start center">
287 ng-if="!vm.newInterval && vm.crudPermissions.canEdit"
288 ng-click="vm.saveInterval()"
289 class="send-button md-accent md-raised"
290 ng-disabled="intervalForm.$invalid || intervalForm.$pristine"
292 translate="TOOLS.SAVE"
293 translate-attr-aria-label="TOOLS.SAVE"
300 ng-if="vm.newInterval && vm.crudPermissions.canEdit"
301 ng-click="vm.addNewInterval()"
302 class="send-button md-accent md-raised"
303 ng-disabled="intervalForm.$invalid"
305 translate="TOOLS.ADD_INTERVAL"
306 translate-attr-aria-label="TOOLS.ADD_INTERVAL"