{{ tr().rules.title }} {{ activeRuleCount }} {{ tr().rules.active }} {{ tr().rules.subtitle }}
{{ tr().rules.priorityInfo }}
@for (rule of rules; track rule.id; let i = $index) {
@if (editingRuleId() !== rule.id) {
{{ i + 1 }}. {{ rule.name }}
{{ rule.force === 'obligation' ? tr().rules.obligation : tr().rules.preference }}
} @else {

{{ tr().rules.editRule }}

{{ tr().rules.ruleName }} {{ tr().rules.force }} @for (option of forceOptions; track option.value) { {{ option.label() }} } @if ($any(editBuffer).type === RuleType.IF_THEN) {
{{ tr().rules.holidayFalls }} @for (day of daysOfWeek; track day.value) { {{ day.label }} }
{{ tr().rules.place }} {{ tr().rules.days }} {{ tr().rules.type }} @for (type of placeDayTypes; track type) { {{ getDayTypeLabel(type) }} } {{ tr().rules.position }} @for (opt of placementOptions; track opt.value) { {{ opt.label }} }
{{ tr().rules.getBonus }} {{ tr().rules.days }} {{ tr().rules.type }} @for (type of rewardDayTypes; track type) { {{ getDayTypeLabel(type) }} }
} @else if ($any(editBuffer).type === RuleType.OPTIMIZATION) { } @else {
{{ tr().rules.startDate }} {{ tr().rules.endDate }}
{{ tr().rules.place }} {{ tr().rules.days }} {{ tr().rules.type }} @for (type of placeDayTypes; track type) { {{ getDayTypeLabel(type) }} }
} @if (validationError()) {

{{ validationError() }}

}
}
} @if (isAddingNew()) {

{{ tr().rules.addRule }}

{{ tr().rules.ruleName }} {{ tr().rules.force }} @for (option of forceOptions; track option.value) { {{ option.label() }} } @if (newRuleType() === RuleType.IF_THEN) {
{{ tr().rules.holidayFalls }} @for (day of daysOfWeek; track day.value) { {{ day.label }} }
{{ tr().rules.place }} {{ tr().rules.days }} {{ tr().rules.type }} @for (type of placeDayTypes; track type) { {{ getDayTypeLabel(type) }} } {{ tr().rules.position }} @for (opt of placementOptions; track opt.value) { {{ opt.label }} }
{{ tr().rules.getBonus }} {{ tr().rules.days }} {{ tr().rules.type }} @for (type of rewardDayTypes; track type) { {{ getDayTypeLabel(type) }} }
} @else if ($any(editBuffer).type === RuleType.OPTIMIZATION) { } @else {
{{ tr().rules.startDate }} {{ tr().rules.endDate }}
{{ tr().rules.place }} {{ tr().rules.days }} {{ tr().rules.type }} @for (type of placeDayTypes; track type) { {{ getDayTypeLabel(type) }} }
} @if (validationError()) {

{{ validationError() }}

}
}
@if (optimizationConfiguration; as configuration) {
{{ tr().rules.optimization.elementsLabel }} @for (elements of optimizationElements; track elements) { {{ tr().rules.optimization.elements[elements] }} } {{ tr().rules.optimization.measureLabel }} @for (row of optimizationMeasures; track row.measure) { {{ tr().rules.optimization.measures[row.measure] }} }
@if (optimizationConditions.length) { {{ tr().rules.optimization.conditionsLabel }} @for (condition of optimizationConditions; track condition) { {{ tr().rules.optimization.conditions[condition] }} } }
{{ tr().rules.optimization.aggregationLabel }} @for (aggregation of optimizationAggregations; track aggregation) { {{ tr().rules.optimization.aggregations[aggregation] }} } {{ tr().rules.optimization.directionLabel }} @for (direction of optimizationDirections; track direction) { {{ tr().rules.optimization.directions[direction] }} } @if (configuration.measure === 'work-sequence-deficit') { {{ tr().rules.optimization.thresholdLabel }} }
}