LP 1857351: reorder a few other fm-editors
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / admin / local / admin-carousel.component.html
1 <eg-title i18n-prefix prefix="{{classLabel}} Administration">
2 </eg-title>
3 <eg-staff-banner bannerText="{{classLabel}} Configuration" i18n-bannerText>
4 </eg-staff-banner>
5
6 <ng-template #successStrTmpl i18n>{{idlClassDef.label}} Update Succeeded</ng-template>
7 <eg-string #successString [template]="successStrTmpl"></eg-string>
8
9 <ng-template #updateFailedStrTmpl i18n>Update of {{idlClassDef.label}} failed</ng-template>
10 <eg-string #updateFailedString [template]="updateFailedStrTmpl"></eg-string>
11
12 <ng-template #deleteFailedStrTmpl i18n>Delete of carousel faiiled or was not allowed</ng-template>
13 <eg-string #deleteFailedString [template]="deleteFailedStrTmpl"></eg-string>
14
15 <ng-template #deleteSuccessStrTmpl i18n>Carousel Successfully Deleted</ng-template>
16 <eg-string #deleteSuccessString [template]="deleteSuccessStrTmpl"></eg-string>
17
18 <ng-template #createStrTmpl i18n>{{idlClassDef.label}} Succeessfully Created</ng-template>
19 <eg-string #createString [template]="createStrTmpl"></eg-string>
20
21 <ng-template #createErrStrTmpl i18n>Failed to create new {{idlClassDef.label}}</ng-template>
22 <eg-string #createErrString [template]="createErrStrTmpl"></eg-string>
23
24 <ng-template #refreshStrTmpl i18n let-name="name">{{name}} is being refreshed. It may take a couple minutes.</ng-template>
25 <eg-string #refreshString [template]="refreshStrTmpl"></eg-string>
26
27 <ng-template #refreshErrStrTmpl i18n let-name="name">{{name}} is manual and cannot be refreshed automatically.</ng-template>
28 <eg-string #refreshErrString [template]="refreshErrStrTmpl"></eg-string>
29
30 <ng-container *ngIf="orgField">
31   <eg-org-family-select
32     [limitPerms]="viewPerms"
33     [selectedOrgId]="contextOrg.id()"
34     [(ngModel)]="searchOrgs"
35     (ngModelChange)="grid.reload()">
36   </eg-org-family-select>
37   <hr/>
38 </ng-container>
39
40 <!-- idlObject and fieldName applied programmatically -->
41 <eg-translate #translator></eg-translate>
42
43 <eg-grid #grid idlClass="{{idlClass}}" [dataSource]="dataSource" 
44     [sortable]="true" persistKey="{{persistKey}}"
45     [stickyHeader]="true">
46   <eg-grid-toolbar-button [disabled]="!canCreate" 
47     label="New {{idlClassDef.label}}" i18n-label [action]="createNew">
48   </eg-grid-toolbar-button>
49   <eg-grid-toolbar-button [disabled]="translatableFields.length == 0" 
50     label="Apply Translations" i18n-label [action]="translate">
51   </eg-grid-toolbar-button>
52   <eg-grid-toolbar-action label="Edit Selected" i18n-label [action]="editSelected">
53   </eg-grid-toolbar-action>
54   <eg-grid-toolbar-action label="Delete Selected" i18n-label [action]="deleteSelected">
55   </eg-grid-toolbar-action>
56   <eg-grid-toolbar-action label="Refesh Selected" i18n-label [action]="refreshSelected">
57   </eg-grid-toolbar-action>
58   <eg-grid-column path="bucket" [hidden]="true"></eg-grid-column>
59   <eg-grid-column path="creator" [hidden]="true"></eg-grid-column>
60   <eg-grid-column path="editor" [hidden]="true"></eg-grid-column>
61   <eg-grid-column path="create_time" [hidden]="true"></eg-grid-column>
62   <eg-grid-column path="edit_time" [hidden]="true"></eg-grid-column>
63   <eg-grid-column path="age_filter" [hidden]="true"></eg-grid-column>
64   <eg-grid-column path="owning_lib_filter" [hidden]="true"></eg-grid-column>
65   <eg-grid-column path="copy_location_filter" [hidden]="true"></eg-grid-column>
66 </eg-grid>
67
68 <ng-template #bucketTemplate
69     let-field="field" let-record="record">
70   <span *ngIf="record[field.name]()">
71     <a href="/eg/staff/cat/bucket/record/view/{{record[field.name]()}}" target="_blank" i18n>Link to bucket</a>
72     <span *ngIf="record['type']() !== 1" i18n style="font-style: italic"> (Note: changes to bucket contents may be overwritten by the next carousel update.)</span>
73   </span>
74 </ng-template>
75
76 <ng-template #locationTemplate
77     let-field="field" let-record="record">
78   <eg-multi-select idlClass="acpl" linkedLibraryLabel="owning_lib"
79                    [startValue]="record['copy_location_filter']()"
80                    (onChange)="record['copy_location_filter']($event)">
81   </eg-multi-select>
82 </ng-template>
83 <ng-template #orgTemplate
84     let-field="field" let-record="record">
85   <eg-multi-select idlClass="aou"
86                    [startValue]="record['owning_lib_filter']()"
87                    (onChange)="record['owning_lib_filter']($event)">
88   </eg-multi-select>
89 </ng-template>
90
91 <eg-fm-record-editor #editDialog idlClass="{{idlClass}}" 
92     [preloadLinkedValues]="true"
93     fieldOrder="owner,name,type,age_filter,max_items,owning_lib_filter,copy_location_filter,active,id,bucket,last_refresh_time,creator,create_time,editor,edit_time"
94     hiddenFieldsList="creator,editor,create_time,edit_time"
95     [preSave]="mungeCarousel" (recordSaved)="postSave($event)"
96     readonlyFields="last_refresh_time"
97     [fieldOptions]="{bucket:{customTemplate:{template:bucketTemplate}},copy_location_filter:{customTemplate:{template:locationTemplate}},owning_lib_filter:{customTemplate:{template:orgTemplate}}}"
98 ></eg-fm-record-editor>
99