1 <ng-template #dialogContent>
2 <div class="modal-header bg-info">
3 <h3 *ngIf="mode === 'create'" class="modal-title" i18n>New Distribution Formula</h3>
4 <h3 *ngIf="mode === 'update'" class="modal-title" i18n>Modify Distribution Formula</h3>
5 <h3 *ngIf="mode === 'clone'" class="modal-title" i18n>Clone Distribution Formula (from {{clonedLabel}})</h3>
6 <button type="button" class="close"
7 i18n-aria-label aria-label="Close" (click)="close()">
8 <span aria-hidden="true">×</span>
11 <div class="modal-body">
12 <form #myForm="ngForm" role="form" class="form-validated">
13 <div class="form-group row mt-2" *ngIf="formula">
14 <label for="formula-name" class="col-sm-1 col-form-label" i18n>Formula Name
16 <div class="col-sm-2">
17 <input class="form-control" type="text" id="formula-name"
19 [ngModel]="formula.name()" name="name"
20 (ngModelChange)="formula.name($event)">
22 <label for="formula-owner" class="col-sm-1 col-form-owner" i18n>Formula Owner
24 <div class="col-sm-2">
26 placeholder="Owner..."
29 [applyOrgId]="formula.owner()"
30 (onChange)="formula.owner($event); myForm.form.markAsDirty()">
33 <label for="formula-skip_count" class="col-sm-1 col-form-skip_count" i18n>Skip Count
35 <div class="col-sm-1">
36 <input class="form-control" type="number" id="formula-name"
37 [ngModel]="formula.skip_count()" name="skip_count"
38 (ngModelChange)="formula.skip_count($event)">
41 <div class="row mt-2">
42 <div class="col-sm-1"></div>
43 <div class="col-sm-1" i18n>Owning Library</div>
44 <div class="col-sm-2" i18n>Shelving Location</div>
45 <div class="col-sm-2" i18n>Fund</div>
46 <div class="col-sm-2" i18n>Circ Modifier</div>
47 <div class="col-sm-1" i18n>Collection Code</div>
48 <div class="col-sm-1" i18n>Item Count</div>
49 <div class="col-sm-1"></div>
51 <div class="form-group row mt-2" *ngFor="let entry of formula?.entries(); index as idx; last as isLast; first as isFirst; count as count">
52 <div class="col-sm-1">
53 <button *ngIf="!isLast" class="btn btn-sm material-icon-button" type="button"
54 (click)="removeRow(idx)"
55 i18n-title title="Remove Entry"><span class="sr-only">Remove Entry</span>
56 <span class="material-icons" aria-hidden="true">delete</span>
59 <div class="col-sm-1">
61 placeholder="Owning Library..."
63 domId="entry-owning-lib-{{idx}}"
64 [applyOrgId]="entry.owning_lib()"
65 (onChange)="entry.owning_lib($event); myForm.form.markAsDirty()">
68 <div class="col-sm-2">
69 <eg-item-location-select
70 permFilter="CREATE_PURCHASE_ORDER"
71 [ngModel]="entry.location()" name="location-{{idx}}"
72 (ngModelChange)="entry.location($event)"
73 (valueChange)="myForm.form.markAsDirty()">
74 </eg-item-location-select>
76 <div class="col-sm-2">
77 <eg-combobox i18n-placeholder placeholder="Fund..." idlClass="acqf"
78 id="entry-fund-{{idx}}"
79 [asyncSupportsEmptyTermClick]="true"
80 [selectedId]="entry.fund()"
82 (onChange)="entry.fund($event.id)">
85 <div class="col-sm-2">
86 <eg-combobox i18n-placeholder placeholder="Circ Modifier..." idlClass="ccm"
87 id="entry-circ_modifier-{{idx}}"
88 [asyncSupportsEmptyTermClick]="true"
89 [selectedId]="entry.circ_modifier()"
90 name="circ_modifier-{{idx}}"
91 (onChange)="entry.circ_modifier($event.id)">
94 <div class="col-sm-1">
95 <input class="form-control" type="text" i18n-placeholder placeholder="Collection Code..."
96 id="entry-collection-code-{{idx}}"
97 [ngModel]="entry.collection_code()" name="collection_code-{{idx}}"
98 (ngModelChange)="entry.collection_code($event)">
100 <div class="col-sm-1">
101 <input class="form-control" type="number"
102 [ngModel]="entry.item_count()" name="item_count-{{idx}}"
103 (ngModelChange)="entry.item_count($event)">
105 <div class="col-sm-1">
106 <button *ngIf="!isLast" class="btn btn-sm material-icon-button" type="button"
108 (click)="moveUp(idx)"
109 i18n-title title="Move Up"><span class="sr-only">Move Up</span>
110 <span class="material-icons" aria-hidden="true">keyboard_arrow_up</span>
112 <button *ngIf="!isLast" class="btn btn-sm material-icon-button" type="button"
113 (click)="moveDown(idx)"
114 [disabled]="count < 3 || idx === count - 2"
115 i18n-title title="Move Down"><span class="sr-only">Move Down</span>
116 <span class="material-icons" aria-hidden="true">keyboard_arrow_down</span>
118 <button *ngIf="isLast" type="button" class="btn btn-info" (click)="addRow()" i18n>Add</button>
123 <div class="modal-footer">
124 <button type="button" class="btn btn-info" [disabled]="!myForm?.valid || !(myForm?.dirty)"
125 (click)="save()" i18n>Save</button>
126 <button type="button" class="btn btn-warning"
127 (click)="close()" i18n>Cancel</button>
131 <ng-template #defaultCloneLabelTmpl i18n>{{clonedLabel}} (clone)</ng-template>
132 <eg-string #defaultCloneLabel [template]="defaultCloneLabelTmpl"></eg-string>