]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/eg2/src/app/staff/share/marc-edit/authority-linking-dialog.component.html
LP1852782 Main entry link sets subfield 0
[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 class="btn btn-sm p-1 mr-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 bg-info">
34     <h4 class="modal-title" i18n>Manage Authority Links</h4>
35     <button type="button" class="close"
36       i18n-aria-label aria-label="Close" (click)="close()">
37       <span aria-hidden="true">&times;</span>
38     </button>
39   </div>
40   <div class="modal-body">
41     <div class="row border-bottom border-secondary p-2 d-flex">
42       <div class="flex-1 font-weight-bold p-1 pl-2 pt-2 ml-2">
43         <div>{{bibField.tag}} {{bibField.ind1}} {{bibField.ind2}}</div>
44
45         <div *ngFor="let sf of bibField.subfields">
46           <div class="form-check form-check-inline">
47             <input class="form-check-input" id="search-subfield-{{sf[0]}}" 
48               type="checkbox" [disabled]="!isControlledBibSf(sf[0])"
49               [(ngModel)]="selectedSubfields[sf[0]]" 
50               (change)="getPage(pager.offset)"/>
51
52             <span class="text-danger" i18n>‡</span>
53
54             <label class="form-check-label" for="search-subfield-{{sf[0]}}" i18n>
55               {{sf[0]}} {{sf[1]}}
56             </label>
57           </div>
58         </div>
59       </div>
60       <div class="ml-2 p-1">
61         <div class="mb-1" i18n>Create new authority from this field</div>
62         <div>
63           <button class="btn btn-outline-info" 
64             (click)="createNewAuthority()">Immediately</button>
65           <button class="btn btn-outline-info ml-2" 
66             (click)="createNewAuthority(true)">Create and Edit</button>
67         </div>
68       </div>
69     </div>
70     <div class="row border-bottom border-secondary p-2 d-flex">
71       <div class="flex-1">
72         <button class="btn btn-outline-dark" [disabled]="pager.offset == 0"
73           (click)="getPage(0)" i18n>Start</button>
74         <button class="btn btn-outline-dark ml-2"
75           (click)="getPage(-1)" i18n>Previous</button>
76         <button class="btn btn-outline-dark ml-2"
77           (click)="getPage(1)" i18n>Next</button>
78       </div>
79       <div class="pt-2 mb-2">
80         <div class="form-check form-check-inline">
81           <input class="form-check-input" type="radio" value="heading"
82             [(ngModel)]="showAs" name='show-as-heading' id="show-as-heading">
83           <label class="form-check-label" for="show-as-heading" i18n>Show As Heading</label>
84         </div>
85         <div class="form-check form-check-inline">
86           <input class="form-check-input" type="radio" value="marc"
87             [(ngModel)]="showAs" name='show-as-heading' id="show-as-marc">
88           <label class="form-check-label" for="show-as-marc" i18n>Show As MARC</label>
89         </div>
90       </div>
91     </div>
92     <ul *ngFor="let entry of browseData">
93       <li class="d-flex">
94         <div class="flex-1">
95           <ng-container
96             *ngTemplateOutlet="headingField;context:{field:entry.main_heading, authId: entry.authority_id}">
97           </ng-container>
98         </div>
99         <div class="font-italic" i18n-title i18n
100           title="Authority Record ID {{entry.authority_id}}">
101           #{{entry.authority_id}}
102         </div>
103       </li>
104       <ul *ngFor="let from of entry.see_froms">
105         <li i18n>
106          <ng-container
107           *ngTemplateOutlet="headingField;context:{field:from, from:true}">
108          </ng-container>
109         </li>
110       </ul>
111       <ul *ngFor="let also of entry.see_alsos">
112         <li i18n>
113          <ng-container
114           *ngTemplateOutlet="headingField;context:{field:also, also:true}">
115          </ng-container>
116         </li>
117       </ul>
118     </ul>
119   </div>
120 </ng-template>