]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/eg2/src/app/staff/share/marc-edit/authority-linking-dialog.component.html
LP2061136 - Stamping 1405 DB upgrade script
[working/Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / share / marc-edit / authority-linking-dialog.component.html
1
2 <!-- display a single heading as MARC -->
3 <ng-template #fieldAsMarc let-field="field">
4   <span>{{field.tag}} {{field.ind1}} {{field.ind2}}</span>
5   <span *ngFor="let sf of field.subfields">
6     <span class="text-danger" i18n>‡</span>{{sf[0]}} {{sf[1]}}
7   </span>
8 </ng-template>
9
10 <!-- MARC edit-ception! -->
11 <eg-marc-editor-dialog #marcEditDialog recordType="authority">
12 </eg-marc-editor-dialog>
13
14 <!-- display a single heading as MARC or as the human friendlier string -->
15 <ng-template #headingField 
16   let-field="field" let-from="from" let-also="also" let-authId="authId">
17   <button type="button" class="btn btn-sm p-1 me-1" 
18     [ngClass]="{'btn-outline-primary': !(from || also), 'btn-outline-info': (from || also)}"
19     (click)="applyHeading(field, authId)" i18n>Apply</button>
20   <ng-container *ngIf="showAs === 'heading'">
21     <span *ngIf="from" i18n>See From: {{field.heading}}</span>
22     <span *ngIf="also" i18n>See Also: {{field.heading}}</span>
23     <span *ngIf="!from && !also" i18n>{{field.heading}}</span>
24   </ng-container>
25   <ng-container *ngIf="showAs === 'marc'">
26     <ng-container
27       *ngTemplateOutlet="fieldAsMarc;context:{field:field}">
28     </ng-container>
29   </ng-container>
30 </ng-template>
31
32 <ng-template #dialogContent>
33   <div class="modal-header">
34     <h4 class="modal-title" i18n>Manage Authority Links</h4>
35     <button type="button" class="btn-close btn-close-white"
36       i18n-aria-label aria-label="Close" (click)="close()"></button>
37   </div>
38   <div class="modal-body">
39     <div class="row border-bottom border-secondary p-2 d-flex">
40       <div class="flex-1 fw-bold p-1 ps-2 pt-2 ms-2">
41         <div>{{bibField.tag}} {{bibField.ind1}} {{bibField.ind2}}</div>
42
43         <div *ngFor="let sf of bibField.subfields">
44           <div class="form-check form-check-inline">
45             <input class="form-check-input" id="search-subfield-{{sf[0]}}" 
46               type="checkbox" [disabled]="!isControlledBibSf(sf[0])"
47               [(ngModel)]="selectedSubfields[sf[0]]" 
48               (change)="getPage(pager.offset)"/>
49
50             <span class="text-danger" i18n>‡</span>
51
52             <label class="form-label form-check-label" for="search-subfield-{{sf[0]}}" i18n>
53               {{sf[0]}} {{sf[1]}}
54             </label>
55           </div>
56         </div>
57       </div>
58       <div class="ms-2 p-1">
59         <div class="mb-1" i18n>Create new authority from this field</div>
60         <div>
61           <button type="button" class="btn btn-outline-info" 
62             (click)="createNewAuthority()">Immediately</button>
63           <button type="button" class="btn btn-outline-info ms-2" 
64             (click)="createNewAuthority(true)">Create and Edit</button>
65         </div>
66       </div>
67     </div>
68     <div class="row border-bottom border-secondary p-2 d-flex">
69       <div class="flex-1">
70         <button type="button" class="btn btn-outline-dark" [disabled]="pager.offset === 0"
71           (click)="getPage(0)" i18n>Start</button>
72         <button type="button" class="btn btn-outline-dark ms-2"
73           (click)="getPage(-1)" i18n>Previous</button>
74         <button type="button" class="btn btn-outline-dark ms-2"
75           (click)="getPage(1)" i18n>Next</button>
76       </div>
77       <div class="pt-2 mb-2">
78         <div class="form-check form-check-inline">
79           <input class="form-check-input" type="radio" value="heading"
80             [(ngModel)]="showAs" name='show-as-heading' id="show-as-heading">
81           <label class="form-label form-check-label" for="show-as-heading" i18n>Show As Heading</label>
82         </div>
83         <div class="form-check form-check-inline">
84           <input class="form-check-input" type="radio" value="marc"
85             [(ngModel)]="showAs" name='show-as-heading' id="show-as-marc">
86           <label class="form-label form-check-label" for="show-as-marc" i18n>Show As MARC</label>
87         </div>
88       </div>
89     </div>
90     <ul *ngFor="let entry of browseData">
91       <li class="d-flex mt-1">
92         <div class="flex-1">
93           <ng-container
94             *ngTemplateOutlet="headingField;context:{field:entry.main_heading, authId: entry.authority_id}">
95           </ng-container>
96         </div>
97         <div class="fst-italic">
98           <a target="_blank" 
99             i18n-title title="Authority Record ID {{entry.authority_id}}"
100             routerLink="/staff/cat/authority/edit/{{entry.authority_id}}">
101             #{{entry.authority_id}}
102           </a>
103         </div>
104       </li>
105       <ul *ngFor="let from of entry.see_froms">
106         <li class="mt-1">
107          <ng-container
108           *ngTemplateOutlet="headingField;context:{field:from, from:true}">
109          </ng-container>
110         </li>
111       </ul>
112       <ul *ngFor="let also of entry.see_alsos">
113         <li class="mt-1">
114          <ng-container
115           *ngTemplateOutlet="headingField;context:{field:also, also:true}">
116          </ng-container>
117         </li>
118       </ul>
119     </ul>
120   </div>
121 </ng-template>